mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix search
This commit is contained in:
parent
b4324707f3
commit
0c9db3ea58
1 changed files with 15 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import net.NetCommands;
|
||||||
import src.Marbleland;
|
import src.Marbleland;
|
||||||
import h2d.Tile;
|
import h2d.Tile;
|
||||||
import hxd.BitmapData;
|
import hxd.BitmapData;
|
||||||
|
|
@ -22,13 +23,14 @@ class MPSearchGui extends GuiImage {
|
||||||
|
|
||||||
var missionList = [];
|
var missionList = [];
|
||||||
if (!isCustom) {
|
if (!isCustom) {
|
||||||
for (diff in MissionList.missionList["multiplayer"]) {
|
for (diffName => diff in MissionList.missionList["multiplayer"]) {
|
||||||
for (mis in diff) {
|
for (mis in diff) {
|
||||||
missionList.push({
|
missionList.push({
|
||||||
mis: mis,
|
mis: mis,
|
||||||
name: mis.title,
|
name: mis.title,
|
||||||
artist: mis.artist,
|
artist: mis.artist,
|
||||||
path: mis.path
|
path: mis.path,
|
||||||
|
difficulty: diffName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -39,7 +41,8 @@ class MPSearchGui extends GuiImage {
|
||||||
mis: mis,
|
mis: mis,
|
||||||
name: mis.title,
|
name: mis.title,
|
||||||
artist: mis.artist,
|
artist: mis.artist,
|
||||||
path: mis.path
|
path: mis.path,
|
||||||
|
difficulty: "custom"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -130,7 +133,15 @@ class MPSearchGui extends GuiImage {
|
||||||
searchPlay.pressedAction = (e) -> {
|
searchPlay.pressedAction = (e) -> {
|
||||||
if (selectedIdx != -1) {
|
if (selectedIdx != -1) {
|
||||||
var mis = retrieveMissionList[selectedIdx];
|
var mis = retrieveMissionList[selectedIdx];
|
||||||
cast(this.parent, Canvas).marbleGame.playMission(mis.mis);
|
|
||||||
|
if (mis.difficulty == "custom") {
|
||||||
|
var idx = Marbleland.multiplayerMissions.indexOf(mis.mis);
|
||||||
|
NetCommands.setLobbyLevelIndex(mis.difficulty, idx);
|
||||||
|
} else {
|
||||||
|
var idx = MissionList.missionList["multiplayer"][mis.difficulty].indexOf(mis.mis);
|
||||||
|
NetCommands.setLobbyLevelIndex(mis.difficulty, idx);
|
||||||
|
}
|
||||||
|
MarbleGame.canvas.popDialog(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.addChild(searchPlay);
|
this.addChild(searchPlay);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue