Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
xzxADIxzx committed Oct 1, 2021
1 parent 0134bec commit 3034d87
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Scheme Size",
"description": "Mod that could... Increases the maximum size of schemes to 512 blocks!\nMobile Support!",
"author": "xzxADIxzx",
"version": "1.74",
"version": "1.75",
"minGameVersion": "131",
"hidden": true,
"main": "mindustry.game.SchemeSize"
Expand Down
22 changes: 22 additions & 0 deletions src/input/ModInputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,28 @@ public void drawOverRequestMod(BuildPlan request){
Draw.reset();
}

public void showSchematicSaveMod(){
if(lastSchematic == null) return;

ui.showTextInput("@schematic.add", "@name", "", text -> {
Schematic replacement = schematics.all().find(s -> s.name().equals(text));
if(replacement != null){
ui.showConfirm("@confirm", "@schematic.replace", () -> {
schematics.overwrite(replacement, lastSchematic);
ui.showInfoFade("@schematic.saved");
ui.schematics.showInfo(replacement);
});
}else{
lastSchematic.tags.put("name", text);
lastSchematic.tags.put("description", "");
schematics.add(lastSchematic);
ui.showInfoFade("@schematic.saved");
ui.schematics.showInfo(lastSchematic);
Events.fire(new SchematicCreateEvent(lastSchematic));
}
});
}

public int rawTileXMod(){
return World.toTile(Core.input.mouseWorld().x);
}
Expand Down
2 changes: 1 addition & 1 deletion src/input/ModMobileInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public void buildUI(Group group){

ImageButtonStyle style = Styles.clearPartiali;

b.button(Icon.save, style, this::showSchematicSave).disabled(f -> lastSchematic == null || lastSchematic.file != null);
b.button(Icon.save, style, this::showSchematicSaveMod).disabled(f -> lastSchematic == null || lastSchematic.file != null);
b.button(Icon.cancel, style, () -> {
selectRequests.clear();
lastSchematic = null;
Expand Down

0 comments on commit 3034d87

Please sign in to comment.