Skip to content

Commit

Permalink
Bump Command Keys to 12
Browse files Browse the repository at this point in the history
Otherwise some units in the game don't have enough hotkeys like the
ballista.
Moves the hotkey for attacking units to ,
Moves the hotkey for font cOlor to O
  • Loading branch information
Rampoina committed Aug 2, 2022
1 parent cafafe1 commit ab7438e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mk/shared/glestkeys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CameraModeRight=right
CameraModeUp=up
CameraModeDown=down
PauseGame=P
ChangeFontColor=C
ChangeFontColor=O
GameSpeedIncrease='+'
GameSpeedDecrease='-'
ExitKey=escape
Expand Down Expand Up @@ -40,6 +40,8 @@ CommandKey7=D
CommandKey8=F
CommandKey9=Z
CommandKey10=X
CommandKey11=C
CommandKey12=V
HotKeyCenterCameraOnSelection=G
HotKeySelectIdleHarvesterUnit=I
HotKeySelectBuiltBuilding=B
Expand All @@ -48,7 +50,7 @@ HotKeyDumpWorldToLog=\
HotKeyRotateUnitDuringPlacement=R
HotKeySelectDamagedUnit=U
HotKeySelectStoreUnit=T
HotKeySelectedUnitsAttack=V
HotKeySelectedUnitsAttack=,
HotKeySelectedUnitsStop=;
HotKeyToggleOSMouseEnabled=/
ChatTeamMode=H
Expand Down
4 changes: 2 additions & 2 deletions source/glest_game/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ void Gui::hotKey(SDL_KeyboardEvent key) {
clickCommonCommand(ccStop);
}

for (int i=0; i<10; i++) {
for (int i=0; i<commandKeys; i++) {
string name = "CommandKey" + intToStr(i+1);
if(isKeyPressed(configKeys.getSDLKey(name.c_str()),key) == true) {
if(activeCommandType != NULL && activeCommandType->getClass() == ccBuild) {
Expand Down Expand Up @@ -800,7 +800,7 @@ void Gui::computeInfoString(int posDisplay){

if(posDisplay!=invalidPos && selection.isCommandable()){
string hotkey = "";
if (posDisplay < 10) { // there's 10 configurable command hotkeys
if (posDisplay < commandKeys) {
hotkey=lang.getString("HotKey")+": "+SDL_GetKeyName(configKeys.getSDLKey(commandKeyName.c_str())) +"\n\n";
}
if(!selectingBuilding){
Expand Down
1 change: 1 addition & 0 deletions source/glest_game/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class SelectionQuad{

class Gui {
public:
static const int commandKeys= 12;
static const int maxSelBuff= 128*5;
static const int upgradeDisplayIndex= 8;

Expand Down

0 comments on commit ab7438e

Please sign in to comment.