Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
b4889c1
reimplement: SHC_3BB0A8C1_0x004348D0 50.2% 18 returns and the range t…
kotijekriv Nov 4, 2026
d18cf43
headers: GameCommandType value 103 as GCT_UNKNOWN_103
kotijekriv Nov 4, 2026
d9e82ff
headers: SoundEffectID value 253 as SEID_UNKNOWN_0xFD
kotijekriv Nov 4, 2026
de8c9f3
headers: DAT_00b95960, DAT_00b95f64 and DAT_00b95b74 are ints
kotijekriv Nov 4, 2026
908031b
headers: GameSynchronyState::chatScrollOffset is an int
kotijekriv Nov 4, 2026
cb601a0
reimplement: SHC_3BB0A8C1_0x00442640 90.7% one switch, 3 behaviour fi…
kotijekriv Nov 4, 2026
b88acae
strings: 0x005A55E0 "Pic"
kotijekriv Nov 4, 2026
55f7dba
reimplement: SHC_3BB0A8C1_0x0045DE40 91.5% switches in the original's…
kotijekriv Nov 4, 2026
4e89c8a
headers: SoundEffectID values 123-128 and 257 as SEID_UNKNOWN_<hex>
kotijekriv Nov 4, 2026
de6e584
reimplement: SHC_3BB0A8C1_0x00444B80 100.0% Reimplemented
kotijekriv Nov 4, 2026
2001534
reimplement: SHC_3BB0A8C1_0x004B9E50 88.0% arms in the original's ord…
kotijekriv Nov 4, 2026
59e1c30
headers: BuildingsAndStatusMenuTabType value 0 as BASMTT_NONE
kotijekriv Nov 4, 2026
1c0e578
headers: TileMapState's editor brush, brush half-size and affect type…
kotijekriv Nov 4, 2026
d6257a4
reimplement: SHC_3BB0A8C1_0x004314E0 83.4% one switch, no gotos; shar…
kotijekriv Nov 4, 2026
dc70c99
headers: SoundEffectID values 146 and 251 as SEID_UNKNOWN_<hex>
kotijekriv Nov 4, 2026
4cfd4b4
reimplement: SHC_3BB0A8C1_0x00428150 100.0% Reimplemented
kotijekriv Nov 4, 2026
9529bf1
reimplement: SHC_3BB0A8C1_0x004437E0 99.4% 1 behaviour fix; scheduling
kotijekriv Nov 4, 2026
296480f
headers: the tutorial step counters are ints
kotijekriv Nov 4, 2026
de80634
reimplement: SHC_3BB0A8C1_0x004C1070 88.0% cleanup; register allocation
kotijekriv Nov 4, 2026
4967da7
reimplement: SHC_3BB0A8C1_0x004BBA60 96.8% 1 behaviour fix; register …
kotijekriv Nov 4, 2026
9a43ae7
reimplement: SHC_3BB0A8C1_0x004BFA60 99.0% 2 behaviour fixes; registe…
kotijekriv Nov 4, 2026
a70deed
reimplement: SHC_3BB0A8C1_0x004B9C00 97.1% inner switch in the origin…
kotijekriv Nov 4, 2026
5389043
reimplement: SHC_3BB0A8C1_0x004BCEC0 97.7% speech file name as a fiel…
kotijekriv Nov 4, 2026
a557256
strings: 0x005A22D0 "Exit"
kotijekriv Nov 4, 2026
1ef3269
headers: GameCommandType value 112 as GCT_UNKNOWN_112
kotijekriv Nov 4, 2026
132a6f5
reimplement: SHC_3BB0A8C1_0x004AE7D0 100.0% Reimplemented
kotijekriv Nov 4, 2026
df4fad1
reimplement: SHC_3BB0A8C1_0x0042F140 100.0% Reimplemented
kotijekriv Nov 4, 2026
15de696
reimplement: SHC_3BB0A8C1_0x0042DE20 100.0% Reimplemented
kotijekriv Nov 4, 2026
90d1284
reimplement: SHC_3BB0A8C1_0x004255D0 98.7% cleanup; scheduling
kotijekriv Nov 4, 2026
8f88cf1
reimplement: SHC_3BB0A8C1_0x004BB570 98.4% cleanup; scheduling
kotijekriv Nov 4, 2026
4581585
reimplement: SHC_3BB0A8C1_0x004BB680 98.2% cleanup; scheduling
kotijekriv Nov 4, 2026
36d0a96
reimplement: SHC_3BB0A8C1_0x004BD0F0 97.9% cleanup; scheduling
kotijekriv Nov 4, 2026
8d25a1f
reimplement: SHC_3BB0A8C1_0x00491C50 97.7% cleanup; scheduling
kotijekriv Nov 4, 2026
197b9d4
reimplement: SHC_3BB0A8C1_0x004AC440 97.3% cleanup; scheduling
kotijekriv Nov 4, 2026
7c86afa
reimplement: SHC_3BB0A8C1_0x0042F7F0 100.0% Reimplemented, Security C…
kotijekriv Nov 4, 2026
1f65115
reimplement: SHC_3BB0A8C1_0x0042BF00 100.0% Reimplemented
kotijekriv Nov 4, 2026
d2eadc8
reimplement: SHC_3BB0A8C1_0x004ABEB0 94.5% one store for the map size…
kotijekriv Nov 4, 2026
5d5079f
headers: eTextSections value 0 as TEXT_UNKNOWN_0
kotijekriv Nov 4, 2026
bcf4d9b
reimplement: SHC_3BB0A8C1_0x00493850 100.0% Reimplemented
kotijekriv Nov 4, 2026
9cae306
reimplement: SHC_3BB0A8C1_0x00434120 89.9% cleanup; tail call
kotijekriv Nov 4, 2026
371aef6
reimplement: SHC_3BB0A8C1_0x0043A8E0 88.9% cleanup; register allocation
kotijekriv Nov 4, 2026
fcff9b3
headers: INT_00eb0e44 is a char
kotijekriv Nov 4, 2026
1016e7c
headers: DAT_00ec082c is an int
kotijekriv Nov 4, 2026
bf5f3bc
reimplement: SHC_3BB0A8C1_0x004D6BC0 100.0% Reimplemented
kotijekriv Nov 4, 2026
a9d58c6
Move three functions to the new ready branch
kotijekriv Nov 5, 2026
3c42c80
headers: drop the tutorial counters' int retype
kotijekriv Nov 5, 2026
77613ac
reimplement: SHC_3BB0A8C1_0x004B9C00 97.4% inner switch in the origin…
kotijekriv Nov 5, 2026
77b0f81
drop: the nine functions at 100% go to reimpl/UI-MenuItems-headers-100
kotijekriv Nov 5, 2026
09bca78
headers: drop the changes only the nine functions now in reimpl/UI-Me…
kotijekriv Nov 5, 2026
516cbc6
headers: ColorsEnum gets the colours our menus and displays use
kotijekriv Nov 5, 2026
446f9fa
style: colours by their ColorsEnum name
kotijekriv Nov 5, 2026
b7d09c0
Move AvailablePeasantsTextUpperRight to the ready PR
kotijekriv Nov 5, 2026
e296264
Merge origin/main 948dce845 (countof() for array loop bounds)
kotijekriv Nov 5, 2026
1918de9
Loop bounds by countof(), as main's 948dce845
kotijekriv Nov 5, 2026
14b584f
drop: 0x004314E0 goes to reimpl/UI-MenuItems-6-100
kotijekriv Nov 5, 2026
b0a3028
headers: drop the TileMapState change only 0x004314E0 used
kotijekriv Nov 5, 2026
0c45e57
Merge origin/main 72b27322e (upstream ghidra changes, #332, #334, #335)
kotijekriv Nov 5, 2026
c1c152b
drafts: move five text buttons to the 100% PR
kotijekriv Nov 6, 2026
3687746
Merge origin/main 7621d4f1d (upstream ghidra changes)
kotijekriv Nov 6, 2026
636a731
drafts: move 0x00434120 InGameMenu_Scrolling to the 100% PR
kotijekriv Nov 6, 2026
8504e3a
drafts: move 0x004C1070 and 0x004ABEB0 to the 100% PR
kotijekriv Nov 6, 2026
2478351
Merge main (eef6f667a, gynt's header sync) into reimpl/UI-MenuItems-3…
kotijekriv Nov 7, 2026
f9f94dc
Merge main (e32319b21, gynt's header sync) into reimpl/UI-MenuItems-3…
kotijekriv Nov 7, 2026
bddd6be
style: scenario event types by their ScenarioEventType names
kotijekriv Nov 8, 2026
0b412b2
Merge main (03827fa2b) into reimpl/UI-MenuItems-3-development
kotijekriv Nov 8, 2026
644c9ab
fix: pass the slider callback as main's NoArgCallback*
kotijekriv Nov 8, 2026
fba4a22
drafts: move 0x004BBA60 General_CreateEventCallbackFunction to the ro…
kotijekriv Nov 13, 2026
2da7d39
drafts: move 0x004255D0 to the round 13 PR
kotijekriv Nov 14, 2026
42e6f42
Merge origin/main (e086ba7c3) into reimpl/UI-MenuItems-3-development
kotijekriv Nov 17, 2026
8233678
fix: UnitSelectionAndControlsUnk builds against main's Building::targ…
kotijekriv Nov 17, 2026
020b8de
style: TextEditor Buttons render uses the s_ string pointers
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
#include "../General.func.hpp"

#include "OpenSHC/Game/ScenarioEvents/Enums/ScenarioEventType.hpp"

#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp"

namespace OpenSHC {
namespace UI {
namespace MenuItems {

// FUNCTION: STRONGHOLDCRUSADER 0x004B9E50
void General::MenuItemActionHandler_General_EventSlider(
int param_1, int param_2, int* minValue, int* maxValue, int* currentValue)
{
int iVar1 = 0;
switch (param_1) {
case 5:
iVar1 = 10;
break;
case 12:
case 18:
iVar1 = 5;
break;
case 19:
case 21:
iVar1 = 20;
break;
case -10:
iVar1 = (*(int*)&DAT_MapPropertiesState::instance.invasionEventContent.padding_0xa4[0]);
break;
case -9:
case -8:
case -7:
case -6:
case -5:
case -4:
case -3:
case -2:
case -1:
case 0:
case 1:
case 2:
case 3:
case 4:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 13:
case 14:
case 15:
case 16:
case 17:
case 20:
break;
default:
break;
}
switch (param_1) {
case -1:
switch (DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.ScenarioEventType) {
case OpenSHC::Game::ScenarioEvents::Enums::SET_TRAVELING_FAIR:
case OpenSHC::Game::ScenarioEvents::Enums::SET_PLAGUE:
case OpenSHC::Game::ScenarioEvents::Enums::SET_WHEAT_DISEASE:
case OpenSHC::Game::ScenarioEvents::Enums::SET_HOPS_WEEVIL:
case OpenSHC::Game::ScenarioEvents::Enums::SET_APPLE_BLIGHT:
case OpenSHC::Game::ScenarioEvents::Enums::SET_TREE_FUNGUS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_RABBIT_EXPLOSION:
case OpenSHC::Game::ScenarioEvents::Enums::SET_LION_ATTACK:
case OpenSHC::Game::ScenarioEvents::Enums::SET_BANDITS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_MAD_COWS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_ARCHERS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_THEFT_FROM_GRANARY:
case OpenSHC::Game::ScenarioEvents::Enums::SET_FIRE:
switch (param_2) {
case 1:
*minValue = 0;
*maxValue = 60;
*currentValue = (uint)DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeat;
return;
case 2:
case 3:
*minValue = 0;
DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeat = (byte)*currentValue;
return;
case 4:
*currentValue = (uint)DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeat;
*minValue = 0;
*maxValue = 60;
if (*currentValue > 60) {
*currentValue = 60;
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeat = (byte)*maxValue;
}
if (*currentValue < *minValue) {
*currentValue = *minValue;
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeat = (byte)*minValue;
}
break;
case 7:
*currentValue = 1;
break;
}
}
break;
case -2:
switch (DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.ScenarioEventType) {
case OpenSHC::Game::ScenarioEvents::Enums::SET_TRAVELING_FAIR:
case OpenSHC::Game::ScenarioEvents::Enums::SET_PLAGUE:
case OpenSHC::Game::ScenarioEvents::Enums::SET_WHEAT_DISEASE:
case OpenSHC::Game::ScenarioEvents::Enums::SET_HOPS_WEEVIL:
case OpenSHC::Game::ScenarioEvents::Enums::SET_APPLE_BLIGHT:
case OpenSHC::Game::ScenarioEvents::Enums::SET_TREE_FUNGUS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_RABBIT_EXPLOSION:
case OpenSHC::Game::ScenarioEvents::Enums::SET_LION_ATTACK:
case OpenSHC::Game::ScenarioEvents::Enums::SET_BANDITS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_MAD_COWS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_ARCHERS:
case OpenSHC::Game::ScenarioEvents::Enums::SET_THEFT_FROM_GRANARY:
case OpenSHC::Game::ScenarioEvents::Enums::SET_FIRE:
switch (param_2) {
case 1:
*minValue = 1;
*maxValue = 10;
*currentValue = (uint)DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeatMonths;
return;
case 2:
case 3:
*minValue = 1;
DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeatMonths = (byte)*currentValue;
return;
case 7:
*currentValue = 1;
break;
case 4:
*currentValue = (uint)DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeatMonths;
*minValue = 1;
*maxValue = 10;
if (*currentValue > 10) {
*currentValue = 10;
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeatMonths = (byte)*maxValue;
}
if (*currentValue < *minValue) {
*currentValue = *minValue;
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.repeatMonths = (byte)*minValue;
}
break;
}
}
break;
case 5:
case 12:
case 18:
case 19:
case 21:
if (DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.ScenarioEventType
== param_1 - 1) {
switch (param_2) {
case 1:
*minValue = 1;
*maxValue = iVar1;
*currentValue = DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData;
return;
case 2:
case 3:
*minValue = 1;
DAT_MapPropertiesState::instance.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData = *currentValue;
return;
case 4:
*currentValue = DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData;
*minValue = 1;
*maxValue = iVar1;
if (iVar1 < *currentValue) {
*currentValue = iVar1;
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData = *maxValue;
}
if (*currentValue < *minValue) {
*currentValue = *minValue;
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData = *minValue;
}
break;
case 5:
iVar1 = DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData;
if (iVar1 < *maxValue) {
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData = iVar1 + 1;
}
*currentValue = DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData;
return;
case 6:
iVar1 = DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData;
if (iVar1 > 0) {
DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData = iVar1 - 1;
}
*currentValue = DAT_MapPropertiesState::instance
.scenarioEvents[DAT_MapPropertiesState::instance.currentEventID]
.data.scenario.actionData;
}
}
break;
case -10:
switch (param_2) {
case 1:
*minValue = 1;
*maxValue = iVar1;
*currentValue = DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8;
return;
case 2:
case 3:
*minValue = 1;
DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8 = *currentValue;
return;
case 4:
*currentValue = DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8;
*minValue = 1;
*maxValue = iVar1;
if (iVar1 < *currentValue) {
*currentValue = iVar1;
DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8 = *maxValue;
}
if (*currentValue < *minValue) {
*currentValue = *minValue;
DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8 = *minValue;
}
break;
case 5:
if (DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8 < *maxValue) {
++DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8;
}
*currentValue = DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8;
return;
case 6:
if (DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8 > 0) {
--DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8;
}
*currentValue = DAT_MapPropertiesState::instance.invasionEventContent.field_0xa8;
}
break;
case -9:
case -8:
case -7:
case -6:
case -5:
case -4:
case -3:
case 0:
case 1:
case 2:
case 3:
case 4:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 13:
case 14:
case 15:
case 16:
case 17:
case 20:
break;
default:
break;
}
}

}
}
}
Loading
Loading