diff --git a/src/DifBuilder.hx b/src/DifBuilder.hx index d7481939..bcca2f2e 100644 --- a/src/DifBuilder.hx +++ b/src/DifBuilder.hx @@ -729,7 +729,7 @@ class DifBuilder { var material:Material; var texture:Texture; if (canFindTex(grp)) { - texture = ResourceLoader.getTexture(tex(grp)).resource; + texture = ResourceLoader.getTextureRealpath(tex(grp)).resource; // ResourceLoader.getTexture(tex(grp), false).resource; texture.wrap = Wrap.Repeat; texture.mipMap = Nearest; var exactName = StringTools.replace(texture.name, "data/", ""); diff --git a/src/Marbleland.hx b/src/Marbleland.hx index 6618c5c1..a169c4d8 100644 --- a/src/Marbleland.hx +++ b/src/Marbleland.hx @@ -28,6 +28,16 @@ class Marbleland { static function parseMissionList(s:String, game:String) { var claJson:Array = Json.parse(s); + if (game == 'gold') { + claJson = claJson.filter(x -> x.modification == 'gold'); + } + if (game == 'platinum') { + claJson = claJson.filter(x -> x.gameType == 'single' && (x.gameMode == null || x.gameMode == 'null' || x.gamemode == '')); + } + if (game == 'ultra') { + claJson = claJson.filter(x -> x.gameType == 'single'); + } + var platDupes = new Map(); for (missionData in claJson) { var mission = new Mission(); @@ -49,6 +59,13 @@ class Marbleland { mission.hasEgg = missionData.hasEgg; mission.isClaMission = true; + if (game == 'platinum') { + if (platDupes.exists(mission.title + mission.description)) + continue; + else + platDupes.set(mission.title + mission.description, true); + } + switch (game) { case 'gold': goldMissions.push(mission); @@ -58,6 +75,16 @@ class Marbleland { platinumMissions.push(mission); } } + + // sort according to name + switch (game) { + case 'gold': + goldMissions.sort((x, y) -> x.title > y.title ? 1 : (x.title < y.title ? -1 : 0)); + case 'platinum': + platinumMissions.sort((x, y) -> x.title > y.title ? 1 : (x.title < y.title ? -1 : 0)); + case 'ultra': + ultraMissions.sort((x, y) -> x.title > y.title ? 1 : (x.title < y.title ? -1 : 0)); + } } public static function getMissionImage(id:Int, cb:Image->Void) { @@ -70,7 +97,7 @@ class Marbleland { } public static function download(id:Int, cb:Array->Void) { - Http.get('https://marbleblast.vani.ga/api/custom/${id}.zip', (zipData -> { + Http.get('https://marbleblast.vani.ga/api/custom/${id}.zip?assuming=none', (zipData -> { var reader = new Reader(new BytesInput(zipData)); var entries:Array = null; try { diff --git a/src/ResourceLoader.hx b/src/ResourceLoader.hx index 6c145d97..ae16b274 100644 --- a/src/ResourceLoader.hx +++ b/src/ResourceLoader.hx @@ -324,6 +324,10 @@ class ResourceLoader { public static function getTexture(path:String) { path = getProperFilepath(path); + return getTextureRealpath(path); + } + + public static function getTextureRealpath(path:String) { if (zipFilesystem.exists(path.toLowerCase())) { var img = new hxd.res.Image(zipFilesystem.get(path.toLowerCase())); Image.setupTextureFlags = (texObj) -> {