1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Implementation of (very basic) shortcuts system

- Added EShortcut enumeration that contains all in-game shortcuts
- CIntObject::keyPressed now receive values from hotkey enumeration
- On keypress, SDL key code will be translated to shortcut ID
- Removed access to SDL key codes from most of engine
This commit is contained in:
Ivan Savenko
2023-04-27 20:21:06 +03:00
parent ac09f78c67
commit 832e56e005
57 changed files with 920 additions and 553 deletions

View File

@@ -16,6 +16,7 @@
#include "../adventureMap/CResDataBar.h"
#include "../gui/CGuiHandler.h"
#include "../gui/TextAlignment.h"
#include "../gui/Shortcut.h"
#include "../mapView/MapView.h"
#include "../widgets/Buttons.h"
#include "../widgets/Images.h"
@@ -35,8 +36,7 @@ CPuzzleWindow::CPuzzleWindow(const int3 & GrailPos, double discoveredRatio)
CCS->soundh->playSound(soundBase::OBELISK);
quitb = std::make_shared<CButton>(Point(670, 538), "IOK6432.DEF", CButton::tooltip(CGI->generaltexth->allTexts[599]), std::bind(&CPuzzleWindow::close, this), SDLK_RETURN);
quitb->assignedKeys.insert(SDLK_ESCAPE);
quitb = std::make_shared<CButton>(Point(670, 538), "IOK6432.DEF", CButton::tooltip(CGI->generaltexth->allTexts[599]), std::bind(&CPuzzleWindow::close, this), EShortcut::GLOBAL_RETURN);
quitb->setBorderColor(Colors::METALLIC_GOLD);
mapView = std::make_shared<PuzzleMapView>(Point(8,9), Point(591, 544), grailPos);