diff --git a/src/OpenSHC/UI/DisplayElements/RenderAndPlayKeepAndGranaryPlacementInfoDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderAndPlayKeepAndGranaryPlacementInfoDisplayElement.cpp new file mode 100644 index 0000000000..a8dd14680a --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderAndPlayKeepAndGranaryPlacementInfoDisplayElement.cpp @@ -0,0 +1,62 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Text/FontSizeClass.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/BOOL_RelatedToInitialGranaryAndKeepPlacement.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_SFXState.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B1C30 + void RenderAndPlayKeepAndGranaryPlacementInfoDisplayElement(int posX, int posY, DWORD whichBuildingIsMissing) + { + if (!MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::getAreWeInAInGameMenu, DAT_GameCore::ptr)() + || (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_CRUSADER_TUTORIAL)) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_KEEP_AND_GRANERY_PLACEMENT_INFO, 0); + return; + } + // "Place a keep to site your castle" (10) or "Site your granary" (11) + int numInGroup = whichBuildingIsMissing + 9; + char* text = MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_FEEDBACK, numInGroup); + int const textHeight = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk, + &DAT_TextManagerObject::instance.fontSizeClassArray[18])(text, 0, 0, 580, 0, 0, 1); + text = MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_FEEDBACK, numInGroup); + int const textWidth = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk, + &DAT_TextManagerObject::instance.fontSizeClassArray[18])(text, 0, 0, 580, 0, 0, 2); + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText6Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_FEEDBACK, numInGroup), + posX - textWidth, posY - textHeight, 580, OpenSHC::Rendering::Colors::COL_CCFAFF, 0, 18, 0); + if (whichBuildingIsMissing == 1 && !BOOL_RelatedToInitialGranaryAndKeepPlacement::instance) { + // "other_warning1.wav" + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playWAVSFX, DAT_SFXState::ptr)( + s_other_warning1_wav_005a77c0); + BOOL_RelatedToInitialGranaryAndKeepPlacement::instance = TRUE; + } + + if (whichBuildingIsMissing == 2 && !BOOL_RelatedToInitialGranaryAndKeepPlacement::instance) { + // "other_warning2.wav" + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playWAVSFX, DAT_SFXState::ptr)( + s_other_warning2_wav_005a77ac); + BOOL_RelatedToInitialGranaryAndKeepPlacement::instance = TRUE; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderBottomLeftDateDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderBottomLeftDateDisplayElement.cpp new file mode 100644 index 0000000000..6d5eea171c --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderBottomLeftDateDisplayElement.cpp @@ -0,0 +1,51 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00433D00 + void RenderBottomLeftDateDisplayElement(int posX, int posY, DWORD elementState) + { + if (DAT_GameCore::instance.isTimeHalted + || DAT_GameCore::instance.currentMenuViewType == OpenSHC::UI::Enums::MVT_MAP_EDITOR_LANDSCAPING) { + return; + } + BOOLEnum const placementInfoShown + = MACRO_CALL(OpenSHC::UI::DisplayElements_Func::GetIfDisplayElementStateNotZero)( + OpenSHC::UI::Enums::DEID_KEEP_AND_GRANERY_PLACEMENT_INFO); + if (placementInfoShown + || (DAT_GameCore::instance.currentMenuViewType == OpenSHC::UI::Enums::MVT_BUILDING_AND_STATUS_MENU + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST))) { + return; + } + 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, DAT_GameState::instance.mapAndTime.month), + posX, posY, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_000000, 18, FALSE, 0); + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumberToScreen2, DAT_TextManagerObject::ptr)( + DAT_GameState::instance.mapAndTime.year, posX + 4, posY, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_000000, 18, TRUE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderConnectAndPathLinkageInfoTextDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderConnectAndPathLinkageInfoTextDisplayElement.cpp new file mode 100644 index 0000000000..2612d360da --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderConnectAndPathLinkageInfoTextDisplayElement.cpp @@ -0,0 +1,32 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x00433BC0 + void RenderConnectAndPathLinkageInfoTextDisplayElement(int posX, int posY, DWORD tileType) + { + if (tileType == 1) { + // "Connect" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, + DAT_TextManagerObject::ptr)(s_Connect_005a25e8, posX, posY, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_0080FF, 0, 17, FALSE, 0); + } else if (tileType == 2) { + // "Path linkage" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, + DAT_TextManagerObject::ptr)(s_Path_linkage_005a25d8, posX, posY, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_0080FF, 0, 17, FALSE, 0); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderDisplayElementsUnk.cpp b/src/OpenSHC/UI/DisplayElements/RenderDisplayElementsUnk.cpp new file mode 100644 index 0000000000..aeb9630fcd --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderDisplayElementsUnk.cpp @@ -0,0 +1,76 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/DisplayElementPositionModifier.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_PointerToDisplayElementStackTop.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF700 + void RenderDisplayElementsUnk() + { + DWORD const now = timeGetTime(); + for (DisplayElement* displayElement = DAT_PointerToDisplayElementStackTop::instance; displayElement != NULL; + displayElement = displayElement->nextDisplayElement_0x20) { + if (displayElement->elementStateUnk_0xc == 0) { + continue; + } + int xPos = displayElement->x_0x0 + DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetX; + int yPos = displayElement->y_0x4 + DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetY; + DisplayElementPositionModifierInt const yModifier = displayElement->positionModifier_0x1c + & (OpenSHC::UI::Enums::DEPM_TOWARDS_MID_Y | OpenSHC::UI::Enums::DEPM_RESOLUTION_Y); + switch (yModifier) { + case OpenSHC::UI::Enums::DEPM_RESOLUTION_Y: + break; + case OpenSHC::UI::Enums::DEPM_TOWARDS_MID_Y: + yPos = yPos - 600 + DAT_WindowAndDirectDraw::instance.resolutionY; + if (((DAT_GameCore::instance.currentMenuViewType == OpenSHC::UI::Enums::MVT_BUILD_MENU) + || (DAT_GameCore::instance.currentMenuViewType + == OpenSHC::UI::Enums::MVT_MAP_EDITOR_LANDSCAPING)) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SIEGETOWER + || (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD))) { + yPos += 128; + } + if (DAT_GameCore::instance.currentMenuViewType + == OpenSHC::UI::Enums::MVT_BUILDING_AND_STATUS_MENU) { + yPos -= 20; + } + break; + default: + yPos += DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + } + DisplayElementPositionModifierInt const xModifier = displayElement->positionModifier_0x1c + & (OpenSHC::UI::Enums::DEPM_TOWARDS_MID_X | OpenSHC::UI::Enums::DEPM_RESOLUTION_X); + switch (xModifier) { + case OpenSHC::UI::Enums::DEPM_RESOLUTION_X: + break; + case OpenSHC::UI::Enums::DEPM_TOWARDS_MID_X: + xPos = xPos - 800 + DAT_WindowAndDirectDraw::instance.resolutionX; + break; + default: + xPos += DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + } + DAT_TextManagerObject::instance.textSurfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + displayElement->renderFunction_0x18(xPos, yPos, displayElement->elementStateUnk_0xc); + DAT_TextManagerObject::instance.textSurfaceTarget = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + if (displayElement->displayDuration_0x14 >= 0 + && (int)(now - displayElement->activationTime_0x10) > displayElement->displayDuration_0x14) { + displayElement->elementStateUnk_0xc = 0; + } + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderGamePausedTextDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderGamePausedTextDisplayElement.cpp new file mode 100644 index 0000000000..7ddd6f93b1 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderGamePausedTextDisplayElement.cpp @@ -0,0 +1,33 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B1E60 + void RenderGamePausedTextDisplayElement(int posX, int posY, DWORD elementState) + { + if (DAT_GameCore::instance.gamePausedLogical == 0) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_GAME_PAUSED_TEXT, 0); + return; + } + // "Game Paused" + 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_FEEDBACK, 22), + posX, posY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 16, FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderGameSpeedTextDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderGameSpeedTextDisplayElement.cpp new file mode 100644 index 0000000000..8e54f9942f --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderGameSpeedTextDisplayElement.cpp @@ -0,0 +1,30 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B07C0 + void RenderGameSpeedTextDisplayElement(int posX, int posY, DWORD elementState) + { + // "Game Speed" + 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_FEEDBACK, 23), + posX - 3, posY, OpenSHC::Text::TTA_RIGHT, OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 17, FALSE, 0); + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + DAT_GameCore::instance.gameSpeedLevel, posX, posY, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 17, FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderMissionWinDefeatBannerDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderMissionWinDefeatBannerDisplayElement.cpp new file mode 100644 index 0000000000..1b5bd87ee0 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderMissionWinDefeatBannerDisplayElement.cpp @@ -0,0 +1,41 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AFDA0 + void RenderMissionWinDefeatBannerDisplayElement(int posX, int posY, DWORD winDefeatState) + { + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)(posX - 240, posY - 19, 480, 72); + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + if (winDefeatState == 1) { + // "Victory" + 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_MAINOPTIONS, 16), + posX, posY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 15, FALSE, 0); + } else { + // "Defeat" + 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_MAINOPTIONS, 17), + posX, posY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 15, FALSE, 0); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderPeopleLeftToPlaceDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderPeopleLeftToPlaceDisplayElement.cpp new file mode 100644 index 0000000000..7ab99055ac --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderPeopleLeftToPlaceDisplayElement.cpp @@ -0,0 +1,31 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B0AC0 + void RenderPeopleLeftToPlaceDisplayElement(int posX, int posY, DWORD elementState) + { + // "People Available to Place:" + 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_MAPEDIT, 44), + posX, posY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 17, FALSE, 0); + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + 2499 - DAT_UnitsState::instance.unitCount, + DAT_TextManagerObject::instance.currentXOffset_0x0 / 2 + 6 + posX, posY, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 17, FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderPlayerPingUnkDisplayElement22.cpp b/src/OpenSHC/UI/DisplayElements/RenderPlayerPingUnkDisplayElement22.cpp new file mode 100644 index 0000000000..94d8656f55 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderPlayerPingUnkDisplayElement22.cpp @@ -0,0 +1,69 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_BlendingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_RenderingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B1D30 + void RenderPlayerPingUnkDisplayElement22(int posX, int posY, DWORD elementState) + { + if ((DAT_GameSynchronyState::instance.currentGameMode == OpenSHC::Game::GM_SOLITARY) + || (DAT_GameSynchronyState::instance.currentGameMode == OpenSHC::Game::GM_SKIRMISH_SINGLE_PLAYER)) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_PLAYER_PING_Unk_19, 0); + return; + } + // the original calls timeGetTime here and drops the result + timeGetTime(); + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)(posX, posY, 120, 192); + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + int playerID = 1; + // an int* over the lag entries, set before yPosition and compared as int (jl), as the original does + int* average = &DAT_GameSynchronyState::instance.connectionLagInfoArray[1].average2; + int yPosition = posY + 18; + for (; (int)average < (int)&DAT_GameSynchronyState::instance.connectionLagInfoArray[9].average2; + average += 9) { + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] != -1) { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + playerID, posX + 24, yPosition, OpenSHC::Text::TTA_LEFT, + DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[playerID]], + 0, 18, FALSE, 0); + if (playerID != DAT_GameSynchronyState::instance.currentPlayerSlotID) { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + *average * 2, posX + 76, yPosition, OpenSHC::Text::TTA_RIGHT, + DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[playerID]], + 0, 18, FALSE, 0); + // "ms" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, + DAT_TextManagerObject::ptr)(s_ms_005a77d4, posX + 76, yPosition, OpenSHC::Text::TTA_LEFT, + DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[playerID]], + 0, 18, FALSE, 0); + } + } + ++playerID; + yPosition += 20; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderSomeMultiplayerInfoUnkDisplayElement19.cpp b/src/OpenSHC/UI/DisplayElements/RenderSomeMultiplayerInfoUnkDisplayElement19.cpp new file mode 100644 index 0000000000..8d21aa2e13 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderSomeMultiplayerInfoUnkDisplayElement19.cpp @@ -0,0 +1,231 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Input/MouseState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/AlphaAndButtonSurface.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/AlphaAndButtonSurfaceObj.hpp" +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/COL_WHITE.hpp" +#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp" +#include "OpenSHC/Globals/DAT_ButtonH.hpp" +#include "OpenSHC/Globals/DAT_ButtonW.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_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AFE10 + void RenderSomeMultiplayerInfoUnkDisplayElement19(int posX, int posY, DWORD elementState) + { + if (DAT_GameCore::instance.mapU4Int0 != 0) { + posY += 65; + } + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)( + posX - 204, posY, 408, (DAT_GameSynchronyState::instance.connectionInfoExpanded * 3 + 12) * 16); + int const titleY = posY + 15; + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + // "Connection lost" + 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_MULTIPLAYER_CONNECTION, 49), + posX, titleY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 17, FALSE, 0); + if (DAT_GameSynchronyState::instance.isHost) { + // "Sending game state" + 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_MULTIPLAYER_CONNECTION, 50), + posX, posY + 45, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE, 0); + } else { + // "Receiving game state" + 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_MULTIPLAYER_CONNECTION, 51), + posX, posY + 45, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE, 0); + } + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderBox, DAT_PencilRenderCore::ptr)( + posX - 171, posY + 74, posX + 171, posY + 91, COL_WHITE::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::dimBox, DAT_PencilRenderCore::ptr)( + posX - 170, posY + 75, posX + 170, posY + 90); + if ((DAT_GameSynchronyState::instance.currentPacketTotalSize != 0) + && (DAT_GameSynchronyState::instance.resyncTransferTotalSize != 0)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(posX - 170, posY + 75, + ((int)(DAT_GameSynchronyState::instance.currentPacketTotalSize) * 340) + / (int)(DAT_GameSynchronyState::instance.resyncTransferTotalSize) + - 170 + posX, + posY + 90, COL_VERY_SOFT_YELLOW::instance.shortValue); + } + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + if (DAT_GameSynchronyState::instance.skirmishAutoSaveEveryMinutes != 0) { + if (DAT_GameSynchronyState::instance.lastAutoSaveTime == 0 + || DAT_GameSynchronyState::instance.field_0xbe8 == 0 + || DAT_GameSynchronyState::instance.field_0xbe8 + <= DAT_GameSynchronyState::instance.lastAutoSaveTime) { + // "Auto save is on" + 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_MULTIPLAYER_CONNECTION, 54), + posX, posY + 110, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE, + 0); + } else { + int const autoSaveY = posY + 110; + // "Auto save is on" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderText2, DAT_TextManagerObject::ptr)( + OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 54, posX - 3, autoSaveY, + OpenSHC::Text::TTA_RIGHT, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE); + // "Last saved:" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderText2, DAT_TextManagerObject::ptr)( + OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 55, posX + 3, autoSaveY, + OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE); + uint minutes = (DAT_GameSynchronyState::instance.field_0xbe8 + - DAT_GameSynchronyState::instance.lastAutoSaveTime) + / 60000; + if (minutes < 1) { + minutes = 1; + } + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumberToScreen2, + DAT_TextManagerObject::ptr)(minutes, posX + 9, autoSaveY, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_C2F0EB, 18, TRUE, 0); + // "minutes." + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderText2, DAT_TextManagerObject::ptr)( + OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 56, posX + 10, autoSaveY, + OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, TRUE); + } + } else { + // "Auto save is off" + 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_MULTIPLAYER_CONNECTION, 53), + posX, posY + 110, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE, 0); + } + // the cancel button's left edge, which is also where the Yes text is centred + int const leftX = posX - 100; + DAT_ButtonX::instance = leftX; + DAT_ButtonY::instance = posY + 150; + DAT_ButtonW::instance = 200; + DAT_ButtonH::instance = 28; + // "Cancel game" + if (DAT_GameSynchronyState::instance.isHost) { + if (!DAT_GameSynchronyState::instance.connectionInfoExpanded) { + if (MACRO_CALL_MEMBER(OpenSHC::Input::MouseState_Func::isMouseInsideBox, DAT_MouseState::ptr)( + (posX - DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetX) - 100, + (posY - DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetY) + 150, 200, + 28)) { + DAT_ButtonCurrentlyInteracting::instance = TRUE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, + AlphaAndButtonSurfaceObj::ptr)(0, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + 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_MULTIPLAYER_CONNECTION, 52), + posX, posY + 156, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, + FALSE, 0); + if (DAT_MouseState::instance.leftClickStart) { + DAT_GameSynchronyState::instance.connectionInfoExpanded = TRUE; + } + return; + } + DAT_ButtonCurrentlyInteracting::instance = FALSE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, + AlphaAndButtonSurfaceObj::ptr)(0, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + 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_MULTIPLAYER_CONNECTION, 52), + posX, posY + 156, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE, + 0); + return; + } + 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_MULTIPLAYER_CONNECTION, 52), + posX, posY + 156, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, FALSE, 0); + DAT_ButtonY::instance = posY + 198; + DAT_ButtonX::instance = posX - 150; + DAT_ButtonW::instance = 100; + DAT_ButtonH::instance = 28; + // "Yes" + if (MACRO_CALL_MEMBER(OpenSHC::Input::MouseState_Func::isMouseInsideBox, DAT_MouseState::ptr)( + (posX - DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetX) - 150, + (posY - DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetY) + 198, 150, 28)) { + DAT_ButtonCurrentlyInteracting::instance = TRUE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, + AlphaAndButtonSurfaceObj::ptr)(0, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + 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_GAME_OPTIONS, 22), + leftX, posY + 204, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, FALSE, + 0); + if (DAT_MouseState::instance.leftClickStart) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_KILL_GAME); + } + } else { + DAT_ButtonCurrentlyInteracting::instance = FALSE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, + AlphaAndButtonSurfaceObj::ptr)(0, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + 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_GAME_OPTIONS, 22), + leftX, posY + 204, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, FALSE, + 0); + } + DAT_ButtonY::instance = posY + 198; + DAT_ButtonX::instance = posX + 50; + DAT_ButtonW::instance = 100; + DAT_ButtonH::instance = 28; + // "No" + if (MACRO_CALL_MEMBER(OpenSHC::Input::MouseState_Func::isMouseInsideBox, DAT_MouseState::ptr)( + (posX - DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetX) + 50, + (posY - DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetY) + 198, 150, 28)) { + DAT_ButtonCurrentlyInteracting::instance = TRUE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, + AlphaAndButtonSurfaceObj::ptr)(0, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + 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_GAME_OPTIONS, 23), + posX + 100, posY + 204, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, + FALSE, 0); + if (DAT_MouseState::instance.leftClickStart) { + DAT_GameSynchronyState::instance.connectionInfoExpanded = FALSE; + } + return; + } + DAT_ButtonCurrentlyInteracting::instance = FALSE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, + AlphaAndButtonSurfaceObj::ptr)(0, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + 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_GAME_OPTIONS, 23), + posX + 100, posY + 204, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, + FALSE, 0); + } else { + 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_MULTIPLAYER_CONNECTION, 52), + posX, posY + 156, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_7F7F7F, 18, FALSE, 0); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderStartingGoodDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderStartingGoodDisplayElement.cpp new file mode 100644 index 0000000000..ca3d83130b --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderStartingGoodDisplayElement.cpp @@ -0,0 +1,193 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eGM.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/Map/MapType2.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GMImageHeaders.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/GMFirstPictureIndex.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x00433DA0 + void RenderStartingGoodDisplayElement(int posX, int posY, DWORD elementState) + { + // zeroed before the early returns, as the original does + int startGoodsCount = 0; + if (DAT_GameCore::instance.currentMenuViewType == OpenSHC::UI::Enums::MVT_MAP_EDITOR_LANDSCAPING) { + return; + } + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR) { + return; + } + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_BUILDERUnk + && DAT_MapPropertiesState::instance.SEC_U3_MapType2_1 == OpenSHC::Map::MT_SIEGE + && DAT_GameSynchronyState::instance.currentPlayerSlotID == 2) { + return; + } + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY) { + if (DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .lordKilledByPlayerID + != 0) { + return; + } + if (DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .playerDeathRelated + != 0) { + return; + } + if (MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::areActivePlayersMostlySameTeam, + DAT_GameState::ptr)()) { + return; + } + } + if (DAT_GameSynchronyState::instance.currentGameMode == OpenSHC::Game::GM_SOLITARY + || DAT_GameCore::instance.mapU4Int0 == 0) { + if (MACRO_CALL(OpenSHC::UI::DisplayElements_Func::GetIfDisplayElementStateNotZero)( + OpenSHC::UI::Enums::DEID_TIME_UNTIL_VICTORY) + || MACRO_CALL(OpenSHC::UI::DisplayElements_Func::GetIfDisplayElementStateNotZero)( + OpenSHC::UI::Enums::DEID_TIME_UNTIL_DEFEAT)) { + posY += 50; + } + } else { + posY += 70; + } + int const playerSlotID = DAT_GameSynchronyState::instance.currentPlayerSlotID; + for (int i = 0; i < countof(DAT_GameState::instance.playerDataArray[0].startResources); ++i) { + if (DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .startResources[i] + != 0) { + ++startGoodsCount; + } + } + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_CAMPAIGN_MISSION) { + if (startGoodsCount == 0) { + return; + } + } else if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_CRUSADER_TUTORIAL) { + DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .someCount47 = 0; + DAT_GameState::instance.playerDataArray[playerSlotID].someCount45 = 0; + DAT_GameState::instance.playerDataArray[playerSlotID].textYOffset = 0; + } else if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .someCount47 = 2000; + DAT_GameState::instance.playerDataArray[playerSlotID].textYOffset = 30; + } + int const goodsPopupState = DAT_GameState::instance.playerDataArray[playerSlotID].someCount45; + if (goodsPopupState != 0) { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "Available Goods" + 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_STARTUP, 1), + posX, posY + 5, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE, + 0); + } else if (goodsPopupState == 1) { + // "Starting goods" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderText, DAT_TextManagerObject::ptr)( + OpenSHC::DE::SHCDE::TEXT_STARTUP, 0, posX, posY + 30, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE); + } else if (goodsPopupState == 2) { + // "Captured goods" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderText, DAT_TextManagerObject::ptr)( + OpenSHC::DE::SHCDE::TEXT_STARTUP, 2, posX, posY + 30, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE); + } + // the slot is read again after the text calls, as the original does + int const scrolledPlayerSlotID = DAT_GameSynchronyState::instance.currentPlayerSlotID; + DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .someCount47 += 2; + int const scrollIconIndex + = DAT_GameState::instance.playerDataArray[scrolledPlayerSlotID].someCount47 >> 2; + int const scrollX = DAT_GameState::instance.playerDataArray[scrolledPlayerSlotID].someCount47 - 40; + if (scrollX < DAT_WindowAndDirectDraw::instance.resolutionX) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)( + OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 204 + scrollIconIndex % 6, scrollX + posX, posY); + } else if (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT) { + DAT_GameState::instance.playerDataArray[scrolledPlayerSlotID].someCount47 = 0; + DAT_GameState::instance.playerDataArray[scrolledPlayerSlotID].someCount45 = 0; + } + } else { + int const remainingTextYOffset = DAT_GameState::instance.playerDataArray[playerSlotID].textYOffset; + if (remainingTextYOffset != 0) { + DAT_GameState::instance.playerDataArray[playerSlotID].textYOffset = remainingTextYOffset - 1; + } + } + int goodsRowY = 0; + for (int goodIndex = 0; goodIndex < countof(DAT_GameState::instance.playerDataArray[0].startResources); + ++goodIndex) { + if (DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .startResources[goodIndex] + == 0) { + continue; + } + // two pictures per good from 141 + int const goodGMFrame = goodIndex * 2 + 141; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, goodGMFrame, + (posX + - DAT_GMImageHeaders::instance + .imh[GMFirstPictureIndex::instance[OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2] + + goodGMFrame - 1] + .width + / 2) + + 12, + (DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .textYOffset + - DAT_GMImageHeaders::instance + .imh[GMFirstPictureIndex::instance[OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2] + + goodGMFrame - 1] + .height + / 2) + + goodsRowY + 12 + posY); + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .startResources[goodIndex], + posX + 30, + DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .textYOffset + + goodsRowY + 6 + posY, + OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 18, FALSE, 0); + if (DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .someCount45 + != 0) { + int const labelY + = DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .textYOffset + + goodsRowY + 6 + posY; + int const labelX = posX + 34; + 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_GOODS, goodIndex), + labelX, labelY, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 18, TRUE, + 0); + } + goodsRowY += 30; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/AiLordSelect/MenuModalRenderFunction_AiLordSelect.cpp b/src/OpenSHC/UI/MenuModals/AiLordSelect/MenuModalRenderFunction_AiLordSelect.cpp new file mode 100644 index 0000000000..f56dc0a202 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/AiLordSelect/MenuModalRenderFunction_AiLordSelect.cpp @@ -0,0 +1,65 @@ +#include "../AiLordSelect.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_LobbyAddAICurrentlyHoveredAI.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B19E0 + void AiLordSelect::MenuModalRenderFunction_AiLordSelect(int x, int y, int width, int height) + { + int yPos = y + 110; + if (DAT_GameCore::instance.numOfAIsWithCastleUnk <= 8) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(19, x, y); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(20, x, y); + } + // tested again, as the original does + if (DAT_GameCore::instance.numOfAIsWithCastleUnk > 8) { + yPos += 76; + } + if (DAT_MouseState::instance.rightClickStart) { + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + } + int textX = x + 24; + if (DAT_LobbyAddAICurrentlyHoveredAI::instance == 0) { + // "Highlight character for information. Click to use." + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_XPLAY_WAITING_ROOM, 401), + textX, yPos, 450, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, 0); + } else { + 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_XPLAY_WAITING_ROOM, + DAT_LobbyAddAICurrentlyHoveredAI::instance * 9 + 230), + textX, yPos, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, FALSE, 0); + yPos += 30; + int const descOffset = DAT_LobbyAddAICurrentlyHoveredAI::instance + 384; + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_XPLAY_WAITING_ROOM, descOffset), + textX, yPos, 566, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, 0); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/Allies/MenuModalRenderFunction_Allies.cpp b/src/OpenSHC/UI/MenuModals/Allies/MenuModalRenderFunction_Allies.cpp new file mode 100644 index 0000000000..2993bf1210 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/Allies/MenuModalRenderFunction_Allies.cpp @@ -0,0 +1,49 @@ +#include "../Allies.func.hpp" + +#include "OpenSHC/Game/Skirmish.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_00df42b0.hpp" +#include "OpenSHC/Globals/DAT_AlliesCount.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_Time_Allies1.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AC6E0 + void Allies::MenuModalRenderFunction_Allies(int x, int y, int width, int height) + { + MACRO_CALL(OpenSHC::Game::Skirmish_Func::RecalculateAllies)(); + DWORD const now = timeGetTime(); + if (500 < now - DAT_Time_Allies1::instance) { + DAT_Time_Allies1::instance = now; + ++DAT_00df42b0::instance; + if (1 < DAT_00df42b0::instance) { + DAT_00df42b0::instance = 0; + } + } + int const titleY = y + 25; + int const textX = x + 39; + // "Allies" + 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_ALLIES, 0), + textX, titleY, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 15, FALSE, 0); + if (DAT_AlliesCount::instance < 1) { + int const messageY = y + 100; + // "You have no Allies!" + 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_ALLIES, 19), + textX, messageY, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, FALSE, 0); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/BuildingAvailability/MenuModalRenderFunction_BuildingAvailability.cpp b/src/OpenSHC/UI/MenuModals/BuildingAvailability/MenuModalRenderFunction_BuildingAvailability.cpp new file mode 100644 index 0000000000..626c3116fe --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/BuildingAvailability/MenuModalRenderFunction_BuildingAvailability.cpp @@ -0,0 +1,42 @@ +#include "../BuildingAvailability.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ABBA0 + void BuildingAvailability::MenuModalRenderFunction_BuildingAvailability(int x, int y, int width, int height) + { + // "Building Availability" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_SCENARIO, 171, x, y, width, height); + int rightColumnX = x + 598; + int y1 = y + 82; + int y2 = y + 461; + int x2 = rightColumnX + 1; + int x1 = x + 117; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1 + 20, x2, y1 + 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1, rightColumnX - 20, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 19, y2 - 20, rightColumnX, y2 - 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/Chat/MenuModalRenderFunction_Chat.cpp b/src/OpenSHC/UI/MenuModals/Chat/MenuModalRenderFunction_Chat.cpp new file mode 100644 index 0000000000..9c3abeba2e --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/Chat/MenuModalRenderFunction_Chat.cpp @@ -0,0 +1,69 @@ +#include "../Chat.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" +#include "OpenSHC/UI/Enums/RoundedBoxEdgeRoundingLevel.hpp" + +#include "OpenSHC/Globals/COL_DARK_LIME.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ABD20 + void Chat::MenuModalRenderFunction_Chat(int x, int y, int width, int height) + { + int const titleY = y + 25; + int const titleX = x + 20; + // "Chat" + 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_MULTIPLAYER_CONNECTION, 30), + titleX, titleY, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 15, FALSE, 0); + int const cursorX = MACRO_CALL_MEMBER( + OpenSHC::Text::UserTextHandler_Func::getTextWidthUntilCurrentCursor, DAT_UserTextHandlerState::ptr)(); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBoxWithRoundedEdges, + DAT_PencilRenderCore::ptr)(x + 20, y + 191, x - 330 + width, y + 216, OpenSHC::UI::Enums::RBERL_SLIGHT); + if (DAT_GameSynchronyState::instance.DAT_InsultTextIndex == 0) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + x + 25 + cursorX, y + 193, x + 26 + cursorX, y + 213, COL_DARK_LIME::instance.shortValue); + } + if (DAT_UserTextHandlerState::instance.textArrayIndex != OpenSHC::Text::TAIT_UNKNOWN) { + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + OpenSHC::Text::TAIT_UNKNOWN); + } + if (DAT_GameSynchronyState::instance.DAT_InsultTextIndex != 0) { + int const fontSize = MACRO_CALL_MEMBER( + OpenSHC::Text::UserTextHandler_Func::getCurrentFontSize, DAT_UserTextHandlerState::ptr)(); + 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_INSULTS, DAT_GameSynchronyState::instance.DAT_InsultTextIndex), + x + 25, y + 199, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, fontSize, FALSE, + 0); + } else { + int const fontSize = MACRO_CALL_MEMBER( + OpenSHC::Text::UserTextHandler_Func::getCurrentFontSize, DAT_UserTextHandlerState::ptr)(); + // fetched before the other arguments, as the original does + char* const currentText = MACRO_CALL_MEMBER( + OpenSHC::Text::UserTextHandler_Func::getCurrentText, DAT_UserTextHandlerState::ptr)(); + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + currentText, x + 25, y + 199, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, + fontSize, FALSE, 0); + } + DAT_GameSynchronyState::instance.DAT_InsultTextIndex = 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataAivStateUnk/MenuModalRenderFunction_DebugDataAivStateUnk.cpp b/src/OpenSHC/UI/MenuModals/DebugDataAivStateUnk/MenuModalRenderFunction_DebugDataAivStateUnk.cpp new file mode 100644 index 0000000000..078a58e26e --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataAivStateUnk/MenuModalRenderFunction_DebugDataAivStateUnk.cpp @@ -0,0 +1,68 @@ +#include "../DebugDataAivStateUnk.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_AIVPlacementFit.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF4C0 + void DebugDataAivStateUnk::MenuModalRenderFunction_DebugDataAivStateUnk(int x, int y, int width, int height) + { + x += 20; + // "Village Placement Success" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + s_Village_Placement_Success_005a7760, x, y + 10, OpenSHC::Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 18, FALSE, 0); + y += 20; + for (int aivIndex = 1; aivIndex < countof(DAT_AIVPlacementFit::instance); ++aivIndex) { + y += 20; + // -10 marks a slot without a result, which gets no line + if (DAT_AIVPlacementFit::instance[aivIndex] == -10) { + continue; + } + // set in both branches: an initial value with one override measures lower + uint color; + if (DAT_AIVPlacementFit::instance[aivIndex] != 100) { + color = OpenSHC::Rendering::Colors::COL_0000FF; + } else { + color = OpenSHC::Rendering::Colors::COL_C2F0EB; + } + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + aivIndex, x, y, OpenSHC::Text::TTA_LEFT, color, 0, 18, FALSE, 0); + int placementFit = DAT_AIVPlacementFit::instance[aivIndex]; + if (placementFit == -3) { + // "File missing" + MACRO_CALL_MEMBER( + OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + s_File_missing_005a7750, x + 20, y, OpenSHC::Text::TTA_LEFT, color, 0, 18, FALSE, 0); + } else if (placementFit == -2) { + // "Can't place keep" + MACRO_CALL_MEMBER( + OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + s_Can_t_place_keep_005a773c, x + 20, y, OpenSHC::Text::TTA_LEFT, color, 0, 18, FALSE, 0); + } else if (placementFit == 100) { + // "Total Success" + MACRO_CALL_MEMBER( + OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + s_Total_Success_005a772c, x + 20, y, OpenSHC::Text::TTA_LEFT, color, 0, 18, FALSE, 0); + } else { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + placementFit, x + 20, y, OpenSHC::Text::TTA_LEFT, color, 0, 18, FALSE, 0); + // "% Success" + MACRO_CALL_MEMBER( + OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + s___Success_005a7720, x + 20, y, OpenSHC::Text::TTA_LEFT, color, 0, 18, TRUE, 0); + } + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DeleteGameRecord/MenuModalRenderFunctionMenuModal_DeleteGameRecord.cpp b/src/OpenSHC/UI/MenuModals/DeleteGameRecord/MenuModalRenderFunctionMenuModal_DeleteGameRecord.cpp new file mode 100644 index 0000000000..fad9c6e7ed --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DeleteGameRecord/MenuModalRenderFunctionMenuModal_DeleteGameRecord.cpp @@ -0,0 +1,39 @@ +#include "../DeleteGameRecord.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/GameLanguage.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D9CC0 + void DeleteGameRecord::MenuModalRenderFunctionMenuModal_DeleteGameRecord(int x, int y, int width, int height) + { + if ((DAT_TextManagerObject::instance.gameLanguage != OpenSHC::Text::GL_FRENCH) + && (DAT_TextManagerObject::instance.gameLanguage != OpenSHC::Text::GL_SPANISH)) { + // "Delete Game Record?" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_SKMASTERS, 13, x, y, width, height); + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderBanner, + DAT_PencilRenderCore::ptr)(x, y, width, height); + int const centerX = width / 2 + x; + // "Delete Game Record?" + 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_SKMASTERS, 13), + centerX, y + 27, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 17, FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/IdentityOptions/MenuModalRenderFunction_IdentityOptions.cpp b/src/OpenSHC/UI/MenuModals/IdentityOptions/MenuModalRenderFunction_IdentityOptions.cpp new file mode 100644 index 0000000000..0353e808d7 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/IdentityOptions/MenuModalRenderFunction_IdentityOptions.cpp @@ -0,0 +1,63 @@ +#include "../IdentityOptions.func.hpp" + +#include "OpenSHC/Text/TextManager.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/Rendering/Colors/ColorsEnum.hpp" + +#include "OpenSHC/Globals/DAT_CurrentlyRenderedSpriteID.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_RenderedUnitOwner.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/TIME_IdentityOptions.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x00491AC0 + void IdentityOptions::MenuModalRenderFunction_IdentityOptions(int x, int y, int width, int height) + { + uint animFrame = (timeGetTime() - TIME_IdentityOptions::instance) / 100; + if (animFrame > 15) { + animFrame = 0; + TIME_IdentityOptions::instance = timeGetTime(); + } + // "Set-up Identity" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_GAME_OPTIONS, 45, x, y, width, height); + int const xPos = x + 310; + // "Crusader or Arabic Lord" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_GAME_OPTIONS, 50), + xPos, y + 110, 165, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, 0); + // "Choose Portrait" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_GAME_OPTIONS, 51), + xPos, y + 210, 165, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, 0); + DAT_CurrentlyRenderedSpriteID::instance = OpenSHC::DE::SHCDE::GM_BODY_LORD; + if (DAT_GameCore::instance.selectedLordTypeUnk != 0) { + DAT_CurrentlyRenderedSpriteID::instance = OpenSHC::DE::SHCDE::GM_BODY_ARABIC_LORD; + } + DAT_RenderedUnitOwner::instance = 1; + if (DAT_CurrentlyRenderedSpriteID::instance == OpenSHC::DE::SHCDE::GM_BODY_LORD) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)( + OpenSHC::DE::SHCDE::GM_BODY_LORD, animFrame * 8 + 131, x + 115, y + 75); + } + if (DAT_CurrentlyRenderedSpriteID::instance == OpenSHC::DE::SHCDE::GM_BODY_ARABIC_LORD) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)( + OpenSHC::DE::SHCDE::GM_BODY_ARABIC_LORD, animFrame * 8 + 5, x + 120, y + 75); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/LoadMap/MenuModalRenderFunction_LoadMap.cpp b/src/OpenSHC/UI/MenuModals/LoadMap/MenuModalRenderFunction_LoadMap.cpp new file mode 100644 index 0000000000..a5b16109f7 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/LoadMap/MenuModalRenderFunction_LoadMap.cpp @@ -0,0 +1,75 @@ +#include "../LoadMap.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MinimapViewState.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x00494210 + void LoadMap::MenuModalRenderFunction_LoadMap(int x, int y, int width, int height) + { + // "Load" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_GAME_OPTIONS, 2, x, y, 304, height); + int rightColumnX = x + 670; + int y1 = y + 34; + int y2 = y + 375; + int x2 = rightColumnX + 1; + int x1 = x + 309; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 + 20, x2, y1 + 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1, rightColumnX - 20, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 19, y2 - 20, rightColumnX, y2 - 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL(OpenSHC::UI::Helpers_Func::SetupPreviewMinimapDataUnk)(); + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapPreview, DAT_MinimapViewState::ptr)( + x + 55, y + 95); + DAT_MenuHandlerState::instance.currentMenu->zero = 0; + if (DAT_MenuTextInputState::instance.fileListContext == 1) { + DAT_MenuTextInputState::instance.savedListSelection1 + = DAT_MenuTextInputState::instance.menuLoadGameRelativeSelectionIndex; + DAT_MenuTextInputState::instance.savedListOffset1 + = DAT_MenuTextInputState::instance.menuLoadGameRelativeSelectionOffset; + DAT_MenuTextInputState::instance.savedListSortOrder1 + = DAT_MenuTextInputState::instance.fileListSortOrder; + } + if (DAT_MenuTextInputState::instance.fileListContext == 2) { + DAT_MenuTextInputState::instance.savedListSelection3 + = DAT_MenuTextInputState::instance.menuLoadGameRelativeSelectionIndex; + DAT_MenuTextInputState::instance.savedListOffset3 + = DAT_MenuTextInputState::instance.menuLoadGameRelativeSelectionOffset; + DAT_MenuTextInputState::instance.savedListSortOrder3 + = DAT_MenuTextInputState::instance.fileListSortOrder; + } + if (DAT_MenuTextInputState::instance.fileListContext == 3) { + DAT_MenuTextInputState::instance.savedListSelection2 + = DAT_MenuTextInputState::instance.menuLoadGameRelativeSelectionIndex; + DAT_MenuTextInputState::instance.savedListOffset2 + = DAT_MenuTextInputState::instance.menuLoadGameRelativeSelectionOffset; + DAT_MenuTextInputState::instance.savedListSortOrder2 + = DAT_MenuTextInputState::instance.fileListSortOrder; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/NewEventCondition/MenuModalRenderFunction_NewEventCondition.cpp b/src/OpenSHC/UI/MenuModals/NewEventCondition/MenuModalRenderFunction_NewEventCondition.cpp new file mode 100644 index 0000000000..fd785bb1ab --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/NewEventCondition/MenuModalRenderFunction_NewEventCondition.cpp @@ -0,0 +1,45 @@ +#include "../NewEventCondition.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_MissionAestheticsDefinedData.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ABA20 + void NewEventCondition::MenuModalRenderFunction_NewEventCondition(int x, int y, int width, int height) + { + // "Event Conditions" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_SCENARIO, 102, x, y, width, height); + if (DAT_MissionAestheticsDefinedData::instance + .EventConditionParamKind[DAT_MapPropertiesState::instance.invasionTroopIndex] + == 0) { + return; + } + int numInGroup = DAT_MapPropertiesState::instance.invasionTroopIndex + 106; + if (numInGroup > 125) { + numInGroup += 64; + } + // "Food/Weapons/Goods Acquired" (111, 112, 113, 123) all show 113, "Goods Acquired" + if (numInGroup == 111 || numInGroup == 112 || numInGroup == 113 || numInGroup == 123) { + numInGroup = 113; + } + 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_SCENARIO, numInGroup), + x + 30, y + 463, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/OnlineVoteQuitGame/MenuModalRenderFunction_OnlineVoteQuitGame.cpp b/src/OpenSHC/UI/MenuModals/OnlineVoteQuitGame/MenuModalRenderFunction_OnlineVoteQuitGame.cpp new file mode 100644 index 0000000000..12d8239376 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/OnlineVoteQuitGame/MenuModalRenderFunction_OnlineVoteQuitGame.cpp @@ -0,0 +1,34 @@ +#include "../OnlineVoteQuitGame.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004937E0 + void OnlineVoteQuitGame::MenuModalRenderFunction_OnlineVoteQuitGame(int x, int y, int width, int height) + { + // "End this game?" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 59, x, y, width, height); + int secondsLeft = 10 - (timeGetTime() - DAT_GameSynchronyState::instance.quitGameVoteRequestTime) / 1000; + if (secondsLeft < 0) { + secondsLeft = 0; + } + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumberToScreen2, DAT_TextManagerObject::ptr)( + secondsLeft, x + 20, y + 125, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_C2F0EB, 18, + FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/OverlaySlider/MenuModalRenderFunction_OverlaySlider.cpp b/src/OpenSHC/UI/MenuModals/OverlaySlider/MenuModalRenderFunction_OverlaySlider.cpp new file mode 100644 index 0000000000..88d8e8082f --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/OverlaySlider/MenuModalRenderFunction_OverlaySlider.cpp @@ -0,0 +1,28 @@ +#include "../OverlaySlider.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eGM.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AA440 + void OverlaySlider::MenuModalRenderFunction_OverlaySlider(int x, int y, int width, int height) + { + if (!MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::getAreWeInAInGameMenu, DAT_GameCore::ptr)()) { + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 270, x, y); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/ReceiveMapFrom/MenuModalRenderFunction_ReceiveMapFrom.cpp b/src/OpenSHC/UI/MenuModals/ReceiveMapFrom/MenuModalRenderFunction_ReceiveMapFrom.cpp new file mode 100644 index 0000000000..2922bbc1bd --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/ReceiveMapFrom/MenuModalRenderFunction_ReceiveMapFrom.cpp @@ -0,0 +1,35 @@ +#include "../ReceiveMapFrom.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/COL_DARK_LIME.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AC4C0 + void ReceiveMapFrom::MenuModalRenderFunction_ReceiveMapFrom(int x, int y, int width, int height) + { + // "Receiving Map" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_XPLAY_WAITING_ROOM, 107, x, y, width, height); + y += 10; + int const left = x + width / 4; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderBox, DAT_PencilRenderCore::ptr)( + left - 1, y + 80, width * 3 / 4 + 1 + x, y + 99, COL_BLACK::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + left, y + 81, + ((width / 2) * DAT_GameSynchronyState::instance.mapSendingByteBufferAddress[0]) + / DAT_GameSynchronyState::instance.mapSendingFileSize + + width / 4 + x, + y + 98, COL_DARK_LIME::instance.shortValue); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/SaveMap/MenuModalRenderFunction_SaveMap.cpp b/src/OpenSHC/UI/MenuModals/SaveMap/MenuModalRenderFunction_SaveMap.cpp new file mode 100644 index 0000000000..e53e9c3665 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/SaveMap/MenuModalRenderFunction_SaveMap.cpp @@ -0,0 +1,42 @@ +#include "../SaveMap.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004931A0 + void SaveMap::MenuModalRenderFunction_SaveMap(int x, int y, int width, int height) + { + // "Save" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_GAME_OPTIONS, 3, x, y, 304, height); + int rightColumnX = x + 670; + int y1 = y + 34; + int y2 = y + 375; + int x2 = rightColumnX + 1; + int x1 = x + 309; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 + 20, x2, y1 + 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1, rightColumnX - 20, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 19, y2 - 20, rightColumnX, y2 - 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/SendMapTo/MenuModalRenderFunction_SendMapTo.cpp b/src/OpenSHC/UI/MenuModals/SendMapTo/MenuModalRenderFunction_SendMapTo.cpp new file mode 100644 index 0000000000..8c16c484c5 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/SendMapTo/MenuModalRenderFunction_SendMapTo.cpp @@ -0,0 +1,56 @@ +#include "../SendMapTo.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/COL_DARK_LIME.hpp" +#include "OpenSHC/Globals/DAT_BlendingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_RenderingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AC310 + void SendMapTo::MenuModalRenderFunction_SendMapTo(int x, int y, int width, int height) + { + // "Send Map To" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_XPLAY_WAITING_ROOM, 106, x, y, width, height); + int rowOffsetY = 0; + for (int playerID = 1; playerID < countof(DAT_GameSynchronyState::instance.mapTransferStatePerPlayer); + ++playerID) { + if (DAT_GameSynchronyState::instance.mapTransferStatePerPlayer[playerID] != 1) { + continue; + } + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + DAT_GameSynchronyState::instance.DAT_PlayerNames[playerID], x + 20, rowOffsetY + 80 + y, + OpenSHC::Text::TTA_LEFT, + DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[playerID]], + 17, FALSE, 0); + if (DAT_GameSynchronyState::instance.DAT_MapFileReceivingState != 0) { + int barX = width / 2 + x; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderBox, + DAT_PencilRenderCore::ptr)(barX - 1, rowOffsetY + 82 + y, width - 19 + x, rowOffsetY + 99 + y, + COL_BLACK::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(barX, rowOffsetY + 83 + y, + ((width / 2 - 20) * DAT_GameSynchronyState::instance.mapSendingByteBufferAddress[playerID]) + / DAT_GameSynchronyState::instance.mapSendingFileSize + + width / 2 + x, + rowOffsetY + 98 + y, COL_DARK_LIME::instance.shortValue); + } + rowOffsetY += 30; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/TacticalPowerBar/MenuModalRenderFunction_TacticalPowerBar.cpp b/src/OpenSHC/UI/MenuModals/TacticalPowerBar/MenuModalRenderFunction_TacticalPowerBar.cpp new file mode 100644 index 0000000000..ac931fe24e --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/TacticalPowerBar/MenuModalRenderFunction_TacticalPowerBar.cpp @@ -0,0 +1,51 @@ +#include "../TacticalPowerBar.func.hpp" + +#include "OpenSHC/Text/TextManager.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/Rendering/Colors/ColorsEnum.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/COL_WHITE.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TacticalPowersHelpTextDisplayBool.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D9DB0 + void TacticalPowerBar::MenuModalRenderFunction_TacticalPowerBar(int x, int y, int width, int height) + { + int barFillHeight + = (DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .tacticalPowersBarLevel + * 308) + / 7000; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + x + 40, y - 10, x + 45, y + 302, COL_BLACK::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderBox, DAT_PencilRenderCore::ptr)( + x + 40, y - 10, x + 45, y + 302, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + x + 42, y - barFillHeight + 300, x + 43, y + 300, COL_WHITE::instance.shortValue); + if (DAT_TacticalPowersHelpTextDisplayBool::instance) { + // "Click on an Icon to use Tactical Powers" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText6Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_EXTREME_DEMO, 7), + x - 200, y + 250, 195, OpenSHC::Rendering::Colors::COL_FFFFFF, 0, 18, 0); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, 468, x - 27, y + 267); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/TriggerEventSlider/MenuModalRenderFunction_TriggerEventSlider.cpp b/src/OpenSHC/UI/MenuModals/TriggerEventSlider/MenuModalRenderFunction_TriggerEventSlider.cpp new file mode 100644 index 0000000000..bfae040f2b --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/TriggerEventSlider/MenuModalRenderFunction_TriggerEventSlider.cpp @@ -0,0 +1,40 @@ +#include "../TriggerEventSlider.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/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AC280 + void TriggerEventSlider::MenuModalRenderFunction_TriggerEventSlider(int x, int y, int width, int height) + { + int textNumInGroup = DAT_MapPropertiesState::instance.invasionEventContent.field_0xa0; + int iconIndex = -1; + // 148 shows 146's text, and both show the icon + if (textNumInGroup == 148) { + textNumInGroup = 146; + } + if (textNumInGroup == 146) { + iconIndex = 2; + } + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)( + OpenSHC::DE::SHCDE::TEXT_SCENARIO, textNumInGroup, x, y, width, height); + if (iconIndex != -1) { + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)( + DE::SHCDE::GM_INTERFACE_ICONS2, iconIndex + 128, + width / 2 + 8 + DAT_TextManagerObject::instance.currentXOffset_0x0 / 2 + x, y + 26); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/UnusedChooseMessageBox/MenuModalRenderFunction_UnusedChooseMessageBox.cpp b/src/OpenSHC/UI/MenuModals/UnusedChooseMessageBox/MenuModalRenderFunction_UnusedChooseMessageBox.cpp new file mode 100644 index 0000000000..59199fdfdd --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/UnusedChooseMessageBox/MenuModalRenderFunction_UnusedChooseMessageBox.cpp @@ -0,0 +1,24 @@ +#include "../UnusedChooseMessageBox.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB460 + void UnusedChooseMessageBox::MenuModalRenderFunction_UnusedChooseMessageBox(int x, int y, int width, int height) + { + // "Select Message" + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)( + OpenSHC::DE::SHCDE::TEXT_SCENARIO, 40, x, y, width, height); + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::dimBox, DAT_PencilRenderCore::ptr)( + x + 25, y + 100, x + 595, y + 370); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/UnusedCreateMessageEvent/MenuModalRenderFunction_UnusedCreateMessageEvent.cpp b/src/OpenSHC/UI/MenuModals/UnusedCreateMessageEvent/MenuModalRenderFunction_UnusedCreateMessageEvent.cpp new file mode 100644 index 0000000000..42bd49bb59 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/UnusedCreateMessageEvent/MenuModalRenderFunction_UnusedCreateMessageEvent.cpp @@ -0,0 +1,43 @@ +#include "../UnusedCreateMessageEvent.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB680 + void UnusedCreateMessageEvent::MenuModalRenderFunction_UnusedCreateMessageEvent( + int x, int y, int width, int height) + { + // "Message" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_SCENARIO, 47, x, y, width, height); + int rightColumnX = x + 690; + int y1 = y + 215; + int y2 = y + 394; + int x2 = rightColumnX + 1; + int x1 = x + 189; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1 + 20, x2, y1 + 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1, rightColumnX - 20, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 19, y2 - 20, rightColumnX, y2 - 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/UnusedCreateTimedMessageEvent/MenuModalRenderFunction_UnusedCreateTimedMessageEvent.cpp b/src/OpenSHC/UI/MenuModals/UnusedCreateTimedMessageEvent/MenuModalRenderFunction_UnusedCreateTimedMessageEvent.cpp new file mode 100644 index 0000000000..0fcd6c07cb --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/UnusedCreateTimedMessageEvent/MenuModalRenderFunction_UnusedCreateTimedMessageEvent.cpp @@ -0,0 +1,43 @@ +#include "../UnusedCreateTimedMessageEvent.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB570 + void UnusedCreateTimedMessageEvent::MenuModalRenderFunction_UnusedCreateTimedMessageEvent( + int x, int y, int width, int height) + { + // "Message" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_SCENARIO, 47, x, y, width, height); + int rightColumnX = x + 690; + int y1 = y + 265; + int y2 = y + 444; + int x2 = rightColumnX + 1; + int x1 = x + 189; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1 + 20, x2, y1 + 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 20, y1, rightColumnX - 20, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + rightColumnX - 19, y2 - 20, rightColumnX, y2 - 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/VideoOptions/MenuModalRenderFunction_VideoOptions.cpp b/src/OpenSHC/UI/MenuModals/VideoOptions/MenuModalRenderFunction_VideoOptions.cpp new file mode 100644 index 0000000000..72775b6893 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/VideoOptions/MenuModalRenderFunction_VideoOptions.cpp @@ -0,0 +1,24 @@ +#include "../VideoOptions.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x00492120 + void VideoOptions::MenuModalRenderFunction_VideoOptions(int x, int y, int width, int height) + { + // "Video Options" + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)( + OpenSHC::DE::SHCDE::TEXT_GAME_OPTIONS, 4, x, y, width, height); + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, DAT_PencilRenderCore::ptr)( + x + 102, y + 213, x + 178, y + 252, 16); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/YesNoDialog/MenuModalRenderFunction_YesNoDialog.cpp b/src/OpenSHC/UI/MenuModals/YesNoDialog/MenuModalRenderFunction_YesNoDialog.cpp new file mode 100644 index 0000000000..71c4deaaaa --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/YesNoDialog/MenuModalRenderFunction_YesNoDialog.cpp @@ -0,0 +1,66 @@ +#include "../YesNoDialog.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/UI_MissionModeIntent.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x00493390 + void YesNoDialog::MenuModalRenderFunction_YesNoDialog(int x, int y, int width, int height) + { + int bannerTextIndex = -1; + UI_MissionModeIntent::instance = FALSE; + switch ((int)DAT_MenuTextInputState::instance.DAT_MenuOptionsActionParameter) { + case -7: + bannerTextIndex = -DAT_MenuTextInputState::instance.DAT_MenuOptionsActionParameter; + break; + // the asking button's TEXT_GAME_OPTIONS text: 7 "Quit Mission", 9 "Exit Crusader", 44 "Restart Mission" + case 7: + case 9: + case 30: + case 43: + case 44: + case 47: + case 49: + bannerTextIndex = DAT_MenuTextInputState::instance.DAT_MenuOptionsActionParameter; + break; + case 1000: + bannerTextIndex = 7; + UI_MissionModeIntent::instance = TRUE; + break; + } + if (DAT_MenuTextInputState::instance.DAT_MenuOptionsActionParameter == 2000) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderBanner, + DAT_PencilRenderCore::ptr)(x, y, width, height); + // "Receiving Map" + 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_XPLAY_WAITING_ROOM, 107), + width / 2 + x, y + 15, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 17, FALSE, + 0); + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + DAT_GameSynchronyState::instance.unknownMapName_01, width / 2 + x, y + 42, + OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 17, FALSE, 0); + } else if (bannerTextIndex != -1) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)( + OpenSHC::DE::SHCDE::TEXT_GAME_OPTIONS, bannerTextIndex, x, y, width, height); + } + DAT_MenuHandlerState::instance.currentMenu->zero = 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/RenderCurrentMenuView.cpp b/src/OpenSHC/UI/Rendering/RenderCurrentMenuView.cpp new file mode 100644 index 0000000000..dc7412e6d3 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/RenderCurrentMenuView.cpp @@ -0,0 +1,40 @@ +#include "../Rendering.func.hpp" + +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuViewStackTop.hpp" +#include "OpenSHC/Globals/DAT_MenuView_TriggerPrepare.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F6210 + void Rendering::RenderCurrentMenuView() + { + for (MenuView* menuView = DAT_MenuViewStackTop::instance; menuView != NULL; + menuView = menuView->nextMenuViewPtr) { + if (DAT_GameCore::instance.currentMenuViewType != menuView->menuID) { + continue; + } + if (menuView->menuID == UI::Enums::MVT_NO_VIEW) { + if (DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial) { + MACRO_CALL(UI::Rendering_Func::RenderNoViewsFoundWarning)(); + } + } else { + if (DAT_MenuView_TriggerPrepare::instance) { + menuView->prepare(); + } + if (DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial + || DAT_MenuView_TriggerPrepare::instance) { + menuView->doInitial(); + } + menuView->doEveryFrame(); + } + } + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = FALSE; + DAT_MenuView_TriggerPrepare::instance = FALSE; + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/Destructor_TextureRenderCore.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/Destructor_TextureRenderCore.cpp new file mode 100644 index 0000000000..000e667ee0 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/Destructor_TextureRenderCore.cpp @@ -0,0 +1,31 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/OS.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044C7E0 + void TextureRenderCore::Destructor_TextureRenderCore() + { + if (this->gmProcessedImageData != NULL) { + MACRO_CALL(OS_Func::_free_base)(this->gmProcessedImageData); + } + if (this->unknownMemPtr_1_0x80 != NULL) { + MACRO_CALL(OS_Func::_free_base)(this->unknownMemPtr_1_0x80); + } + if (this->address2 != NULL) { + MACRO_CALL(OS_Func::_free_base)(this->address2); + } + if (this->bitmapsFaces_0x94 != NULL) { + MACRO_CALL(OS_Func::_free_base)(this->bitmapsFaces_0x94); + } + if (this->gmAndGfxImageDataBuffer != NULL) { + MACRO_CALL(OS_Func::_free_base)(this->gmAndGfxImageDataBuffer); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/adaptGmColorsToRGB565IfRequired.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/adaptGmColorsToRGB565IfRequired.cpp new file mode 100644 index 0000000000..acae6ef7de --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/adaptGmColorsToRGB565IfRequired.cpp @@ -0,0 +1,44 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/IO/Graphics/GmImageType.hpp" +#include "OpenSHC/IO/Graphics/GmImageTypeInt.hpp" +#include "OpenSHC/Rendering/ColorMode.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + using OpenSHC::IO::Graphics::GmImageTypeInt; + + // FUNCTION: STRONGHOLDCRUSADER 0x00455930 + void TextureRenderCore::adaptGmColorsToRGB565IfRequired(int gmID, int imageIndex) + { + if (DAT_WindowAndDirectDraw::instance.colorBitMode != OpenSHC::Rendering::RGB_565) { + return; + } + GmImageTypeInt const imageType = this->gmFileHeaderColorpaletteArray[gmID].ImageType; + if (imageType == OpenSHC::IO::Graphics::GIT_InterfaceElement + || imageType == OpenSHC::IO::Graphics::GIT_Font) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::transformTgxCompressedImageToRGB565, + this)(imageIndex); + } else if (imageType == OpenSHC::IO::Graphics::GIT_UncompressedImageUnk) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::transformUncompressedImageWithMarkerUnkToRGB565, + this)(imageIndex); + } else if (imageType == OpenSHC::IO::Graphics::GIT_CompressedImage) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::transformTgxCompressedImageToRGB565, + this)(imageIndex); + } else if (imageType == OpenSHC::IO::Graphics::GIT_Tileset) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::transformTilesetToRGB565, this)( + imageIndex); + } else if (imageType == OpenSHC::IO::Graphics::GIT_UncompressedImage) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::transformUncompressedImageToRGB565, + this)(imageIndex); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/clearSomeMemory.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/clearSomeMemory.cpp new file mode 100644 index 0000000000..5cbaad9e86 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/clearSomeMemory.cpp @@ -0,0 +1,33 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/IO/LowLevelMemory.func.hpp" + +#include "OpenSHC/Globals/DAT_BlendFilterArrays.hpp" +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" +#include "OpenSHC/Globals/PTR_ARRAY_00c9a490.hpp" +#include "OpenSHC/Globals/PTR_ARRAY_Unknown_UnitGMHeights.hpp" +#include "OpenSHC/Globals/TGX_RepeatRunHandlers.hpp" +#include "OpenSHC/Globals/TGX_StreamRunHandlers.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044CC30 + void TextureRenderCore::clearSomeMemory() + { + MACRO_CALL_MEMBER(IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(TGX_RepeatRunHandlers::instance), '\0', TGX_RepeatRunHandlers::instance); + MACRO_CALL_MEMBER(IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(TGX_StreamRunHandlers::instance), '\0', TGX_StreamRunHandlers::instance); + MACRO_CALL_MEMBER(IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(PTR_ARRAY_00c9a490::instance), '\0', PTR_ARRAY_00c9a490::instance); + MACRO_CALL_MEMBER(IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(PTR_ARRAY_Unknown_UnitGMHeights::instance), '\0', PTR_ARRAY_Unknown_UnitGMHeights::instance); + MACRO_CALL_MEMBER(IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(DAT_BlendFilterArrays::instance), '\0', &DAT_BlendFilterArrays::instance); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/drawGfxOnFlaggedSurface.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/drawGfxOnFlaggedSurface.cpp new file mode 100644 index 0000000000..6b64f2c8b0 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/drawGfxOnFlaggedSurface.cpp @@ -0,0 +1,18 @@ +#include "../TextureRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004558E0 + void TextureRenderCore::drawGfxOnFlaggedSurface(int gfxIndex, int xPos, int yPos) + { + // The pixels follow the 8-byte header (width and height) + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawTgxOnFlaggedSurface, this)(xPos, yPos, + this->loadedGfxArray[gfxIndex].width, this->loadedGfxArray[gfxIndex].height, + (ushort*)(this->gmAndGfxImageDataBuffer + this->loadedGfxArray[gfxIndex].offsetInBuffer + 8)); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/drawLoadingBarUnk.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/drawLoadingBarUnk.cpp new file mode 100644 index 0000000000..b3590d2e51 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/drawLoadingBarUnk.cpp @@ -0,0 +1,36 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/WindowAndDirectDraw.func.hpp" + +#include "OpenSHC/Globals/COL_DARK_RED.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/TIME_LastVisualLoadingBarUpdate.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044C850 + void TextureRenderCore::drawLoadingBarUnk(GmID currentGmId, int barLengthUnk) + { + DWORD const now = timeGetTime(); + if ((int)(now - TIME_LastVisualLoadingBarUpdate::instance) <= 30) { + return; + } + TIME_LastVisualLoadingBarUpdate::instance = now; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + DAT_MenuHandlerState::instance.x + 236, DAT_MenuHandlerState::instance.y + 571, + currentGmId * 328 / barLengthUnk + 236 + DAT_MenuHandlerState::instance.x, + DAT_MenuHandlerState::instance.y + 579, COL_DARK_RED::instance.shortValue); + MACRO_CALL_MEMBER(UI::Rendering::WindowAndDirectDraw_Func::bltScreenMenuSurfaceToScreen, + DAT_WindowAndDirectDraw::ptr)(DAT_MenuHandlerState::instance.x + 235, + DAT_MenuHandlerState::instance.y + 570, DAT_MenuHandlerState::instance.x + 565, + DAT_MenuHandlerState::instance.y + 580); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/transformGmColorTableFromRGB555To565IfRequired.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformGmColorTableFromRGB555To565IfRequired.cpp new file mode 100644 index 0000000000..7ab2c6732d --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformGmColorTableFromRGB555To565IfRequired.cpp @@ -0,0 +1,30 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/Rendering/ColorMode.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044C8F0 + void TextureRenderCore::transformGmColorTableFromRGB555To565IfRequired(int gmID) + { + if (DAT_WindowAndDirectDraw::instance.colorBitMode != OpenSHC::Rendering::RGB_565) { + return; + } + ushort* color = (ushort*)this->gmFileHeaderColorpaletteArray[gmID].colorPalette; + for (int remaining = countof(this->gmFileHeaderColorpaletteArray[gmID].colorPalette) + * countof(this->gmFileHeaderColorpaletteArray[gmID].colorPalette[0]); + remaining != 0; --remaining) { + ushort const rgb555 = *color; + // red and green move up a bit to make room for green's sixth bit; blue stays + *color = (rgb555 & 0x1f) + ((rgb555 & 0xfc00) + (rgb555 & 0x3e0)) * 2; + ++color; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/createCrusaderWindow.cpp b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/createCrusaderWindow.cpp new file mode 100644 index 0000000000..4a49600663 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/createCrusaderWindow.cpp @@ -0,0 +1,27 @@ +#include "../WindowAndDirectDraw.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0046FF50 + void WindowAndDirectDraw::createCrusaderWindow(HINSTANCE hInstance, LPCSTR windowName, uint cursorResource) + { + this->hInstanceUnk_0xa8 = hInstance; + if (!MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::createWindow, this)( + windowName, cursorResource)) { + return; + } + CoInitialize(NULL); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::getDeviceCapsAndSetup, this)(); + if (this->currentGameResolution >= 0) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::setupPreferredScreenResolution, this)(); + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::setWindowStyleRectAndPosition, this)(); + this->windowRenderTimeUnk_0x1e0 = timeGetTime(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ed989c9a21..64027e663d 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -11107,13 +11107,13 @@ SHC_3BB0A8C1_0x00433630 | 0.0% | Pending SHC_3BB0A8C1_0x00433780 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00433BC0 | 0.0% | Pending +SHC_3BB0A8C1_0x00433BC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00433C20 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00433D00 | 0.0% | Pending +SHC_3BB0A8C1_0x00433D00 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00433DA0 | 0.0% | Pending +SHC_3BB0A8C1_0x00433DA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00434120 | 100.0% | Reimplemented @@ -16897,11 +16897,11 @@ SHC_3BB0A8C1_0x0044C410 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044C740 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044C7E0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044C7E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044C850 | 0.0% | Pending +SHC_3BB0A8C1_0x0044C850 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044C8F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044C8F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044C940 | 100.0% | Reimplemented @@ -16913,7 +16913,7 @@ SHC_3BB0A8C1_0x0044CB60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044CBE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044CC30 | 0.0% | Pending +SHC_3BB0A8C1_0x0044CC30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044CCA0 | 100.0% | Reimplemented @@ -17025,9 +17025,9 @@ SHC_3BB0A8C1_0x00455540 | 0.0% | Pending SHC_3BB0A8C1_0x004557B0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004558E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004558E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00455930 | 0.0% | Pending +SHC_3BB0A8C1_0x00455930 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004559B0 | 0.0% | Pending @@ -21241,7 +21241,7 @@ SHC_3BB0A8C1_0x0046FE62 | 0.0% | Pending SHC_3BB0A8C1_0x0046FE9E | 0.0% | Pending -SHC_3BB0A8C1_0x0046FF50 | 0.0% | Pending +SHC_3BB0A8C1_0x0046FF50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0046FFB0 | 100.0% | Reimplemented @@ -23419,7 +23419,7 @@ SHC_3BB0A8C1_0x00491840 | 0.0% | Pending SHC_3BB0A8C1_0x00491A30 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00491AC0 | 0.0% | Pending +SHC_3BB0A8C1_0x00491AC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00491BF0 | 100.0% | Reimplemented @@ -23451,7 +23451,7 @@ SHC_3BB0A8C1_0x00492070 | 0.0% | Pending SHC_3BB0A8C1_0x00492080 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00492120 | 0.0% | Pending +SHC_3BB0A8C1_0x00492120 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00492170 | 0.0% | Pending @@ -23549,13 +23549,13 @@ SHC_3BB0A8C1_0x00492FD0 | 0.0% | Pending SHC_3BB0A8C1_0x00493050 | 100.0% | Reimplemented, Security Cookie mismatches -SHC_3BB0A8C1_0x004931A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004931A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004932A0 | 0.0% | Pending SHC_3BB0A8C1_0x004932E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00493390 | 0.0% | Pending +SHC_3BB0A8C1_0x00493390 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004934B4 | 0.0% | Pending @@ -23631,7 +23631,7 @@ SHC_3BB0A8C1_0x004937A4 | 0.0% | Pending SHC_3BB0A8C1_0x004937B0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004937E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004937E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00493850 | 100.0% | Reimplemented @@ -24043,7 +24043,7 @@ SHC_3BB0A8C1_0x004941E8 | 0.0% | Pending SHC_3BB0A8C1_0x004941F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00494210 | 0.0% | Pending +SHC_3BB0A8C1_0x00494210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004943B0 | 100.0% | Reimplemented, Security Cookie mismatches @@ -25491,7 +25491,7 @@ SHC_3BB0A8C1_0x004AA1F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AA3E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AA440 | 0.0% | Pending +SHC_3BB0A8C1_0x004AA440 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AA480 | 0.0% | Pending @@ -25541,7 +25541,7 @@ SHC_3BB0A8C1_0x004AAB50 | 0.0% | Pending SHC_3BB0A8C1_0x004AB440 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AB460 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB460 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AB4B0 | 100.0% | Reimplemented @@ -25551,13 +25551,13 @@ SHC_3BB0A8C1_0x004AB510 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AB540 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AB570 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB570 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AB680 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB680 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AB790 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004ABA20 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABA20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004ABAB0 | 100.0% | Reimplemented @@ -25617,7 +25617,7 @@ SHC_3BB0A8C1_0x004ABB90 | 0.0% | Pending SHC_3BB0A8C1_0x004ABB91 | 0.0% | Pending -SHC_3BB0A8C1_0x004ABBA0 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABBA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004ABCB0 | 100.0% | Reimplemented @@ -25625,7 +25625,7 @@ SHC_3BB0A8C1_0x004ABCE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004ABD10 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004ABD20 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABD20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004ABE50 | 100.0% | Reimplemented @@ -25781,19 +25781,19 @@ SHC_3BB0A8C1_0x004AC24F | 0.0% | Pending SHC_3BB0A8C1_0x004AC250 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AC280 | 0.0% | Pending +SHC_3BB0A8C1_0x004AC280 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AC310 | 0.0% | Pending +SHC_3BB0A8C1_0x004AC310 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AC440 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AC4C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AC4C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AC570 | 0.0% | Pending SHC_3BB0A8C1_0x004AC650 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AC6E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AC6E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AC7A0 | 0.0% | Pending @@ -25899,7 +25899,7 @@ SHC_3BB0A8C1_0x004AEF60 | 0.0% | Pending SHC_3BB0A8C1_0x004AEF70 | 0.0% | Pending -SHC_3BB0A8C1_0x004AF4C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF4C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AF5E0 | 0.0% | Pending @@ -25913,7 +25913,7 @@ SHC_3BB0A8C1_0x004AF6B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AF6E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AF700 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF700 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AF800 | 100.0% | Reimplemented @@ -25931,17 +25931,17 @@ SHC_3BB0A8C1_0x004AFB00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AFB30 | 0.0% | Pending -SHC_3BB0A8C1_0x004AFDA0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AFDA0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AFE10 | 0.0% | Pending +SHC_3BB0A8C1_0x004AFE10 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B0390 | 0.0% | Pending -SHC_3BB0A8C1_0x004B07C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004B07C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B0820 | 0.0% | Pending -SHC_3BB0A8C1_0x004B0AC0 | 0.0% | Pending +SHC_3BB0A8C1_0x004B0AC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B0B30 | 100.0% | Reimplemented @@ -25987,17 +25987,17 @@ SHC_3BB0A8C1_0x004B1900 | 0.0% | Pending SHC_3BB0A8C1_0x004B1990 | 0.0% | Pending -SHC_3BB0A8C1_0x004B19E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004B19E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B1AC0 | 0.0% | Pending -SHC_3BB0A8C1_0x004B1C30 | 0.0% | Pending +SHC_3BB0A8C1_0x004B1C30 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004B1D30 | 0.0% | Pending +SHC_3BB0A8C1_0x004B1D30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B1D90 | 0.0% | Pending -SHC_3BB0A8C1_0x004B1E60 | 0.0% | Pending +SHC_3BB0A8C1_0x004B1E60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B1EB0 | 100.0% | Reimplemented @@ -36051,13 +36051,13 @@ SHC_3BB0A8C1_0x004D9C08 | 0.0% | Pending SHC_3BB0A8C1_0x004D9C10 | 0.0% | Pending -SHC_3BB0A8C1_0x004D9CC0 | 0.0% | Pending +SHC_3BB0A8C1_0x004D9CC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9D60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9D90 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004D9DB0 | 0.0% | Pending +SHC_3BB0A8C1_0x004D9DB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9EC0 | 0.0% | Pending @@ -38683,7 +38683,7 @@ SHC_3BB0A8C1_0x004F61FC | 0.0% | Pending SHC_3BB0A8C1_0x004F6200 | 0.0% | Pending -SHC_3BB0A8C1_0x004F6210 | 0.0% | Pending +SHC_3BB0A8C1_0x004F6210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F6280 | 0.0% | Pending