Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
4196eb0
headers: SoundEffectID value 253 as SEID_UNKNOWN_0xFD
kotijekriv Nov 4, 2026
09a646e
headers: DAT_00b95960, DAT_00b95f64 and DAT_00b95b74 are ints
kotijekriv Nov 4, 2026
530c671
reimplement: SHC_3BB0A8C1_0x00428AC0 42.5% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
89a680f
reimplement: SHC_3BB0A8C1_0x004AC7A0 52.8% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
3f2ac05
reimplement: SHC_3BB0A8C1_0x00443A30 23.5% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
791f92c
reimplement: SHC_3BB0A8C1_0x00494950 64.2% strcat intrinsic, mechanic…
kotijekriv Nov 4, 2026
59372c9
reimplement: SHC_3BB0A8C1_0x00443070 53.2% compiles again, mechanical…
kotijekriv Nov 4, 2026
f5da902
reimplement: SHC_3BB0A8C1_0x004B9620 64.0% compiles again, mechanical…
kotijekriv Nov 4, 2026
98b3cb9
reimplement: SHC_3BB0A8C1_0x004C01B0 72.8% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
8c967b4
reimplement: SHC_3BB0A8C1_0x00427810 58.8% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
acab824
headers: UnitType value -1 as UT_NONE
kotijekriv Nov 4, 2026
7e35a45
headers: BuildMenuTabType value 49 as BMTT_UNKNOWN_49
kotijekriv Nov 4, 2026
d05e6ff
headers: UserTextHandler::copyIntoTextArray takes a char const*
kotijekriv Nov 4, 2026
1f29978
reimplement: SHC_3BB0A8C1_0x004B14C0 60.5% compiles again, mechanical…
kotijekriv Nov 4, 2026
72d2bc1
reimplement: SHC_3BB0A8C1_0x00438BE0 42.3% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
05a2243
reimplement: SHC_3BB0A8C1_0x004B8220 73.5% compiles again, mechanical…
kotijekriv Nov 4, 2026
c6a037b
reimplement: SHC_3BB0A8C1_0x00434350 67.1% compiles again, mechanical…
kotijekriv Nov 4, 2026
ee10c60
reimplement: SHC_3BB0A8C1_0x004643F0 49.0% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
15884ad
reimplement: SHC_3BB0A8C1_0x004AEA50 71.2% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
61df885
reimplement: SHC_3BB0A8C1_0x00461570 40.9% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
44e0290
headers: BuildingsAndStatusMenuTabType value 0 as BASMTT_NONE
kotijekriv Nov 4, 2026
0a929fa
reimplement: SHC_3BB0A8C1_0x004D8570 64.5% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
09e4dd8
reimplement: SHC_3BB0A8C1_0x004AD920 53.3% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
dcaa477
reimplement: SHC_3BB0A8C1_0x0042D140 46.8% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
c792435
reimplement: SHC_3BB0A8C1_0x00440A50 46.3% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
1fa7012
reimplement: SHC_3BB0A8C1_0x004D8250 42.4% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
5b1ec3b
reimplement: SHC_3BB0A8C1_0x004C0860 62.3% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
7b18743
reimplement: SHC_3BB0A8C1_0x004C0CF0 53.8% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
0a24948
reimplement: SHC_3BB0A8C1_0x004649D0 43.9% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
751edeb
headers: TileMapState's editor brush, brush half-size and affect type…
kotijekriv Nov 4, 2026
f2bde29
headers: ChooseNetworkServiceProviderButtonActions gets its negative …
kotijekriv Nov 4, 2026
306a61a
reimplement: SHC_3BB0A8C1_0x004909E0 79.4% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
6325fb7
reimplement: SHC_3BB0A8C1_0x00492170 80.4% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
60565a8
reimplement: SHC_3BB0A8C1_0x004BEC40 82.0% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
b74b836
reimplement: SHC_3BB0A8C1_0x004BF1D0 81.2% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
031cb7d
reimplement: SHC_3BB0A8C1_0x0042D640 75.1% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
b2d7696
reimplement: SHC_3BB0A8C1_0x00493E20 61.5% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
d518768
reimplement: SHC_3BB0A8C1_0x004B8BF0 79.5% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
74bdd12
reimplement: SHC_3BB0A8C1_0x00467040 83.8% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
2d468df
reimplement: SHC_3BB0A8C1_0x004D8EC0 35.2% gynt's draft, mechanical p…
kotijekriv Nov 4, 2026
60ea82a
reimplement: SHC_3BB0A8C1_0x00467040 93.3% BuySellMenuButtonsAndHands
kotijekriv Nov 5, 2026
e78114b
headers: ColorsEnum gets the colours our menus and displays use
kotijekriv Nov 5, 2026
53bea5f
style: colours by their ColorsEnum name
kotijekriv Nov 5, 2026
013dc3b
Move BarracksWeaponAvailability to the ready branch
kotijekriv Nov 5, 2026
ae5a920
fix: UnitActionButtons render hides button 376 without an engineer
kotijekriv Nov 5, 2026
5b068cd
Merge origin/main 948dce845 (countof() for array loop bounds)
kotijekriv Nov 5, 2026
d79d89d
Loop bounds by countof(), as main's 948dce845
kotijekriv Nov 5, 2026
dfa4b08
drop: 0x004BEC40 goes to reimpl/UI-MenuItems-6-100
kotijekriv Nov 5, 2026
2a4b5f2
headers: DAT_AlliesCount is an int
kotijekriv Nov 5, 2026
f8721e5
Allies render draft: no casts on DAT_AlliesCount now that it is an int
kotijekriv Nov 5, 2026
dafaa7c
Merge origin/main 72b27322e (upstream ghidra changes, #332, #334, #335)
kotijekriv Nov 5, 2026
13fbfea
reimplement: SHC_3BB0A8C1_0x004BBF40 92.3% was 100% before main's hea…
kotijekriv Nov 6, 2026
8ed1d23
reimplement: SHC_3BB0A8C1_0x00443A30 23.3% gynt's draft, mechanical p…
kotijekriv Nov 6, 2026
58babfb
Merge origin/main 7621d4f1d (upstream ghidra changes)
kotijekriv Nov 6, 2026
8101d64
drafts: move 0x004BBF40 TriggerInvasion_Main to the 100% PR
kotijekriv Nov 6, 2026
084c469
drafts: write TextInputRelatedUnk's wide NUL character as an escape
kotijekriv Nov 6, 2026
32e840d
drafts: move 0x004B8BF0, 0x004BF1D0 and 0x004D8570 to the 100% PR
kotijekriv Nov 6, 2026
ae90b76
drafts: move 0x004C01B0, 0x004B8220 and 0x004C0860 to the 100% PR
kotijekriv Nov 6, 2026
249f893
Merge main (eef6f667a, gynt's header sync) into reimpl/UI-MenuItems-3…
kotijekriv Nov 7, 2026
9df0e3f
Merge main (e32319b21, gynt's header sync) into reimpl/UI-MenuItems-3…
kotijekriv Nov 7, 2026
a552e96
style: AI types and screen resolutions by their enum names
kotijekriv Nov 8, 2026
e274e50
Merge main (03827fa2b) into reimpl/UI-MenuItems-3-development-2
kotijekriv Nov 8, 2026
6202bb0
fix: two files that main's header changes stopped compiling
kotijekriv Nov 8, 2026
82e5425
style: the lobby's empty AI slot test by its enum name
kotijekriv Nov 9, 2026
1849424
drafts: move 0x00492170 VideoOptions_Main to the round 11 PR
kotijekriv Nov 13, 2026
b379b2c
drafts: move 0x004909E0 and 0x0042D640 to the round 12 PR
kotijekriv Nov 14, 2026
3e3b705
drafts: move 0x004D8EC0 to the round 13 PR
kotijekriv Nov 14, 2026
85aab06
Merge origin/main (e086ba7c3) into reimpl/UI-MenuItems-3-development-2
kotijekriv Nov 17, 2026
5fca8b9
fix: two drafts build against main's ViewportState::mouseFlatTile
kotijekriv Nov 17, 2026
07a33e2
style: DAT_ButtonUnknownZero stores TRUE and FALSE
kotijekriv Nov 17, 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
438 changes: 438 additions & 0 deletions src/OpenSHC/UI/MenuItems/Allies/MenuItemRenderFunction_Allies_Main.cpp

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
#include "../AlliesSendAndRequestGoods.func.hpp"

#include "OpenSHC/Text/TextManager.func.hpp"
#include "OpenSHC/UI/Rendering.func.hpp"
#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp"
#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp"
#include "OpenSHC/DE/SHCDE/eGM.hpp"
#include "OpenSHC/DE/SHCDE/eTextSections.hpp"
#include "OpenSHC/Game/Resources/ResourceType.hpp"
#include "OpenSHC/IO/Graphics/GmID.hpp"
#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp"
#include "OpenSHC/Text/TextAlignment.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"

#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp"
#include "OpenSHC/Globals/DAT_ButtonH.hpp"
#include "OpenSHC/Globals/DAT_ButtonX.hpp"
#include "OpenSHC/Globals/DAT_ButtonY.hpp"
#include "OpenSHC/Globals/DAT_GameState.hpp"
#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp"
#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp"
#include "OpenSHC/Globals/DAT_RequestedGoodsByWhoArray.hpp"
#include "OpenSHC/Globals/DAT_SentOrRequestedGoodsAmount.hpp"
#include "OpenSHC/Globals/DAT_TextManagerObject.hpp"
#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp"

namespace OpenSHC {
namespace UI {
namespace MenuItems {

using OpenSHC::DE::SHCDE::eTextSections;
using OpenSHC::WindowsHelper::Enums::BOOLEnum;

// FUNCTION: STRONGHOLDCRUSADER 0x004AD920
void AlliesSendAndRequestGoods::MenuItemRenderFunction_AlliesSendAndRequestGoods_Main(int actionParam, ...)
{
int iVar1;
int iVar2;
int iVar3;
int iVar4;
eTextSections offsetIndex;
BOOLEnum keepOffsetX;
// first render resource type in condensed form
if (actionParam < 20) {
int _xOffset = 0;
if (actionParam == 6 || actionParam == 11 || actionParam == 20) {
_xOffset = 8;
}
// skip unusable resources
if (4 <= actionParam) {
++actionParam;
}
if (6 <= actionParam) {
++actionParam;
}
if (actionParam == 14) {
actionParam = 23;
}
int _gmID = actionParam * 2 + 617;
if (DAT_ButtonCurrentlyInteracting::instance) {
_gmID = actionParam * 2 + 618;
}
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM,
DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, _gmID,
DAT_ButtonX::instance + _xOffset, (int)(DAT_ButtonY::instance));
if (actionParam == 7) {
actionParam = 6;
}
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(
DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID]
.currentResources[actionParam + 1],
(int)(DAT_ButtonX::instance + 21), (int)(DAT_ButtonY::instance + 40), OpenSHC::Text::TTA_CENTER,
OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 19, FALSE, 0);
} else if (actionParam == 21) {
if (!DAT_ButtonCurrentlyInteracting::instance) {
iVar1 = 645;
} else {
iVar1 = 646;
}
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM,
DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, iVar1,
(int)(DAT_ButtonX::instance), (int)(DAT_ButtonY::instance));
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(
DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID]
.currentResources[OpenSHC::Game::Resources::RT_GOLD],
(int)(DAT_ButtonX::instance + 21), (int)(DAT_ButtonY::instance + 20), OpenSHC::Text::TTA_CENTER,
OpenSHC::Rendering::Colors::COL_C2F0EB, 0, 19, FALSE, 0);
return;
}
iVar1 = DAT_ButtonX::instance;
int iVar5 = DAT_ButtonY::instance;
// then draw the rest
if (actionParam == 40) {
// everything below belongs to actionParam == 40 only
if (0 < (int)DAT_ButtonH::instance) {
for (int iVar2 = 0; iVar2 < (int)DAT_ButtonH::instance; iVar2 = iVar2 + 24) {
if (iVar2 == 0) {
iVar3 = 1;
} else {
if (iVar2 == DAT_ButtonH::instance - 24) {
iVar3 = 13;
} else {
iVar3 = 7;
}
}
iVar4 = 0;
do {
int imageID = iVar3;
if (iVar4 == 0) {
LAB_004adacf:
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGMWithAlphaMask,
DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_3,
imageID, iVar4 + iVar1, iVar2 + iVar5, OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_3,
imageID + 3, 0);
} else {
if (iVar4 == 528) {
imageID = iVar3 + 2;
goto LAB_004adacf;
}
if (iVar3 != 7) {
imageID = iVar3 + 1;
goto LAB_004adacf;
}
return;
}
iVar4 += 24;
} while (iVar4 < 552);
}
}
MACRO_CALL_MEMBER(
OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, DAT_PencilRenderCore::ptr)(
iVar1 + 24, iVar5 + 24, iVar1 + 527, DAT_ButtonH::instance - 25 + iVar5, 20);
if (DAT_RequestedGoodsByWhoArray::instance[0] == 6) {
iVar1 = 7;
LAB_004adb48:
if (DAT_SentOrRequestedGoodsAmount::instance != 0) {
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(
DAT_SentOrRequestedGoodsAmount::instance, (int)(DAT_ButtonX::instance + 36),
(int)(DAT_ButtonY::instance + 36), OpenSHC::Text::TTA_LEFT,
OpenSHC::Rendering::Colors::COL_CCFAFF, 0, 17, FALSE, 0);
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM,
DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, iVar1 * 2 + 618,
(int)(DAT_TextManagerObject::instance.currentXOffset_0x0 + 46 + DAT_ButtonX::instance),
(int)(DAT_ButtonY::instance + 24));
keepOffsetX = TRUE;
iVar1 = DAT_ButtonX::instance + 96;
iVar5 = DAT_RequestedGoodsByWhoArray::instance[0] + 1;
offsetIndex = OpenSHC::DE::SHCDE::TEXT_GOODS;
goto LAB_004adbc8;
}
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM,
DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_ICONS2, iVar1 * 2 + 618,
(int)(DAT_ButtonX::instance + 36), (int)(DAT_ButtonY::instance + 24));
iVar1 = DAT_ButtonX::instance + 84;
iVar5 = 14;
} else {
iVar1 = DAT_RequestedGoodsByWhoArray::instance[0];
if (0 < DAT_RequestedGoodsByWhoArray::instance[0])
goto LAB_004adb48;
iVar1 = DAT_ButtonX::instance + 36;
iVar5 = 13;
}
keepOffsetX = FALSE;
offsetIndex = OpenSHC::DE::SHCDE::TEXT_ALLIES;
LAB_004adbc8:
iVar2 = DAT_ButtonY::instance + 36;
iVar4 = 0;
iVar3 = 17;
// added by script: "Choose Goods"
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)(
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset,
DAT_TextManagerObject::ptr)(offsetIndex, iVar5),
iVar1, iVar2, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, iVar3, keepOffsetX,
iVar4);
return;
}
if (100 <= actionParam) {
MACRO_CALL(OpenSHC::UI::Rendering_Func::RenderButtonImageWithBlending)();
return;
}
// the original ends this bound with `jl`, so 0x32 is inside it; written as
// `50 <` the `actionParam == 0x32` test below could never be true
if (50 <= actionParam) {
MACRO_CALL(
OpenSHC::UI::Rendering_Func::RenderCurrentNotActiveButtonWithPossibleAlphaTexOnCurrentSurfaceUnk)();
if (actionParam == 50) {
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(10,
(int)(DAT_ButtonX::instance + 18), (int)(DAT_ButtonY::instance + 16), OpenSHC::Text::TTA_LEFT,
OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE, 0);
return;
}
if (actionParam == 51) {
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(25,
(int)(DAT_ButtonX::instance + 15), (int)(DAT_ButtonY::instance + 16), OpenSHC::Text::TTA_LEFT,
OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE, 0);
return;
}
if (actionParam == 52) {
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(100,
(int)(DAT_ButtonX::instance + 12), (int)(DAT_ButtonY::instance + 16), OpenSHC::Text::TTA_LEFT,
OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE, 0);
return;
}
if (actionParam == 53) {
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(5,
(int)(DAT_ButtonX::instance + 21), (int)(DAT_ButtonY::instance + 16), OpenSHC::Text::TTA_LEFT,
OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE, 0);
return;
}
if (actionParam == 54) {
MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)(500,
(int)(DAT_ButtonX::instance + 11), (int)(DAT_ButtonY::instance + 16), OpenSHC::Text::TTA_LEFT,
OpenSHC::Rendering::Colors::COL_B8EEFB, 0, 17, FALSE, 0);
return;
}
}
}

}
}
}
Loading
Loading