mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
add support for local customs
This commit is contained in:
parent
3091e33384
commit
86461bf11f
2 changed files with 27 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ class LoadingGui extends GuiImage {
|
||||||
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
|
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
|
||||||
if (game == "ultra")
|
if (game == "ultra")
|
||||||
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
|
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
|
||||||
return null;
|
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
var img = chooseBg();
|
var img = chooseBg();
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ class PlayMissionGui extends GuiImage {
|
||||||
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
|
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
|
||||||
if (currentGame == "ultra")
|
if (currentGame == "ultra")
|
||||||
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
|
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
|
||||||
return null;
|
return ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
var img = chooseBg();
|
var img = chooseBg();
|
||||||
|
|
@ -642,6 +642,22 @@ class PlayMissionGui extends GuiImage {
|
||||||
}
|
}
|
||||||
pmDifficultyCtrl.addChild(pmDifficultyUltraCustom);
|
pmDifficultyCtrl.addChild(pmDifficultyUltraCustom);
|
||||||
|
|
||||||
|
var pmDifficultyCustomCustom = new GuiButtonText(loadButtonImages("data/ui/play/difficulty_highlight-120"), markerFelt24);
|
||||||
|
pmDifficultyCustomCustom.position = new Vector(397, 164);
|
||||||
|
pmDifficultyCustomCustom.ratio = -1 / 16;
|
||||||
|
pmDifficultyCustomCustom.setExtent(new Vector(120, 31));
|
||||||
|
pmDifficultyCustomCustom.txtCtrl.text.text = " Custom";
|
||||||
|
pmDifficultyCustomCustom.pressedAction = (e) -> {
|
||||||
|
if (MissionList.customMissions.length == 0) {
|
||||||
|
var mbo = new MessageBoxOkDlg("No custom missions are installed!");
|
||||||
|
MarbleGame.canvas.pushDialog(mbo);
|
||||||
|
} else {
|
||||||
|
currentCategory = "custom";
|
||||||
|
setCategoryFunc("custom", "custom");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pmDifficultyCtrl.addChild(pmDifficultyCustomCustom);
|
||||||
|
|
||||||
var pmDividerR = new GuiImage(ResourceLoader.getResource('data/ui/menu/brown/divider-orange-r.png', ResourceLoader.getImage, this.imageResources)
|
var pmDividerR = new GuiImage(ResourceLoader.getResource('data/ui/menu/brown/divider-orange-r.png', ResourceLoader.getImage, this.imageResources)
|
||||||
.toTile());
|
.toTile());
|
||||||
pmDividerR.horizSizing = Left;
|
pmDividerR.horizSizing = Left;
|
||||||
|
|
@ -801,10 +817,18 @@ class PlayMissionGui extends GuiImage {
|
||||||
case 'gold' if (Marbleland.goldMissions.length != 0): Marbleland.goldMissions;
|
case 'gold' if (Marbleland.goldMissions.length != 0): Marbleland.goldMissions;
|
||||||
case 'platinum' if (Marbleland.platinumMissions.length != 0): Marbleland.platinumMissions;
|
case 'platinum' if (Marbleland.platinumMissions.length != 0): Marbleland.platinumMissions;
|
||||||
case 'ultra' if (Marbleland.ultraMissions.length != 0): Marbleland.ultraMissions;
|
case 'ultra' if (Marbleland.ultraMissions.length != 0): Marbleland.ultraMissions;
|
||||||
|
case 'custom' if (MissionList.customMissions.length != 0): MissionList.customMissions;
|
||||||
default: currentList;
|
default: currentList;
|
||||||
}) : MissionList.missionList[game][category];
|
}) : MissionList.missionList[game][category];
|
||||||
|
|
||||||
@: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();
|
if (game != "custom") {
|
||||||
|
pmDifficultyMarble.bmp.visible = true;
|
||||||
|
pmDifficultyMarble.bmp.tile = ResourceLoader.getResource('data/ui/play/marble_${game}.png', ResourceLoader.getImage, this.imageResources)
|
||||||
|
.toTile();
|
||||||
|
} else {
|
||||||
|
pmDifficultyMarble.bmp.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (game == "platinum") {
|
if (game == "platinum") {
|
||||||
pmAchievements.disabled = false;
|
pmAchievements.disabled = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue