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) { public function init(level:MarbleWorld, onFinish:Void->Void) {
this.level = level; this.level = level;
var isUltra = level.mission.game.toLowerCase() == "ultra";
var marbleDts = new DtsObject(); var marbleDts = new DtsObject();
marbleDts.dtsPath = Settings.optionsSettings.marbleModel; marbleDts.dtsPath = Settings.optionsSettings.marbleModel;
marbleDts.matNameOverride.set("base.marble", Settings.optionsSettings.marbleSkin + ".marble"); marbleDts.matNameOverride.set("base.marble", Settings.optionsSettings.marbleSkin + ".marble");
@ -256,7 +258,11 @@ class Marble extends GameObject {
// Calculate radius according to marble model (egh) // Calculate radius according to marble model (egh)
var b = marbleDts.getBounds(); var b = marbleDts.getBounds();
var avgRadius = (b.xSize + b.ySize + b.zSize) / 6; 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); 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!'; text += 'You beat the <font color="#FFDD22">Ultimate</font> Time!';
} else { } else {
if (mission.goldTime > 0 && timeState.gameplayClock < mission.goldTime) { 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!'; text += 'You beat the <font color="#FFCC00">Gold</font> Time!';
else else
text += 'You beat the <font color="#CCCCCC">Platinum</font> Time!'; 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>'; lineelems[i].text.text = '<font color="#FFDD22">${Util.formatTime(scoreData[i].time)}</font>';
} else { } else {
if (scoreData[i].time < mission.goldTime) { 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>'; lineelems[i].text.text = '<font color="#FFCC00">${Util.formatTime(scoreData[i].time)}</font>';
else else
lineelems[i].text.text = '<font color="#CCCCCC">${Util.formatTime(scoreData[i].time)}</font>'; 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); var leftColumn = new GuiMLText(domcasual24, mlFontLoader);
leftColumn.text.lineSpacing = 5; leftColumn.text.lineSpacing = 5;
leftColumn.text.textColor = 0xFFFFFF; 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.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true);
leftColumn.position = new Vector(25, 165); leftColumn.position = new Vector(25, 165);
leftColumn.extent = new Vector(293, 211); leftColumn.extent = new Vector(293, 211);
@ -280,7 +280,7 @@ class EndGameGui extends GuiControl {
var rightColumn = new GuiMLText(domcasual24, mlFontLoader); var rightColumn = new GuiMLText(domcasual24, mlFontLoader);
rightColumn.text.lineSpacing = 5; rightColumn.text.lineSpacing = 5;
rightColumn.text.textColor = 0xFFFFFF; 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.text.filter = new DropShadow(1.414, 0.785, 0xffffff, 1, 0, 0.4, 1, true);
rightColumn.position = new Vector(235, 165); rightColumn.position = new Vector(235, 165);
rightColumn.extent = new Vector(293, 211); 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>'; lineelems[i].text.text = '<font color="#FFDD22">${Util.formatTime(scoreData[i].time)}</font>';
} else { } else {
if (scoreData[i].time < mission.goldTime) { 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 { } else {
lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}';
} }

View file

@ -15,7 +15,15 @@ class HelpCreditsGui extends GuiImage {
var manualPageList:GuiTextListCtrl; var manualPageList:GuiTextListCtrl;
public function new() { 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()); super(img.resource.toTile());
this.position = new Vector(0, 0); this.position = new Vector(0, 0);
this.extent = new Vector(640, 480); this.extent = new Vector(640, 480);

View file

@ -11,7 +11,17 @@ class LoadingGui extends GuiImage {
public var setProgress:Float->Void; public var setProgress:Float->Void;
public function new(missionName:String, game:String) { 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()); super(img.resource.toTile());
this.horizSizing = Width; this.horizSizing = Width;
this.vertSizing = Height; this.vertSizing = Height;

View file

@ -11,7 +11,15 @@ import src.Replay;
class MainMenuGui extends GuiImage { class MainMenuGui extends GuiImage {
public function new() { 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()); super(img.resource.toTile());
var domcasual32fontdata = ResourceLoader.getFileEntry("data/font/DomCasualD.fnt"); var domcasual32fontdata = ResourceLoader.getFileEntry("data/font/DomCasualD.fnt");
var domcasual32b = new BitmapFont(domcasual32fontdata.entry); var domcasual32b = new BitmapFont(domcasual32fontdata.entry);

View file

@ -19,7 +19,15 @@ class OptionsDlg extends GuiImage {
var musicSliderFunc:(dt:Float, mouseState:MouseState) -> Void; var musicSliderFunc:(dt:Float, mouseState:MouseState) -> Void;
public function new() { 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()); super(img.resource.toTile());
this.horizSizing = Width; this.horizSizing = Width;
this.vertSizing = Height; this.vertSizing = Height;

View file

@ -65,7 +65,17 @@ class PlayMissionGui extends GuiImage {
currentCategory = PlayMissionGui.currentCategoryStatic; currentCategory = PlayMissionGui.currentCategoryStatic;
currentGame = PlayMissionGui.currentGameStatic; 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()); super(img.resource.toTile());
this.horizSizing = Width; this.horizSizing = Width;
@ -735,7 +745,7 @@ class PlayMissionGui extends GuiImage {
@:privateAccess pmDifficulty.anim.frames = loadButtonImages('data/ui/play/difficulty_${category}'); @: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(); 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; pmAchievements.disabled = false;
} else { } else {
pmAchievements.disabled = true; pmAchievements.disabled = true;
@ -744,12 +754,11 @@ class PlayMissionGui extends GuiImage {
currentCategoryStatic = currentCategory; currentCategoryStatic = currentCategory;
if (currentGame != game) { 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')) currentGameStatic = game;
.resource.toTile(); currentGame = game;
this.bmp.tile = chooseBg().resource.toTile();
} }
currentGameStatic = game;
currentGame = game;
setSelectedFunc(currentList.length - 1); setSelectedFunc(currentList.length - 1);
if (doRender) if (doRender)
this.render(cast(this.parent, Canvas).scene2d); this.render(cast(this.parent, Canvas).scene2d);
@ -770,7 +779,7 @@ class PlayMissionGui extends GuiImage {
if (topScore.time < currentMission.ultimateTime) { if (topScore.time < currentMission.ultimateTime) {
scoreColor = "#FFCC33"; scoreColor = "#FFCC33";
} else if (topScore.time < currentMission.goldTime) { } else if (topScore.time < currentMission.goldTime) {
if (currentMission.game == "gold") if (currentMission.game == "gold" || currentMission.game == "Ultra")
scoreColor = "#FFFF00" scoreColor = "#FFFF00"
else else
scoreColor = "#CCCCCC"; scoreColor = "#CCCCCC";
@ -871,7 +880,7 @@ class PlayMissionGui extends GuiImage {
if (score.time < currentMission.ultimateTime) { if (score.time < currentMission.ultimateTime) {
scoreColor = "#FFCC33"; scoreColor = "#FFCC33";
} else if (score.time < currentMission.goldTime) { } else if (score.time < currentMission.goldTime) {
if (currentMission.game == "gold") if (currentMission.game == "gold" || currentMission.game.toLowerCase() == "ultra")
scoreColor = "#FFFF00"; scoreColor = "#FFFF00";
else else
scoreColor = "#CCCCCC"; 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>'; 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>'; 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 { } 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>'; 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 = ''; pmParTextRight.text.text = '';

View file

@ -12,7 +12,15 @@ import src.Util;
class TouchCtrlsEditGui extends GuiImage { class TouchCtrlsEditGui extends GuiImage {
public function new() { 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()); super(img.resource.toTile());
this.horizSizing = Width; this.horizSizing = Width;
this.vertSizing = Height; this.vertSizing = Height;