Skip to content

Commit

Permalink
v1.9.1 fix tool btn not work on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
sharrlotte committed Feb 12, 2025
1 parent 63ea11a commit 9595357
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ description:
• [#00bfff[]] Website: [white[]]https://mindustry-tool.com[[]]
• [#ff6347[]] Discord: [white[]]https://discord.gg/AKQDvDED7y[[]]
'''
version: v1.9.0
version: v1.9.1

minGameVersion: 140

Expand Down
41 changes: 26 additions & 15 deletions src/mindytool/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,24 @@ private void addCustomButtons() {
schematicDialog.show();
});

Vars.ui.menufrag.addButton(new MenuButton("Tools", Icon.wrench, () -> {
}, //
new MenuButton(Core.bundle.format("map-browser"), Icon.map, () -> {
mapDialog.show();
}), //
new MenuButton(Core.bundle.format("server-browser"), Icon.menu, () -> {
serverDialog.show();
})//
));
if (Vars.mobile) {
Vars.ui.menufrag.addButton(Core.bundle.format("map-browser"), Icon.map, () -> {
mapDialog.show();
});
Vars.ui.menufrag.addButton(Core.bundle.format("server-browser"), Icon.menu, () -> {
serverDialog.show();
});
} else {
Vars.ui.menufrag.addButton(new MenuButton("Tools", Icon.wrench, () -> {
}, //
new MenuButton(Core.bundle.format("map-browser"), Icon.map, () -> {
mapDialog.show();
}), //
new MenuButton(Core.bundle.format("server-browser"), Icon.menu, () -> {
serverDialog.show();
})//
));
}
});
}

Expand All @@ -70,12 +79,14 @@ private void checkForUpdate() {
Jval json = Jval.read(res.getResultAsString());
String latestVersion = json.getString("tag_name");
if (!latestVersion.equals(currentVersion)) {
Log.info("Mod require update, current version: " + currentVersion + ", latest version: " + latestVersion);
Vars.ui.showConfirm(Core.bundle.format("messages.new-version", currentVersion, latestVersion) + "\nDiscord: https://discord.gg/72324gpuCd", () -> {
Core.app.post(() -> {
Vars.ui.mods.githubImportMod(Config.REPO_URL, true);
});
});
Log.info("Mod require update, current version: " + currentVersion + ", latest version: "
+ latestVersion);
Vars.ui.showConfirm(Core.bundle.format("messages.new-version", currentVersion, latestVersion)
+ "\nDiscord: https://discord.gg/72324gpuCd", () -> {
Core.app.post(() -> {
Vars.ui.mods.githubImportMod(Config.REPO_URL, true);
});
});
} else {
Log.info("Mod up to date");
}
Expand Down

0 comments on commit 9595357

Please sign in to comment.