Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
65977fe
reimplement: SHC_3BB0A8C1_0x004B1C30 100.0% Reimplemented
gynt Nov 9, 2026
2ab32a5
reimplement: SHC_3BB0A8C1_0x00433D00 100.0% Reimplemented
gynt Nov 9, 2026
c7aa536
reimplement: SHC_3BB0A8C1_0x00433BC0 100.0% Reimplemented
gynt Nov 9, 2026
c4182ad
reimplement: SHC_3BB0A8C1_0x004AF700 100.0% Reimplemented
gynt Nov 9, 2026
951caaf
reimplement: SHC_3BB0A8C1_0x004B1E60 100.0% Reimplemented
gynt Nov 9, 2026
6c54439
reimplement: SHC_3BB0A8C1_0x004B07C0 100.0% Reimplemented
gynt Nov 9, 2026
6a74d4f
reimplement: SHC_3BB0A8C1_0x004AFDA0 100.0% Reimplemented
gynt Nov 9, 2026
8edcd42
reimplement: SHC_3BB0A8C1_0x004B0AC0 100.0% Reimplemented
gynt Nov 9, 2026
bae338c
reimplement: SHC_3BB0A8C1_0x004B1D30 100.0% Reimplemented
gynt Nov 9, 2026
c7ca43d
reimplement: SHC_3BB0A8C1_0x004AFE10 100.0% Reimplemented
gynt Nov 9, 2026
f8b63f7
reimplement: SHC_3BB0A8C1_0x00433DA0 100.0% Reimplemented
gynt Nov 9, 2026
4cca639
reimplement: SHC_3BB0A8C1_0x004B19E0 100.0% Reimplemented
gynt Nov 9, 2026
5cd99ab
reimplement: SHC_3BB0A8C1_0x004AC6E0 100.0% Reimplemented
gynt Nov 9, 2026
ae4b4d0
reimplement: SHC_3BB0A8C1_0x004ABBA0 100.0% Reimplemented
gynt Nov 9, 2026
1e4b8d8
reimplement: SHC_3BB0A8C1_0x004ABD20 100.0% Reimplemented
gynt Nov 9, 2026
9db7b01
reimplement: SHC_3BB0A8C1_0x004AF4C0 100.0% Reimplemented
gynt Nov 9, 2026
4674e08
reimplement: SHC_3BB0A8C1_0x004D9CC0 100.0% Reimplemented
gynt Nov 9, 2026
344476d
reimplement: SHC_3BB0A8C1_0x00491AC0 100.0% Reimplemented
gynt Nov 9, 2026
5d75393
reimplement: SHC_3BB0A8C1_0x00494210 100.0% Reimplemented
gynt Nov 9, 2026
c92cbc5
reimplement: SHC_3BB0A8C1_0x004ABA20 100.0% Reimplemented
gynt Nov 9, 2026
77052e3
reimplement: SHC_3BB0A8C1_0x004937E0 100.0% Reimplemented
gynt Nov 9, 2026
3da6e56
reimplement: SHC_3BB0A8C1_0x004AA440 100.0% Reimplemented
gynt Nov 9, 2026
d06ee8a
reimplement: SHC_3BB0A8C1_0x004AC4C0 100.0% Reimplemented
gynt Nov 9, 2026
b2a056c
reimplement: SHC_3BB0A8C1_0x004931A0 100.0% Reimplemented
gynt Nov 9, 2026
c0767b2
reimplement: SHC_3BB0A8C1_0x004AC310 100.0% Reimplemented
gynt Nov 9, 2026
ea40d0d
reimplement: SHC_3BB0A8C1_0x004D9DB0 100.0% Reimplemented
gynt Nov 9, 2026
c482725
reimplement: SHC_3BB0A8C1_0x004AC280 100.0% Reimplemented
gynt Nov 9, 2026
fd4aab9
reimplement: SHC_3BB0A8C1_0x004AB460 100.0% Reimplemented
gynt Nov 9, 2026
69f2b37
reimplement: SHC_3BB0A8C1_0x004AB680 100.0% Reimplemented
gynt Nov 9, 2026
3d06f95
reimplement: SHC_3BB0A8C1_0x004AB570 100.0% Reimplemented
gynt Nov 9, 2026
e704421
reimplement: SHC_3BB0A8C1_0x00492120 100.0% Reimplemented
gynt Nov 9, 2026
4f6c2a2
reimplement: SHC_3BB0A8C1_0x00493390 100.0% Reimplemented
gynt Nov 9, 2026
a96f03d
reimplement: SHC_3BB0A8C1_0x004F6210 100.0% Reimplemented
gynt Nov 9, 2026
a0f7892
reimplement: SHC_3BB0A8C1_0x0044C7E0 100.0% Reimplemented
gynt Nov 9, 2026
74aeffb
reimplement: SHC_3BB0A8C1_0x00455930 100.0% Reimplemented
gynt Nov 9, 2026
0251bb7
reimplement: SHC_3BB0A8C1_0x0044CC30 100.0% Reimplemented
gynt Nov 9, 2026
ed38453
reimplement: SHC_3BB0A8C1_0x004558E0 100.0% Reimplemented
gynt Nov 9, 2026
90b51d9
reimplement: SHC_3BB0A8C1_0x0044C850 100.0% Reimplemented
gynt Nov 9, 2026
47fe3af
reimplement: SHC_3BB0A8C1_0x0044C8F0 100.0% Reimplemented
gynt Nov 9, 2026
d825d5f
reimplement: SHC_3BB0A8C1_0x0046FF50 100.0% Reimplemented
gynt Nov 9, 2026
aa2dc63
Modals/DisplayElements/Rendering backlog: main's names where gynt's b…
kotijekriv Nov 9, 2026
e7dfbca
YesNoDialog and RenderCurrentMenuView: back to 100% on main
kotijekriv Nov 9, 2026
b094961
Modals/DisplayElements/Rendering backlog: the style fixer's pass
kotijekriv Nov 9, 2026
7068b38
Modals/DisplayElements/Rendering backlog: colour names, comments, NUL…
kotijekriv Nov 9, 2026
0c23d54
Modals/DisplayElements/Rendering backlog: declarations moved to their…
kotijekriv Nov 9, 2026
4ee7b94
Modals/DisplayElements/Rendering backlog: string pointers, and names …
kotijekriv Nov 9, 2026
1d02677
MenuModalRenderFunction_Allies: named positions in place of the decom…
kotijekriv Nov 9, 2026
b678191
RenderStartingGoodDisplayElement: no gotos, loops over the start goods
kotijekriv Nov 9, 2026
9759b90
Modals/DisplayElements/Rendering backlog: arguments in the calls inst…
kotijekriv Nov 9, 2026
5bdffe9
Modals/DisplayElements/Rendering backlog: names for decompiler locals…
kotijekriv Nov 9, 2026
3c66ba6
Modals/DisplayElements/Rendering backlog: last style points
kotijekriv Nov 9, 2026
6e938c5
header: TextArrayIndexType gets TAIT_UNKNOWN_4
kotijekriv Nov 9, 2026
b1b544b
Modals/DisplayElements/Rendering backlog: casts, includes, text comme…
kotijekriv Nov 9, 2026
16bb3e0
header: GameSynchronyState's connectionInfoExpanded is a BOOLEnum
kotijekriv Nov 9, 2026
09ae66d
Modals/DisplayElements/Rendering backlog: text comments, text groups,…
kotijekriv Nov 9, 2026
3a75b1f
Modals/DisplayElements/Rendering backlog: PlayerPing22's lag walk as …
kotijekriv Nov 9, 2026
a176cff
Merge main (d5d965db8) into reimpl/UI-gynt-backlog-ModalsDisplayRende…
kotijekriv Nov 9, 2026
02fe2de
UI-gynt-backlog-ModalsDisplayRendering: main's names after its Ghidra…
kotijekriv Nov 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}

}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}

}
}
}
76 changes: 76 additions & 0 deletions src/OpenSHC/UI/DisplayElements/RenderDisplayElementsUnk.cpp
Original file line number Diff line number Diff line change
@@ -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;
}
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}

}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}

}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}

}
}
}
Loading
Loading