megaglest-source icon indicating copy to clipboard operation
megaglest-source copied to clipboard

Add Hotkeys for the unit and building commands

Open Rampoina opened this issue 2 years ago • 9 comments

This is a proposal to add hotkeys for every command. This adds 10 configurable keys that map to the commands as displayed in the GUI. It's meant to be used in a grid layout such as QWER ASDF ZXCV to make the locations more intuitive. (although it doesn't have to, users can set each hotkey wherever they want to)

Fixes #212

Rampoina avatar Jul 18 '22 17:07 Rampoina

@titiger would you like to test this with me and @Rampoina soon? Is this something you'd consider merging?

andy5995 avatar Jul 18 '22 17:07 andy5995

@Jammyjamjamman The controls are listed here in the README: https://raw.githubusercontent.com/MegaGlest/megaglest-source/master/docs/README.txt Is that generated from a script?

andy5995 avatar Jul 19 '22 23:07 andy5995

Yo @Rampoina , Good work!!! but wait up, tech engineer can't build Balista with hotkey. We need add at least 11 command. And Summoner can't update to dragon, cuz we checking by numberCommands at source/glest_game/gui/gui.cpp line 460 if (i < numberCommands) { mouseDownDisplayUnitSkills(i); computeDisplay(); } but some units like above have 3 commands in second line!

pavanvo avatar Aug 02 '22 03:08 pavanvo

@pavanvo thanks for testing! I've bumped the number of hotkeys to 12 (the full grid) and fixed the issue with the morphing units (numberCommands wasn't updated correctly again ... I don't know if I'm missing something here, it seems like a variable that should exist, but I wasn't able to find it)

Rampoina avatar Aug 02 '22 07:08 Rampoina

@Rampoina you forget to commit gui.h Now, with simple increment, it's working fine, but I'm trying to create another kind of check.

pavanvo avatar Aug 02 '22 08:08 pavanvo

@pavanvo It's not only an increment, now it uses posDisplay which is updated inside the previous for, including the case for morphing units. (I force pushed the missing gui.h in the same commit)

Rampoina avatar Aug 02 '22 08:08 Rampoina

@Jammyjamjamman The controls are listed here in the README: https://raw.githubusercontent.com/MegaGlest/megaglest-source/master/docs/README.txt Is that generated from a script?

Seems like this hasn't been done yet. @Jammyjamjamman imo this should be done before this gets merged.

andy5995 avatar Aug 08 '22 19:08 andy5995

There's some mods that crash the game with this patch:

  • prax 0.5.9.7 (find in mod center)
  • https://github.com/Robotkiller001/Megaglest-Improved-Mod
  • https://github.com/Robotkiller001/Insects-World-Mod

There might be more that don't work. I'm not sure what causes the crash. In e.g. prax the crash happens when loading "hexer".

Jammyjamjamman avatar Aug 27 '22 23:08 Jammyjamjamman

There's some mods that crash the game with this patch:

* prax 0.5.9.7 (find in mod center)

* https://github.com/Robotkiller001/Megaglest-Improved-Mod

* https://github.com/Robotkiller001/Insects-World-Mod

There might be more that don't work. I'm not sure what causes the crash. In e.g. prax the crash happens when loading "hexer".

i am tested on linux and windows - everything works fine, I think problem in build I found problem with "haxer"

pavanvo avatar Aug 28 '22 10:08 pavanvo