class UISL_ModOptionsRegisterer extends UIScreenListener;

`include(QuickSoldierInfoWOTC/Src/ModConfigMenuAPI/MCM_API_Includes.uci)
`include(QuickSoldierInfoWOTC/Src/ModConfigMenuAPI/MCM_API_CfgHelpers.uci)

event OnInit(UIScreen Screen)
{
	local XGParamTag MenuTextParams;

	if (Screen.IsA('UIModOptionsMenu_ModOptionsMenu'))
	{
		if (Screen.IsA('UIModOptionsMenu_TacticalModOptionsMenu'))
		{
			MenuTextParams = new class'XGParamTag';
			MenuTextParams.StrValue0 = "Quick Soldier Info";
			MenuTextParams.StrValue1 = "QuickSoldierInfoWOTC.UIOptions_QuickSoldierInfoAdjust";

			`XEVENTMGR.TriggerEvent('ModOptionsMenu_AddItem', MenuTextParams,, none);
		}
	}
	else if (MCM_API(Screen) != none)
	{
		// Everything in here runs only when you need to touch MCM.
		`MCM_API_Register(Screen, ClientModCallback);
	}
}

simulated function ClientModCallback(MCM_API_Instance ConfigAPI, int GameMode)
{
    // Code goes here.
	if (eGameMode(GameMode) == eGameMode_Tactical)
	{
		ConfigAPI.NewCustomSettingsPage("Quick Soldier Info", OpenOptions);
	}
}

simulated function OpenOptions(UIScreen ParentScreen, int PageID)
{
	ParentScreen.Movie.Pres.ScreenStack.Push( ParentScreen.Movie.Pres.Spawn( class'UIOptions_QuickSoldierInfoAdjust', ParentScreen.Movie.Pres ), ParentScreen.Movie );
}