From 9e2db1bd11671f69533b1a7107aa21d668c49f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timmy=20Sj=C3=B6stedt?= Date: Mon, 23 May 2016 18:44:38 +0200 Subject: [PATCH] Enable mouse cursor in menus, fixes #46 --- rwgame/RWGame.cpp | 1 - rwgame/ingamestate.cpp | 2 ++ rwgame/menustate.cpp | 2 +- rwgame/pausestate.cpp | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rwgame/RWGame.cpp b/rwgame/RWGame.cpp index 3732fff4..1835f1e8 100644 --- a/rwgame/RWGame.cpp +++ b/rwgame/RWGame.cpp @@ -96,7 +96,6 @@ RWGame::RWGame(int argc, char* argv[]) cs.depthBits = 32; cs.stencilBits = 8; window.create(sf::VideoMode(w, h), "", style, cs); - window.setMouseCursorVisible(false); log.addReciever(&logPrinter); log.info("Game", "Game directory: " + config.getGameDataPath()); diff --git a/rwgame/ingamestate.cpp b/rwgame/ingamestate.cpp index e0312e94..a308f52d 100644 --- a/rwgame/ingamestate.cpp +++ b/rwgame/ingamestate.cpp @@ -107,6 +107,8 @@ void IngameState::enter() } started = true; } + + game->getWindow().setMouseCursorVisible(false); } void IngameState::exit() diff --git a/rwgame/menustate.cpp b/rwgame/menustate.cpp index 03ff1a70..252be03f 100644 --- a/rwgame/menustate.cpp +++ b/rwgame/menustate.cpp @@ -53,7 +53,7 @@ void MenuState::enterLoadMenu() void MenuState::enter() { - + game->getWindow().setMouseCursorVisible(true); } void MenuState::exit() diff --git a/rwgame/pausestate.cpp b/rwgame/pausestate.cpp index 494d82be..420639e5 100644 --- a/rwgame/pausestate.cpp +++ b/rwgame/pausestate.cpp @@ -17,6 +17,8 @@ PauseState::PauseState(RWGame* game) void PauseState::enter() { getWorld()->setPaused(true); + + game->getWindow().setMouseCursorVisible(true); } void PauseState::exit()