Skip to content

Commit

Permalink
fix: refactor ScreenListener out into its own class
Browse files Browse the repository at this point in the history
Previously, the MCM Settings page extended `UIScreenListener` itself.
While the settings page was picked up by ModConfigMenu, it crashed the
game when opening the mod settings in the Shell and then loading a saved
game.
  • Loading branch information
fearlessiron committed Jan 7, 2024
1 parent 993b577 commit a0f1b45
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class BlackMarketSoldierStats_MCM_ScreenListener extends UIScreenListener;

event OnInit (UIScreen Screen)
{
local BlackMarketSoldierStats_Settings MCMScreen;

if (ScreenClass == none)
{
if (MCM_API(Screen) != none)
{
ScreenClass = Screen.Class;
}
else
{
return;
}
}

MCMScreen = new class'BlackMarketSoldierStats_Settings';
MCMScreen.OnInit(Screen);
}

defaultproperties
{
ScreenClass = none;
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class BlackMarketSoldierStats_Settings extends UIScreenListener config(BlackMarketSoldierStats_Settings);
class BlackMarketSoldierStats_Settings extends Object config(BlackMarketSoldierStats_Settings);

// Mod version
const VERSION_MAJOR = 1;
Expand Down

0 comments on commit a0f1b45

Please sign in to comment.