diff --git a/src/OpenSHC/UI/MenuItems/General/MenuItemRenderFunction_General_EventButtonAndData.cpp b/src/OpenSHC/UI/MenuItems/General/MenuItemRenderFunction_General_EventButtonAndData.cpp new file mode 100644 index 0000000000..8f0fe73b29 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/General/MenuItemRenderFunction_General_EventButtonAndData.cpp @@ -0,0 +1,57 @@ +#include "../General.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/AlphaAndButtonSurface.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/BGR24.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/AlphaAndButtonSurfaceObj.hpp" +#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp" +#include "OpenSHC/Globals/DAT_ButtonW.hpp" +#include "OpenSHC/Globals/DAT_ButtonX.hpp" +#include "OpenSHC/Globals/DAT_ButtonY.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + + using OpenSHC::Rendering::Colors::BGR24; + + // FUNCTION: STRONGHOLDCRUSADER 0x004BFFA0 + void General::MenuItemRenderFunction_General_EventButtonAndData(int itemIndex, ...) + { + int month; + BGR24 color; + if (itemIndex != -1) { + MACRO_CALL(OpenSHC::UI::Rendering_Func::RenderScenarioButtonWithText)(itemIndex); + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, + AlphaAndButtonSurfaceObj::ptr)(0, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + int const textX = DAT_ButtonW::instance / 2 + DAT_ButtonX::instance; + int const textY = DAT_ButtonY::instance + 6; + if (!DAT_ButtonCurrentlyInteracting::instance) { + month = DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID] + .header.month; + color = OpenSHC::Rendering::Colors::COL_C2F0EB; + } else { + month = DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID] + .header.month; + color = OpenSHC::Rendering::Colors::COL_CCFAFF; + } + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_MONTHS, month + 12), + textX, textY, OpenSHC::Text::TTA_CENTER, color, 18, FALSE, 0); + } + + } // namespace MenuItems +} // namespace UI +} // namespace OpenSHC diff --git a/src/OpenSHC/UI/MenuItems/Roundtable/MenuItemRenderFunction_Roundtable_Main.cpp b/src/OpenSHC/UI/MenuItems/Roundtable/MenuItemRenderFunction_Roundtable_Main.cpp new file mode 100644 index 0000000000..ecb47338c9 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/Roundtable/MenuItemRenderFunction_Roundtable_Main.cpp @@ -0,0 +1,241 @@ +#include "../Roundtable.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eGM.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/IO/Graphics/GmID.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_00df423c.hpp" +#include "OpenSHC/Globals/DAT_00df4288.hpp" +#include "OpenSHC/Globals/DAT_BlendingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_ButtonBackgroundBlendStrength.hpp" +#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp" +#include "OpenSHC/Globals/DAT_ButtonUnknownZero.hpp" +#include "OpenSHC/Globals/DAT_ButtonX.hpp" +#include "OpenSHC/Globals/DAT_ButtonY.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_RenderingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AEF70 + void Roundtable::MenuItemRenderFunction_Roundtable_Main(int itemIndex, ...) + { + int aiType = 0; + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + if (itemIndex <= 8) { + int const playerID = DAT_GameSynchronyState::instance.DAT_RoundTableOrderArray[itemIndex]; + if (playerID <= 0) { + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + return; + } + int const group = DAT_GameSynchronyState::instance.DAT_PlayerGroupArray[playerID]; + DAT_ButtonUnknownZero::instance = 1; + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] != -1 + || DAT_GameSynchronyState::instance.currentAIArray[playerID] != 0) { + if (DAT_GameSynchronyState::instance.isHost) { + DAT_ButtonUnknownZero::instance = 0; + } + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] == -1) { + aiType = DAT_GameSynchronyState::instance.currentAIArray[playerID]; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, playerID + 546, + DAT_ButtonX::instance, DAT_ButtonY::instance); + if (aiType == 0) { + if (DAT_GameCore::instance.lordIcons[playerID] == 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 539, + DAT_ButtonX::instance, DAT_ButtonY::instance); + } else if (DAT_GameCore::instance.lordIcons[playerID] == 1) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 540, + DAT_ButtonX::instance, DAT_ButtonY::instance); + } else if (DAT_TextureRenderCoreObject::instance.bitmapFaceSizes[playerID + 19] > 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 541, + DAT_ButtonX::instance, DAT_ButtonY::instance); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawBitmapFace, + DAT_TextureRenderCoreObject::ptr)( + playerID + 19, DAT_ButtonX::instance + 4, DAT_ButtonY::instance + 4); + } + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, aiType + 522, + DAT_ButtonX::instance, DAT_ButtonY::instance); + } + if (DAT_00df423c::instance == itemIndex) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::dimBox, + DAT_PencilRenderCore::ptr)(DAT_ButtonX::instance, DAT_ButtonY::instance, + DAT_ButtonX::instance + 71, DAT_ButtonY::instance + 71); + } + if (DAT_ButtonCurrentlyInteracting::instance) { + if (DAT_00df423c::instance == 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGMWithAlphaMask, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_2, 514, + DAT_ButtonX::instance - 6, DAT_ButtonY::instance - 6, + OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_2, 513, 0); + } + if (DAT_ButtonCurrentlyInteracting::instance) { + DAT_00df4288::instance = 1; + } + } + if (group != 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, group * 2 + 493, + DAT_ButtonX::instance - 10, DAT_ButtonY::instance - 8); + } + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] != -1) { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, + DAT_TextManagerObject::ptr)(DAT_GameSynchronyState::instance.DAT_PlayerNames[playerID], + DAT_ButtonX::instance + 32, DAT_ButtonY::instance + 80, OpenSHC::Text::TTA_CENTER, + DAT_RenderingDefinedData::instance + .ColorTable1[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[playerID]], + 0, 19, FALSE, 0); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + return; + } + MACRO_CALL_MEMBER( + OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_XPLAY_WAITING_ROOM, + DAT_GameSynchronyState::instance.currentAIArray[playerID] * 9 + 231 + + DAT_GameSynchronyState::instance.aiVariationArray[playerID]), + DAT_ButtonX::instance + 32, DAT_ButtonY::instance + 80, OpenSHC::Text::TTA_CENTER, + DAT_RenderingDefinedData::instance + .ColorTable1[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[playerID]], + 0, 18, FALSE, 0); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + return; + } + } else { + if (itemIndex <= 18) { + int const playerID = DAT_GameSynchronyState::instance.DAT_RoundTableOrderArray[itemIndex - 10]; + if (playerID > 0 && DAT_00df423c::instance != 0 && DAT_ButtonCurrentlyInteracting::instance + && itemIndex - 10 != DAT_00df423c::instance + && (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] != -1 + || MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::isAIPlayer, + DAT_GameSynchronyState::ptr)(playerID))) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGMWithAlphaMask, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_2, 514, + DAT_ButtonX::instance + 62, DAT_ButtonY::instance - 1, + OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_2, 513, 0); + } + } + if (itemIndex == 20) { + if (DAT_ButtonCurrentlyInteracting::instance) { + DAT_00df4288::instance = 1; + if (DAT_00df423c::instance == 0) { + DAT_ButtonCurrentlyInteracting::instance = FALSE; + } + } + MACRO_CALL(OpenSHC::UI::Rendering_Func::RenderCurrentButtonToScreenMenuWithBlendingUnk)( + (DAT_ButtonBackgroundBlendStrength::instance - 32) * 32 / 32 + 32); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + return; + } + if (itemIndex == 100 || itemIndex == 101) { + DAT_ButtonUnknownZero::instance = DAT_00df423c::instance != 0; + if (DAT_GameSynchronyState::instance.isHost) { + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + if (DAT_ButtonCurrentlyInteracting::instance) { + DAT_00df4288::instance = 1; + } + } else { + DAT_ButtonUnknownZero::instance = 1; + } + } + if (itemIndex == 200) { + aiType = 0; + if (DAT_00df423c::instance != 0 && DAT_GameSynchronyState::instance.isHost) { + if (DAT_GameSynchronyState::instance.DAT_RoundTableOrderArray[DAT_00df423c::instance] == 0) { + DAT_00df423c::instance = 0; + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + return; + } + int const playerID + = DAT_GameSynchronyState::instance.DAT_RoundTableOrderArray[DAT_00df423c::instance]; + if (playerID >= 1) { + int x = DAT_MouseState::instance.screenSpaceX + - DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + int y = DAT_MouseState::instance.screenSpaceY + - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + if (y < 4) { + y = 4; + } else if (y > 364) { + y = 364; + } + if (x < 4) { + x = 4; + } else if (x > 724) { + x = 724; + } + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] == -1) { + aiType = DAT_GameSynchronyState::instance.currentAIArray[playerID]; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, + playerID + 546, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + x, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + y); + if (aiType == 0) { + if (DAT_GameCore::instance.lordIcons[playerID] == 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 539, + DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + x, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + y); + } else if (DAT_GameCore::instance.lordIcons[playerID] == 1) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 540, + DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + x, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + y); + } else if (DAT_TextureRenderCoreObject::instance.bitmapFaceSizes[playerID + 19] > 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 541, + DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + x, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + y); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawBitmapFace, + DAT_TextureRenderCoreObject::ptr)(playerID + 19, + DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + x + 4, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + y + 4); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + return; + } + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, + aiType + 522, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + x, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + y); + } + } + } + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + + } // namespace MenuItems +} // namespace UI +} // namespace OpenSHC diff --git a/src/OpenSHC/UI/MenuItems/SoundOptions/MenuItemActionHandler_SoundOptions_Buttons.cpp b/src/OpenSHC/UI/MenuItems/SoundOptions/MenuItemActionHandler_SoundOptions_Buttons.cpp new file mode 100644 index 0000000000..371202a4fc --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/SoundOptions/MenuItemActionHandler_SoundOptions_Buttons.cpp @@ -0,0 +1,74 @@ +#include "../SoundOptions.func.hpp" + +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" +#include "OpenSHC/UI/MenuItems/SoundOptions.func.hpp" +#include "OpenSHC/UI/MenuTextInputState.func.hpp" +#include "OpenSHC/UI/Enums/SoundMenuClickType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_SoundSystemState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + + using OpenSHC::UI::Enums::SoundMenuClickType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004940B0 + void SoundOptions::MenuItemActionHandler_SoundOptions_Buttons(SoundMenuClickType clickType, ...) + { + switch (clickType) { + case OpenSHC::UI::Enums::SMCT_TOGGLE_SOUND_ACTIVEUnk: + if (DAT_MenuTextInputState::instance.DAT_SoundActiveMenuVar != 0) { + DAT_MenuTextInputState::instance.DAT_SoundActiveMenuVar = 0; + MACRO_CALL_MEMBER(OpenSHC::Audio::MSS::SoundSystem_Func::deactivateSoundFromMenuFuncUnk, + DAT_SoundSystemState::ptr)(); + return; + } + DAT_MenuTextInputState::instance.DAT_SoundActiveMenuVar = 1; + MACRO_CALL_MEMBER( + OpenSHC::Audio::MSS::SoundSystem_Func::activateSoundFromMenuFuncUnk, DAT_SoundSystemState::ptr)(); + return; + case OpenSHC::UI::Enums::SMCT_TOGGLE_GENIE: { + OpenSHC::WindowsHelper::Enums::BOOLEnum genieVoiceActive = FALSE; + if (!DAT_MenuTextInputState::instance.DAT_GenieVoiceActiveMenuVar) { + genieVoiceActive = TRUE; + } + DAT_MenuTextInputState::instance.DAT_GenieVoiceActiveMenuVar = genieVoiceActive; + DAT_GameCore::instance.genieVoiceActive = genieVoiceActive; + return; + } + case OpenSHC::UI::Enums::SMCT_SOUND_MENU_RETURNUnk: + MACRO_CALL_MEMBER(OpenSHC::UI::MenuTextInputState_Func::popModalDialog, DAT_MenuTextInputState::ptr)(); + return; + case OpenSHC::UI::Enums::SMCT_RESET_MUSIC_VOLUME: { + int maxValue; + int minValue; + int currentValue = 90; + MACRO_CALL(OpenSHC::UI::MenuItems::SoundOptions_Func::MenuItemActionHandler_SoundOptions_VolumeSlider)( + 0, 3, &minValue, &maxValue, ¤tValue); + return; + } + case OpenSHC::UI::Enums::SMCT_RESET_SFX_VOLUME: { + int maxValue; + int minValue; + int currentValue = 80; + MACRO_CALL(OpenSHC::UI::MenuItems::SoundOptions_Func::MenuItemActionHandler_SoundOptions_VolumeSlider)( + 1, 3, &minValue, &maxValue, ¤tValue); + return; + } + case OpenSHC::UI::Enums::SMCT_RESET_SPEECH_VOLUME: { + int maxValue; + int minValue; + int currentValue = 85; + MACRO_CALL(OpenSHC::UI::MenuItems::SoundOptions_Func::MenuItemActionHandler_SoundOptions_VolumeSlider)( + 2, 3, &minValue, &maxValue, ¤tValue); + return; + } + } + } + + } // namespace MenuItems +} // namespace UI +} // namespace OpenSHC diff --git a/src/OpenSHC/UI/MenuItems/TextEditor/MenuItemRenderFunction_TextEditor_Scrollbar.cpp b/src/OpenSHC/UI/MenuItems/TextEditor/MenuItemRenderFunction_TextEditor_Scrollbar.cpp new file mode 100644 index 0000000000..31d9a9cd0b --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/TextEditor/MenuItemRenderFunction_TextEditor_Scrollbar.cpp @@ -0,0 +1,44 @@ +#include "../TextEditor.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_ButtonH.hpp" +#include "OpenSHC/Globals/DAT_ButtonX.hpp" +#include "OpenSHC/Globals/DAT_ButtonY.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + + // FUNCTION: STRONGHOLDCRUSADER 0x0045EF90 + void TextEditor::MenuItemRenderFunction_TextEditor_Scrollbar( + int param_1, int thumbYPos, int param_3, int thumbHeight, BOOLEnum isDragged) + { + int const height = DAT_ButtonH::instance; + int const y = DAT_ButtonY::instance; + int const x = DAT_ButtonX::instance; + int const top = y - 22; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawScrollbar, DAT_PencilRenderCore::ptr)( + x, y, height, thumbYPos, isDragged, thumbHeight, 0); + int const right = x + 20; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x, y - 1, right - 1, y - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x, top, right - 1, top, COL_VERY_SOFT_YELLOW::instance.shortValue); + int bottom = y + height; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x, bottom, right - 1, bottom, COL_VERY_SOFT_YELLOW::instance.shortValue); + bottom += 21; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x, bottom, right - 1, bottom, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x - 1, top, x - 1, bottom, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + right, top, right, bottom, COL_VERY_SOFT_YELLOW::instance.shortValue); + } + + } // namespace MenuItems +} // namespace UI +} // namespace OpenSHC diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index caffa45278..4abb4368a1 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -18707,7 +18707,7 @@ SHC_3BB0A8C1_0x0045EF80 | 0.0% | Pending SHC_3BB0A8C1_0x0045EF84 | 0.0% | Pending -SHC_3BB0A8C1_0x0045EF90 | 0.0% | Pending +SHC_3BB0A8C1_0x0045EF90 | 82.4% | Register allocation differs SHC_3BB0A8C1_0x0045F080 | 100.0% | Reimplemented @@ -23935,7 +23935,7 @@ SHC_3BB0A8C1_0x004940A9 | 0.0% | Pending SHC_3BB0A8C1_0x004940AA | 0.0% | Pending -SHC_3BB0A8C1_0x004940B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004940B0 | 86.6% | Register allocation differs SHC_3BB0A8C1_0x004941A0 | 0.0% | Pending @@ -25897,7 +25897,7 @@ SHC_3BB0A8C1_0x004AEF5C | 0.0% | Pending SHC_3BB0A8C1_0x004AEF60 | 0.0% | Pending -SHC_3BB0A8C1_0x004AEF70 | 0.0% | Pending +SHC_3BB0A8C1_0x004AEF70 | 97.2% | Register allocation differs SHC_3BB0A8C1_0x004AF4C0 | 100.0% | Reimplemented @@ -32107,7 +32107,7 @@ SHC_3BB0A8C1_0x004BFE13 | 0.0% | Pending SHC_3BB0A8C1_0x004BFE20 | 0.0% | Pending -SHC_3BB0A8C1_0x004BFFA0 | 0.0% | Pending +SHC_3BB0A8C1_0x004BFFA0 | 87.6% | Register allocation differs SHC_3BB0A8C1_0x004C0040 | 100.0% | Reimplemented, only the atol call target differs