forked from rosebudai/OpenRCT2-Web
Rework EditorBottomToolbar into EditorStepController (#26961)
* Rename EditorBottomToolbar to EditorStepController * Split off EditorStatusLine to its own window * Simplify step/jump functions by making them static * Split EditorStepController into two instances * Resize new editor panels when game window is resized * Move kEditorStepNames defs into EditorController to share between windows
This commit is contained in:
1 parent
550fe4be85
commit
21e37e12f9
15 files changed
+546
-484
No files matched your search
@@ -12,6 +12,7 @@
|
||||
#include "../Context.h"
|
||||
#include "../Game.h"
|
||||
#include "../Input.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../audio/Audio.h"
|
||||
#include "../config/Config.h"
|
||||
#include "../drawing/Drawing.String.h"
|
||||
@@ -826,6 +827,32 @@ static constexpr float kWindowScrollLocations[][2] = {
|
||||
}
|
||||
}
|
||||
|
||||
static void WindowResizeEditorController(const int32_t width, const int32_t height)
|
||||
{
|
||||
auto* windowMgr = Ui::GetWindowManager();
|
||||
|
||||
auto* prevStep = windowMgr->FindByNumber(WindowClass::editorStepController, 0);
|
||||
if (prevStep != nullptr)
|
||||
{
|
||||
prevStep->windowPos.x = 0;
|
||||
prevStep->windowPos.y = height - prevStep->height;
|
||||
}
|
||||
|
||||
auto* statusLine = windowMgr->FindByClass(WindowClass::editorStatusLine);
|
||||
if (statusLine != nullptr)
|
||||
{
|
||||
statusLine->windowPos.x = (width - statusLine->width) / 2;
|
||||
statusLine->windowPos.y = height - statusLine->height;
|
||||
}
|
||||
|
||||
auto* nextStep = windowMgr->FindByNumber(WindowClass::editorStepController, 1);
|
||||
if (nextStep != nullptr)
|
||||
{
|
||||
nextStep->windowPos.x = width - nextStep->width;
|
||||
nextStep->windowPos.y = height - nextStep->height;
|
||||
}
|
||||
}
|
||||
|
||||
void WindowResizeGui(const int32_t width, const int32_t height)
|
||||
{
|
||||
WindowResizeGuiMainToolbars(width, height);
|
||||
@@ -836,6 +863,11 @@ static constexpr float kWindowScrollLocations[][2] = {
|
||||
return WindowResizeGuiTitleScreen(width, height);
|
||||
}
|
||||
|
||||
if (isInEditorMode() || isInTrackDesignerOrManager())
|
||||
{
|
||||
WindowResizeEditorController(width, height);
|
||||
}
|
||||
|
||||
WindowResizeGuiCentredWindows(width, height);
|
||||
|
||||
GfxInvalidateScreen();
|
||||
|
||||
Reference in new issue
Block a user