hotkey support for scenario list boxes
This commit is contained in:
parent
dbb2409d76
commit
7224f134c7
|
@ -200,6 +200,7 @@ void MenuStateScenario::cleanupPreviewTexture() {
|
||||||
void MenuStateScenario::mouseClick(int x, int y, MouseButton mouseButton) {
|
void MenuStateScenario::mouseClick(int x, int y, MouseButton mouseButton) {
|
||||||
CoreData &coreData= CoreData::getInstance();
|
CoreData &coreData= CoreData::getInstance();
|
||||||
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
|
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
|
||||||
|
string advanceToItemStartingWith = "";
|
||||||
|
|
||||||
if(mainMessageBox.getEnabled()){
|
if(mainMessageBox.getEnabled()){
|
||||||
int button= 0;
|
int button= 0;
|
||||||
|
@ -214,8 +215,19 @@ void MenuStateScenario::mouseClick(int x, int y, MouseButton mouseButton) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if(buttonReturn.mouseClick(x,y)){
|
else {
|
||||||
|
if(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) {
|
||||||
|
const wchar_t lastKey = Shared::Platform::Window::extractLastKeyPressed();
|
||||||
|
// xxx:
|
||||||
|
// string hehe=lastKey;
|
||||||
|
// printf("lastKey = %d [%c] '%s'\n",lastKey,lastKey,hehe);
|
||||||
|
advanceToItemStartingWith = lastKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(buttonReturn.mouseClick(x,y)){
|
||||||
soundRenderer.playFx(coreData.getClickSoundA());
|
soundRenderer.playFx(coreData.getClickSoundA());
|
||||||
mainMenu->setState(new MenuStateNewGame(program, mainMenu));
|
mainMenu->setState(new MenuStateNewGame(program, mainMenu));
|
||||||
return;
|
return;
|
||||||
|
@ -225,7 +237,7 @@ void MenuStateScenario::mouseClick(int x, int y, MouseButton mouseButton) {
|
||||||
launchGame();
|
launchGame();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(listBoxScenario.mouseClick(x, y)){
|
else if(listBoxScenario.mouseClick(x, y,advanceToItemStartingWith)){
|
||||||
try {
|
try {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] listBoxScenario.getSelectedItemIndex() = %d scenarioFiles.size() = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxScenario.getSelectedItemIndex(),(int)scenarioFiles.size());
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] listBoxScenario.getSelectedItemIndex() = %d scenarioFiles.size() = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxScenario.getSelectedItemIndex(),(int)scenarioFiles.size());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user