git repos / saland

commit 21711966

Poul Sander · 2023-05-02 19:38
217119667437b2b2d5f6c5d65f4a36997fb64da2 patch · browse files
parent 94312ab114d5ce76dff2836a9af6b0506c96d98d

Make it possible to open the spell menu again

Changed files

M src/saland/GameSpellState.cpp before
diff --git a/src/saland/GameSpellState.cpp b/src/saland/GameSpellState.cpp index c737710..1a31542 100644 --- a/src/saland/GameSpellState.cpp +++ b/src/saland/GameSpellState.cpp
@@ -90,16 +90,16 @@ bool GameSpellState::IsSpellSelectActive() {
}
void GameSpellState::ProcessInput(const SDL_Event& event, bool& processed) {
+ UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey);
+ if (event.type == SDL_KEYDOWN) {
+ if (event.key.keysym.sym == SDLK_ESCAPE) {
+ data->spellSelectActive = !data->spellSelectActive;
+ processed = true;
+ }
+ }
if (!data->spellSelectActive) {
return;
- }
- UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey);
- if (event.type == SDL_KEYDOWN) {
- if (event.key.keysym.sym == SDLK_ESCAPE) {
- data->spellSelectActive = !data->spellSelectActive;
- processed = true;
- }
- }
+ }
if (event.type == SDL_MOUSEBUTTONDOWN) {
if (event.button.button == SDL_BUTTON_LEFT) {
std::cout << "Left click " << globalData.mousex << "," << globalData.mousey << "\n";
@@ -120,4 +120,4 @@ void GameSpellState::ProcessInput(const SDL_Event& event, bool& processed) {
void GameSpellState::Update() {};
GameSpellState::~GameSpellState() {
-}
\ No newline at end of file
+}