mbu marble and ui alterations

This commit is contained in:
RandomityGuy 2022-12-05 19:54:02 +05:30
parent 8980869082
commit dd6a0be20d
8 changed files with 80 additions and 19 deletions

View file

@ -235,6 +235,8 @@ class Marble extends GameObject {
public function init(level:MarbleWorld, onFinish:Void->Void) {
this.level = level;
var isUltra = level.mission.game.toLowerCase() == "ultra";
var marbleDts = new DtsObject();
marbleDts.dtsPath = Settings.optionsSettings.marbleModel;
marbleDts.matNameOverride.set("base.marble", Settings.optionsSettings.marbleSkin + ".marble");
@ -256,7 +258,11 @@ class Marble extends GameObject {
// Calculate radius according to marble model (egh)
var b = marbleDts.getBounds();
var avgRadius = (b.xSize + b.ySize + b.zSize) / 6;
this._radius = avgRadius;
if (isUltra) {
this._radius = 0.3;
marbleDts.scale(0.3 / avgRadius);
} else
this._radius = avgRadius;
this.collider = new SphereCollisionEntity(cast this);

View file

@ -206,7 +206,7 @@ class EndGameGui extends GuiControl {
text += 'You beat the <font color="#FFDD22">Ultimate</font> Time!';
} else {
if (mission.goldTime > 0 && timeState.gameplayClock < mission.goldTime) {
if (mission.game == "gold")
if (mission.game == "gold" || mission.game.toLowerCase() == "ultra")
text += 'You beat the <font color="#FFCC00">Gold</font> Time!';
else
text += 'You beat the <font color="#CCCCCC">Platinum</font> Time!';
@ -255,7 +255,7 @@ class EndGameGui extends GuiControl {
lineelems[i].text.text = '<font color="#FFDD22">${Util.formatTime(scoreData[i].time)}</font>';
} else {
if (scoreData[i].time < mission.goldTime) {
if (mission.game == "gold")
if (mission.game == "gold" || mission.game.toLowerCase() == "ultra")
lineelems[i].text.text = '<font color="#FFCC00">${Util.formatTime(scoreData[i].time)}</font>';
else
lineelems[i].text.text = '<font color="#CCCCCC">${Util.formatTime(scoreData[i].time)}</font>';
@ -268,7 +268,7 @@ class EndGameGui extends GuiControl {
var leftColumn = new GuiMLText(domcasual24, mlFontLoader);
leftColumn.text.lineSpacing = 5;
leftColumn.text.textColor = 0xFFFFFF;
leftColumn.text.text = 'Par Time:<br/>${mission.game == "gold" ? '<font color="#FFCC00">Gold Time:</font>' : '<font color="#CCCCCC">Platinum Time:</font>'}<br/>${mission.ultimateTime != 0 ? '<font color="#FFDD22">Ultimate Time:</font><br/>' : ''}<font face="Arial14"><br/></font><font color="#FFFFFF" face="DomCasual24">Time Passed:<br/>Clock Bonuses:</font>';
leftColumn.text.text = 'Par Time:<br/>${mission.game == "gold" || mission.game.toLowerCase() == "ultra" ? '<font color="#FFCC00">Gold Time:</font>' : '<font color="#CCCCCC">Platinum Time:</font>'}<br/>${mission.ultimateTime != 0 ? '<font color="#FFDD22">Ultimate Time:</font><br/>' : ''}<font face="Arial14"><br/></font><font color="#FFFFFF" face="DomCasual24">Time Passed:<br/>Clock Bonuses:</font>';
leftColumn.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true);
leftColumn.position = new Vector(25, 165);
leftColumn.extent = new Vector(293, 211);
@ -280,7 +280,7 @@ class EndGameGui extends GuiControl {
var rightColumn = new GuiMLText(domcasual24, mlFontLoader);
rightColumn.text.lineSpacing = 5;
rightColumn.text.textColor = 0xFFFFFF;
rightColumn.text.text = '${Util.formatTime(mission.qualifyTime == Math.POSITIVE_INFINITY ? 5999.999 : mission.qualifyTime)}<br/><font color="${mission.game == "gold" ? '#FFCC00' : '#CCCCCC'}">${Util.formatTime(mission.goldTime)}</font><br/>${mission.ultimateTime != 0 ? '<font color="#FFDD22">${Util.formatTime(mission.ultimateTime)}</font><br/>' : ''}<font face="Arial14"><br/></font><font color="#FFFFFF" face="DomCasual24">${Util.formatTime(elapsedTime)}<br/>${Util.formatTime(bonusTime)}</font>';
rightColumn.text.text = '${Util.formatTime(mission.qualifyTime == Math.POSITIVE_INFINITY ? 5999.999 : mission.qualifyTime)}<br/><font color="${mission.game == "gold" || mission.game.toLowerCase() == "ultra" ? '#FFCC00' : '#CCCCCC'}">${Util.formatTime(mission.goldTime)}</font><br/>${mission.ultimateTime != 0 ? '<font color="#FFDD22">${Util.formatTime(mission.ultimateTime)}</font><br/>' : ''}<font face="Arial14"><br/></font><font color="#FFFFFF" face="DomCasual24">${Util.formatTime(elapsedTime)}<br/>${Util.formatTime(bonusTime)}</font>';
rightColumn.text.filter = new DropShadow(1.414, 0.785, 0xffffff, 1, 0, 0.4, 1, true);
rightColumn.position = new Vector(235, 165);
rightColumn.extent = new Vector(293, 211);
@ -327,7 +327,7 @@ class EndGameGui extends GuiControl {
lineelems[i].text.text = '<font color="#FFDD22">${Util.formatTime(scoreData[i].time)}</font>';
} else {
if (scoreData[i].time < mission.goldTime) {
lineelems[i].text.text = '<font color="${mission.game == "gold" ? '#FFCC00' : '#CCCCCC'}">${Util.formatTime(scoreData[i].time)}</font>';
lineelems[i].text.text = '<font color="${mission.game == "gold" || mission.game.toLowerCase() == "ultra" ? '#FFCC00' : '#CCCCCC'}">${Util.formatTime(scoreData[i].time)}</font>';
} else {
lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}';
}

View file

@ -15,7 +15,15 @@ class HelpCreditsGui extends GuiImage {
var manualPageList:GuiTextListCtrl;
public function new() {
var img = Math.random() >= 0.7 ? ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg') : ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
function chooseBg() {
var rand = Math.random();
if (rand >= 0 && rand <= 0.244)
return ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
if (rand > 0.244 && rand <= 0.816)
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
}
var img = chooseBg();
super(img.resource.toTile());
this.position = new Vector(0, 0);
this.extent = new Vector(640, 480);

View file

@ -11,7 +11,17 @@ class LoadingGui extends GuiImage {
public var setProgress:Float->Void;
public function new(missionName:String, game:String) {
var img = game == "platinum" ? ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg') : ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
function chooseBg() {
if (game == "gold")
return ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
if (game == "platinum")
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
if (game == "ultra")
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
return null;
}
var img = chooseBg();
super(img.resource.toTile());
this.horizSizing = Width;
this.vertSizing = Height;

View file

@ -11,7 +11,15 @@ import src.Replay;
class MainMenuGui extends GuiImage {
public function new() {
var img = Math.random() >= 0.7 ? ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg') : ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
function chooseBg() {
var rand = Math.random();
if (rand >= 0 && rand <= 0.244)
return ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
if (rand > 0.244 && rand <= 0.816)
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
}
var img = chooseBg();
super(img.resource.toTile());
var domcasual32fontdata = ResourceLoader.getFileEntry("data/font/DomCasualD.fnt");
var domcasual32b = new BitmapFont(domcasual32fontdata.entry);

View file

@ -19,7 +19,15 @@ class OptionsDlg extends GuiImage {
var musicSliderFunc:(dt:Float, mouseState:MouseState) -> Void;
public function new() {
var img = Math.random() >= 0.7 ? ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg') : ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
function chooseBg() {
var rand = Math.random();
if (rand >= 0 && rand <= 0.244)
return ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
if (rand > 0.244 && rand <= 0.816)
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
}
var img = chooseBg();
super(img.resource.toTile());
this.horizSizing = Width;
this.vertSizing = Height;

View file

@ -65,7 +65,17 @@ class PlayMissionGui extends GuiImage {
currentCategory = PlayMissionGui.currentCategoryStatic;
currentGame = PlayMissionGui.currentGameStatic;
var img = currentGame == "platinum" ? ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg') : ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
function chooseBg() {
if (currentGame == "gold")
return ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
if (currentGame == "platinum")
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
if (currentGame == "ultra")
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
return null;
}
var img = chooseBg();
super(img.resource.toTile());
this.horizSizing = Width;
@ -735,7 +745,7 @@ class PlayMissionGui extends GuiImage {
@:privateAccess pmDifficulty.anim.frames = loadButtonImages('data/ui/play/difficulty_${category}');
pmDifficultyMarble.bmp.tile = ResourceLoader.getResource('data/ui/play/marble_${game}.png', ResourceLoader.getImage, this.imageResources).toTile();
if (game == "platinum") {
if (game == "platinum" || game == "ultra") {
pmAchievements.disabled = false;
} else {
pmAchievements.disabled = true;
@ -744,12 +754,11 @@ class PlayMissionGui extends GuiImage {
currentCategoryStatic = currentCategory;
if (currentGame != game) {
this.bmp.tile = (game == "platinum" ? ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg') : ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg'))
.resource.toTile();
currentGameStatic = game;
currentGame = game;
this.bmp.tile = chooseBg().resource.toTile();
}
currentGameStatic = game;
currentGame = game;
setSelectedFunc(currentList.length - 1);
if (doRender)
this.render(cast(this.parent, Canvas).scene2d);
@ -770,7 +779,7 @@ class PlayMissionGui extends GuiImage {
if (topScore.time < currentMission.ultimateTime) {
scoreColor = "#FFCC33";
} else if (topScore.time < currentMission.goldTime) {
if (currentMission.game == "gold")
if (currentMission.game == "gold" || currentMission.game == "Ultra")
scoreColor = "#FFFF00"
else
scoreColor = "#CCCCCC";
@ -871,7 +880,7 @@ class PlayMissionGui extends GuiImage {
if (score.time < currentMission.ultimateTime) {
scoreColor = "#FFCC33";
} else if (score.time < currentMission.goldTime) {
if (currentMission.game == "gold")
if (currentMission.game == "gold" || currentMission.game.toLowerCase() == "ultra")
scoreColor = "#FFFF00";
else
scoreColor = "#CCCCCC";
@ -902,6 +911,10 @@ class PlayMissionGui extends GuiImage {
pmParText.text.text = '<font color="#FFE3E3" face="MarkerFelt20">Qualify: <font color="#FFFFFF">${(currentMission.qualifyTime != Math.POSITIVE_INFINITY) ? Util.formatTime(currentMission.qualifyTime) : "N/A"}</font></font>';
pmParTextRight.text.text = '<p align="right"><font color="#FFE3E3" face="MarkerFelt20">Gold: <font color="#FFFF00">${Util.formatTime(currentMission.goldTime)}</font></font></p>';
}
if (currentMission.game.toLowerCase() == "ultra") {
pmParText.text.text = '<font color="#FFE3E3" face="MarkerFelt20">Gold: <font color="#FFFF00">${Util.formatTime(currentMission.goldTime)}</font></font>';
pmParTextRight.text.text = '<p align="right"><font color="#FFE3E3" face="MarkerFelt20">Ultimate: <font color="#FFCC33">${Util.formatTime(currentMission.ultimateTime)}</font></font></p>';
}
} else {
pmParText.text.text = '<font color="#FFE3E3" face="MarkerFelt24"><p align="center">${currentMission.game == "gold" ? "Qualify" : "Par"} Time: <font color="#FFFFFF">${(currentMission.qualifyTime != Math.POSITIVE_INFINITY) ? Util.formatTime(currentMission.qualifyTime) : "N/A"}</font></p></font>';
pmParTextRight.text.text = '';

View file

@ -12,7 +12,15 @@ import src.Util;
class TouchCtrlsEditGui extends GuiImage {
public function new() {
var img = Math.random() >= 0.7 ? ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg') : ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
function chooseBg() {
var rand = Math.random();
if (rand >= 0 && rand <= 0.244)
return ResourceLoader.getImage('data/ui/backgrounds/gold/${cast (Math.floor(Util.lerp(1, 12, Math.random())), Int)}.jpg');
if (rand > 0.244 && rand <= 0.816)
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
}
var img = chooseBg();
super(img.resource.toTile());
this.horizSizing = Width;
this.vertSizing = Height;