Revert "refactor: remove some useless code,"
This reverts commit afc26199f7
.
This commit is contained in:
parent
8caa800ee1
commit
d5f15d2c72
|
@ -439,6 +439,14 @@ void Gui::hotKey(SDL_KeyboardEvent key) {
|
||||||
if(isKeyPressed(configKeys.getSDLKey("HotKeySelectStoreUnit"),key) == true) {
|
if(isKeyPressed(configKeys.getSDLKey("HotKeySelectStoreUnit"),key) == true) {
|
||||||
selectInterestingUnit(iutStore);
|
selectInterestingUnit(iutStore);
|
||||||
}
|
}
|
||||||
|
//else if(key == configKeys.getCharKey("HotKeySelectedUnitsAttack")) {
|
||||||
|
if(isKeyPressed(configKeys.getSDLKey("HotKeySelectedUnitsAttack"),key) == true) {
|
||||||
|
clickCommonCommand(ccAttack);
|
||||||
|
}
|
||||||
|
//else if(key == configKeys.getCharKey("HotKeySelectedUnitsStop")) {
|
||||||
|
if(isKeyPressed(configKeys.getSDLKey("HotKeySelectedUnitsStop"),key) == true) {
|
||||||
|
clickCommonCommand(ccStop);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<commandKeys; i++) {
|
for (int i=0; i<commandKeys; i++) {
|
||||||
string name = "CommandKey" + intToStr(i+1);
|
string name = "CommandKey" + intToStr(i+1);
|
||||||
|
@ -639,6 +647,20 @@ void Gui::selectInterestingUnit(InterestingUnitType iut) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Gui::clickCommonCommand(CommandClass commandClass) {
|
||||||
|
for(int index = 0; index < Display::downCellCount; ++index) {
|
||||||
|
const CommandType *ct = display.getCommandType(index);
|
||||||
|
|
||||||
|
if((ct != NULL && ct->getClass() == commandClass) ||
|
||||||
|
display.getCommandClass(index) == commandClass) {
|
||||||
|
|
||||||
|
mouseDownDisplayUnitSkills(index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
computeDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
||||||
if(selection.isEmpty() == false) {
|
if(selection.isEmpty() == false) {
|
||||||
if(posDisplay != cancelPos) {
|
if(posDisplay != cancelPos) {
|
||||||
|
|
|
@ -217,6 +217,7 @@ private:
|
||||||
//hotkeys
|
//hotkeys
|
||||||
void centerCameraOnSelection();
|
void centerCameraOnSelection();
|
||||||
void selectInterestingUnit(InterestingUnitType iut);
|
void selectInterestingUnit(InterestingUnitType iut);
|
||||||
|
void clickCommonCommand(CommandClass commandClass);
|
||||||
|
|
||||||
//misc
|
//misc
|
||||||
int computePosDisplay(int x, int y);
|
int computePosDisplay(int x, int y);
|
||||||
|
|
Loading…
Reference in New Issue