1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +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

@@ -116,6 +116,8 @@ private:
void fnextHero();
void fendTurn();
void hotkeyMoveHeroDirectional(Point direction);
bool isActive();
void adjustActiveness(bool aiTurnStart); //should be called every time at AI/human turn transition; blocks GUI during AI turn
@@ -130,7 +132,7 @@ private:
const CGObjectInstance *getActiveObject(const int3 &tile);
std::optional<Point> keyToMoveDirection(const SDL_Keycode & key);
std::optional<Point> keyToMoveDirection(EShortcut key);
void endingTurn();
@@ -149,7 +151,7 @@ protected:
void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to) override;
void keyPressed(const SDL_Keycode & key) override;
void keyPressed(EShortcut key) override;
public:
CAdventureMapInterface();