mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Renamed CGuiHandler to GameEngine
- class CGuiHandler is now called GameEngine to better describe its functionality - renamed global GH to more clear ENGINE - GH/ENGINE is now unique_ptr to make construction / deconstruction order more clear and to allow interface / implementation split - CGuiHandler.cpp/h is now called GameEngine.cpp/h and located in root directory of client dir
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "EventsReceiver.h"
|
||||
#include "FramerateManager.h"
|
||||
#include "CGuiHandler.h"
|
||||
#include "GameEngine.h"
|
||||
#include "MouseButton.h"
|
||||
#include "WindowHandler.h"
|
||||
#include "gui/Shortcut.h"
|
||||
@@ -80,10 +80,10 @@ void EventDispatcher::dispatchShortcutPressed(const std::vector<EShortcut> & sho
|
||||
bool keysCaptured = false;
|
||||
|
||||
if (vstd::contains(shortcutsVector, EShortcut::MOUSE_LEFT))
|
||||
dispatchMouseLeftButtonPressed(GH.getCursorPosition(), settings["input"]["shortcutToleranceDistance"].Integer());
|
||||
dispatchMouseLeftButtonPressed(ENGINE->getCursorPosition(), settings["input"]["shortcutToleranceDistance"].Integer());
|
||||
|
||||
if (vstd::contains(shortcutsVector, EShortcut::MOUSE_RIGHT))
|
||||
dispatchShowPopup(GH.getCursorPosition(), settings["input"]["shortcutToleranceDistance"].Integer());
|
||||
dispatchShowPopup(ENGINE->getCursorPosition(), settings["input"]["shortcutToleranceDistance"].Integer());
|
||||
|
||||
for(auto & i : keyinterested)
|
||||
for(EShortcut shortcut : shortcutsVector)
|
||||
@@ -109,10 +109,10 @@ void EventDispatcher::dispatchShortcutReleased(const std::vector<EShortcut> & sh
|
||||
bool keysCaptured = false;
|
||||
|
||||
if (vstd::contains(shortcutsVector, EShortcut::MOUSE_LEFT))
|
||||
dispatchMouseLeftButtonReleased(GH.getCursorPosition(), settings["input"]["shortcutToleranceDistance"].Integer());
|
||||
dispatchMouseLeftButtonReleased(ENGINE->getCursorPosition(), settings["input"]["shortcutToleranceDistance"].Integer());
|
||||
|
||||
if (vstd::contains(shortcutsVector, EShortcut::MOUSE_RIGHT))
|
||||
dispatchClosePopup(GH.getCursorPosition());
|
||||
dispatchClosePopup(ENGINE->getCursorPosition());
|
||||
|
||||
for(auto & i : keyinterested)
|
||||
for(EShortcut shortcut : shortcutsVector)
|
||||
@@ -201,7 +201,7 @@ void EventDispatcher::dispatchShowPopup(const Point & position, int tolerance)
|
||||
|
||||
void EventDispatcher::dispatchClosePopup(const Point & position)
|
||||
{
|
||||
bool popupOpen = GH.windows().isTopWindowPopup(); // popup can already be closed for mouse dragging with RMB
|
||||
bool popupOpen = ENGINE->windows().isTopWindowPopup(); // popup can already be closed for mouse dragging with RMB
|
||||
|
||||
auto hlp = rclickable;
|
||||
|
||||
@@ -214,7 +214,7 @@ void EventDispatcher::dispatchClosePopup(const Point & position)
|
||||
}
|
||||
|
||||
if(popupOpen)
|
||||
GH.windows().popWindows(1);
|
||||
ENGINE->windows().popWindows(1);
|
||||
}
|
||||
|
||||
void EventDispatcher::handleLeftButtonClick(const Point & position, int tolerance, bool isPressed)
|
||||
|
||||
Reference in New Issue
Block a user