Mindustry icon indicating copy to clipboard operation
Mindustry copied to clipboard

Press T to save schematic

Open JniTrRny opened this issue 3 years ago • 2 comments

I'm just too lazy to drag my mouse and click the "Save Schematic..." button this PR make pressing "T" while selecting blocks jumps into the save schematic dialog, rather than dragging the mouse into the bottom of the screen and click the shiny shiny button.

For Your Information: this PR does not create a new keybind, it reused the open schematics UI button, as we don't open schematics while saving a schematic anyways.


Behavior:

when you're selecting/copying blocks, pressing T will redirect you to the save schematic screen, and if you already saved the schematic, pressing T will redirect you to the schematics dialog instead, like it was. but in some extremely specific cases, you may want to open schematics dialog while selecting/copying blocks, you can do that by pressing Ctrl + T, note that keybinds may vary, nothing in the PR is hardcoded.


  • [X] the behavior is fine and acceptable, but I'd like to improve it more.
  • [ ] I'll try to reduce the if/else, if possible.

https://user-images.githubusercontent.com/85090668/130087249-5159f02b-dcbe-481d-9ea1-021081aae9b7.mp4


If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:

  • [X] I have read the contribution guidelines.
  • [X] I have ensured that my code compiles, if applicable.
  • [X] I have ensured that any new features in this PR function correctly in-game, if applicable.

JniTrRny avatar Aug 19 '21 14:08 JniTrRny

Nice, but could use a desktop-only "[T] to save schematic" key hint at the bottom of the screen, to make the feature discoverable to players who don't read patch notes religiously.

It can probably be jammed in DesktopInput.java. You will need to add a new localization string in bundle.properties.

joshuaptfan avatar Aug 19 '21 15:08 joshuaptfan

sounds good, I'll add it now or later if I'm free.

JniTrRny avatar Aug 19 '21 16:08 JniTrRny