Subject: Re: HUD hotkeys do not work?
Update: when you select a unit, the hud hotkeys are deactivated.
src/ui/graphical/game/gamegui.cpp:186
DownloadSource code (Text): if (gameMap->getUnitSelection().getSelectedUnit() == nullptr)
{
hud->activateShortcuts();
}
else
{
//hud->deactivateShortcuts();
}
So I commented the line out and my hud hotkeys go back to working. I'm guessing this was done because some of the unit hotkeys overlap the hud hotkeys, but it certainly isn't obvious that this would be the case. In the original, the number keys 1-0 are used for the unit menu actions.
To quote the original readme.txt from ca.1995:
DownloadSource code (Text): Hot keys for unit commands:
Press 1 (or the first letter of the word) for these functions:
...Activate
...Allocate
...Auto-Survey
...Build
...Buy Upgrade
...Disable
...Place Mines
...Reload
...Repair
...Research
Press 2 (or the first letter of the word) for these functions:
...Load
...Start
...Steal
Press 3 (or the first letter of the word) for these functions:
...Attack
...Transfer
Press 4 (or the first letter of the word) for the Manual function.
Press 5 (or the first letter of the word) for these functions:
...Enter
...Upgrade
Press 6 (or the first letter of the word) for the Upgrade All function.
Press 7 (or the first letter of the word) for the Stop function.
Press 8 (or the first letter of the word) for the Sentry function.
Press 9 (or the first letter of the word) for the Done function.
Press 0 (or the first letter of the word) for the Remove function.
Then I notice my keyCenterUnit is not working. I tracked that down to
src/ui/graphical/game/hud.cpp:106
where I inserted the line
DownloadSource code (Text): auto centerButton = addChild (std::make_unique<cPushButton> (cPosition (4, 227), ePushButtonType::HudCenter));
/* oops, callback missing... */
centerButton->addClickShortcut (KeysList.keyCenterUnit);
signalConnectionManager.connect (centerButton->clicked, [&]() { centerClicked(); });
and now I can center the unit with the 'f' key. I guess nobody uses that key? How it got missed in the rush I don't know.
Miven Dooligan
Peace and cheer