From 9b3e7b7e2b4094f611cc05dba32de52bea45b4ef Mon Sep 17 00:00:00 2001 From: GabsPuNs Date: Sat, 20 Jun 2026 16:38:20 -0400 Subject: [PATCH] Oops. i dont know how to use Web editor xd. --- .../Common/UI/UIScene_LoadCreateJoinMenu.cpp | 26 +----- .../Common/UI/UIScene_MessageBox.cpp | 58 ------------- .../Common/UI/UIScene_PauseMenu.cpp | 85 ------------------- 3 files changed, 1 insertion(+), 168 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp index 92630746..d01a344d 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp @@ -878,31 +878,7 @@ void UIScene_LoadCreateJoinMenu::UpdateGamesListCallback(LPVOID pParam) void UIScene_LoadCreateJoinMenu::tick() { - UIScene::tick(); - - m_hasTickedOnce = true; - - // Forward mouse/input to RmlUi context - Rml::Context* rmlCtx = RmlManager::Get().GetContext(); - if (rmlCtx && bHasFocus) - { - rmlCtx->ProcessMouseMove(g_KBMInput.GetMouseX(), g_KBMInput.GetMouseY(), 0); - - if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_LEFT)) - rmlCtx->ProcessMouseButtonDown(0, 0); - if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_LEFT)) - rmlCtx->ProcessMouseButtonUp(0, 0); - if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_RIGHT)) - rmlCtx->ProcessMouseButtonDown(1, 0); - if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_RIGHT)) - rmlCtx->ProcessMouseButtonUp(1, 0); - - int wheelDelta = g_KBMInput.GetMouseWheel(); - if (wheelDelta != 0) - rmlCtx->ProcessMouseWheel(wheelDelta / -120, 0); - - rmlCtx->Update(); - } + UIScene_RmlBase::tick(); if (m_bExitScene) if (!m_bRetrievingSaveThumbnails) diff --git a/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp b/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp index 5b11b0df..4fb727e5 100644 --- a/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp @@ -115,64 +115,6 @@ UIScene_MessageBox::~UIScene_MessageBox() m_parentLayer->removeComponent(eUIComponent_MenuBackground); } -void UIScene_MessageBox::gainFocus() -{ - if (!bHasFocus && stealsFocus()) - { - bHasFocus = true; - updateTooltips(); - updateComponents(); - handleGainFocus(m_bFocussedOnce); - if (bHasFocus) - m_bFocussedOnce = true; - - if (m_document) - m_document->Show(); - } -} - -void UIScene_MessageBox::handleLoseFocus() -{ - if (m_document) - m_document->Hide(); -} - -void UIScene_MessageBox::reloadMovie(bool force) -{ -} - -void UIScene_MessageBox::tick() -{ - m_hasTickedOnce = true; - - UIScene::tick(); - - Rml::Context* ctx = RmlManager::Get().GetContext(); - if (!ctx || !bHasFocus) - return; - - ctx->ProcessMouseMove(g_KBMInput.GetMouseX(), g_KBMInput.GetMouseY(), 0); - - if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_LEFT)) - ctx->ProcessMouseButtonDown(0, 0); - if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_LEFT)) - ctx->ProcessMouseButtonUp(0, 0); - if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_RIGHT)) - ctx->ProcessMouseButtonDown(1, 0); - if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_RIGHT)) - ctx->ProcessMouseButtonUp(1, 0); - - int wheelDelta = g_KBMInput.GetMouseWheel(); - if (wheelDelta != 0) - ctx->ProcessMouseWheel(wheelDelta / -120, 0); - - ctx->Update(); -} - -void UIScene_MessageBox::render(S32 width, S32 height, C4JRender::eViewportType viewport) -{ -} - void UIScene_MessageBox::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { Rml::Context* ctx = RmlManager::Get().GetContext(); diff --git a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp index 9f9ff6f0..c9cd913c 100644 --- a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp @@ -69,91 +69,6 @@ UIScene_PauseMenu::~UIScene_PauseMenu() m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, false); } -void UIScene_PauseMenu::gainFocus() -{ - if (!bHasFocus && stealsFocus()) - { - bHasFocus = true; - updateTooltips(); - updateComponents(); - - if (!m_bFocussedOnce) - // No Iggy set-focus call needed for RmlUi scene - - handleGainFocus(m_bFocussedOnce); - - if (bHasFocus) - m_bFocussedOnce = true; - - if (m_document) - m_document->Show(); - } -} - -void UIScene_PauseMenu::handleLoseFocus() -{ - if (m_document) - m_document->Hide(); -} - -void UIScene_PauseMenu::reloadMovie(bool force) -{ -} - -//GabsPuN: When Iggy is completely replaced, some functions should be moved to UIScene.cpp. -//This way, the tick() function won't be repeated in every UIScene_ cpp file. -//Also, since iggy no longer exists, we can take liberties with optimization or code -//that is easier to work with. -void UIScene_PauseMenu::tick() -{ - // Signal the base class that we've ticked once, so it sets m_bCanHandleInput - // (the Iggy while-loop that normally sets this never runs without a loaded SWF) - m_hasTickedOnce = true; - - UIScene::tick(); - - Rml::Context* ctx = RmlManager::Get().GetContext(); - if (!ctx || !bHasFocus) - return; - -//GabsPuN: Once the above comment is made, we can do something like this to increase performance. -/* - int currentX = g_KBMInput.GetMouseX(); - int currentY = g_KBMInput.GetMouseY(); - - if (currentX != m_lastMouseX || currentY != m_lastMouseY) - { - ctx->ProcessMouseMove(currentX, currentY, 0); - m_lastMouseX = currentX; - m_lastMouseY = currentY; - } -*/ - - // Forward mouse position (for hover effects and correct click targeting) - ctx->ProcessMouseMove(g_KBMInput.GetMouseX(), g_KBMInput.GetMouseY(), 0); - - // Forward mouse button presses/releases - if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_LEFT)) - ctx->ProcessMouseButtonDown(0, 0); - if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_LEFT)) - ctx->ProcessMouseButtonUp(0, 0); - if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_RIGHT)) - ctx->ProcessMouseButtonDown(1, 0); - if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_RIGHT)) - ctx->ProcessMouseButtonUp(1, 0); - - // Forward scroll wheel - int wheelDelta = g_KBMInput.GetMouseWheel(); - if (wheelDelta != 0) - ctx->ProcessMouseWheel(wheelDelta / -120, 0); - - ctx->Update(); -} - -void UIScene_PauseMenu::render(S32 width, S32 height, C4JRender::eViewportType viewport) -{ -} - void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { if (m_bIgnoreInput)