Browse Source

Add window movement events

master
C. J. Howard 5 years ago
parent
commit
a16b51c90b
Signed by: cjhoward GPG Key ID: 03E1FABA9C3EC195
2 changed files with 12 additions and 2 deletions
  1. +11
    -2
      src/game.cpp
  2. +1
    -0
      src/game.hpp

+ 11
- 2
src/game.cpp View File

@ -692,6 +692,15 @@ void Game::handleEvent(const WindowResizedEvent& event)
skipSplash(); skipSplash();
} }
void Game::handleEvent(const WindowMovedEvent& event)
{
if (!(*fullscreen))
{
windowPosition = {event.x, event.y};
saveSettings();
}
}
void Game::handleEvent(const GamepadConnectedEvent& event) void Game::handleEvent(const GamepadConnectedEvent& event)
{ {
// Unmap all controls // Unmap all controls
@ -2989,9 +2998,9 @@ void Game::restringUI()
settingsMenuControlsItem->setName(getString("controls")); settingsMenuControlsItem->setName(getString("controls"));
settingsMenuControlsItem->setValue(getString("ellipsis")); settingsMenuControlsItem->setValue(getString("ellipsis"));
settingsMenuFullscreenItem->setName(getString("fullscreen")); settingsMenuFullscreenItem->setName(getString("fullscreen"));
settingsMenuFullscreenItem->setValue((fullscreen) ? onString : offString);
settingsMenuFullscreenItem->setValue((*fullscreen) ? onString : offString);
settingsMenuVSyncItem->setName(getString("v-sync")); settingsMenuVSyncItem->setName(getString("v-sync"));
settingsMenuVSyncItem->setValue((vsync) ? onString : offString);
settingsMenuVSyncItem->setValue((*vsync) ? onString : offString);
settingsMenuLanguageItem->setName(getString("language")); settingsMenuLanguageItem->setName(getString("language"));
settingsMenuLanguageItem->setValue(getString("language-name")); settingsMenuLanguageItem->setValue(getString("language-name"));
settingsMenuBackItem->setName(backString); settingsMenuBackItem->setName(backString);

+ 1
- 0
src/game.hpp View File

@ -162,6 +162,7 @@ private:
virtual void render(); virtual void render();
virtual void exit(); virtual void exit();
virtual void handleEvent(const WindowResizedEvent& event); virtual void handleEvent(const WindowResizedEvent& event);
virtual void handleEvent(const WindowMovedEvent& event);
virtual void handleEvent(const GamepadConnectedEvent& event); virtual void handleEvent(const GamepadConnectedEvent& event);
virtual void handleEvent(const GamepadDisconnectedEvent& event); virtual void handleEvent(const GamepadDisconnectedEvent& event);
virtual void handleEvent(const ScheduledFunctionEvent& event); virtual void handleEvent(const ScheduledFunctionEvent& event);

Loading…
Cancel
Save