1
0
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:
Ivan Savenko
2025-02-10 21:49:23 +00:00
parent 0c5a560c80
commit cacceda950
144 changed files with 1019 additions and 1021 deletions

View File

@@ -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)