//=============================================================================
// NaliWMHMenuPage.
//=============================================================================
class NaliWMHMenuPage expands UMenuPageWindow;


var UWindowEditControl MaxH, StartH, TimedInvInterval, ARegenPerSec, HRegenPerSec, ModifRespawn;
var UWindowCheckBox EMHMode, MHOnly, GiveRandWeap, bTimedInv, bMonPin, bRegenAmmo, bRegenHealth, bSpawnPSModif;
var UWindowEditControl Multi_WRE, Multi_Flame, Multi_Bolt, Multi_Grav, Multi_Freez, Multi_Vulcan, Multi_Miner;
var UWindowEditControl Multi_MML, Multi_IRPR, Multi_Cybot, Multi_SBolt;

function AfterCreate()
{
    Super.AfterCreate();

    DesiredWidth = 220;
    DesiredHeight = 550;
}

function Created()
{
	EMHMode = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 10, 270, 1));
	EMHMode.SetText("Enable Monster Hunt Mode");
	EMHMode.bChecked = class'NWMutator'.default.EnableMonsterHuntMode;

	MHOnly = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 30, 270, 1));
	MHOnly.SetText("Aplly on Monster Hunt games only");
	MHOnly.bChecked = class'NWMutator'.default.MonsterHuntOnly;

	StartH = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 60, 270, 1));
	StartH.SetText("Start Players Health");
	StartH.SetNumericOnly(True);
	StartH.SetNumericFloat(False);
	StartH.SetMaxLength(4);
	StartH.Align = TA_Left;
	StartH.SetValue(String(class'NWMutator'.default.StartHealth));
	StartH.EditBoxWidth = WinWidth / 8;

	MaxH = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 80, 270, 1));
	MaxH.SetText("Max Players Health");
	MaxH.SetNumericOnly(True);
	MaxH.SetNumericFloat(False);
	MaxH.SetMaxLength(4);
	MaxH.Align = TA_Left;
	MaxH.SetValue(String(class'NWMutator'.default.MaxHealth));
	MaxH.EditBoxWidth = WinWidth / 8;

	GiveRandWeap = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 100, 270, 1));
	GiveRandWeap.SetText("Give Random Weapon at Respawn");
	GiveRandWeap.bChecked = class'NWMutator'.default.GiveRandomWeaponOnRespawn;

	bTimedInv = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 115, 270, 1));
	bTimedInv.SetText("Enable Timed Random Inventory");
	bTimedInv.bChecked = class'NWMutator'.default.TimedRandomInventory;

	TimedInvInterval = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 135, 270, 1));
	TimedInvInterval.SetText("Timed Random Inventory Interval (seconds)");
	TimedInvInterval.SetNumericOnly(True);
	TimedInvInterval.SetNumericFloat(False);
	TimedInvInterval.SetMaxLength(3);
	TimedInvInterval.Align = TA_Left;
	TimedInvInterval.SetValue(String(class'NWMutator'.default.RandomInventoryIntervalSec));
	TimedInvInterval.EditBoxWidth = WinWidth / 8;

	bMonPin = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 155, 270, 1));
	bMonPin.SetText("Enable Monster Pinata");
	bMonPin.bChecked = class'NWMutator'.default.bMonsterPinata;

	bRegenAmmo = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 170, 270, 1));
	bRegenAmmo.SetText("Enable Ammunition Regeneration");
	bRegenAmmo.bChecked = class'NWMutator'.default.bRegenerateAmmo;

	ARegenPerSec = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 190, 270, 1));
	ARegenPerSec.SetText("Ammo Regeneration Amount (per second)");
	ARegenPerSec.SetNumericOnly(True);
	ARegenPerSec.SetNumericFloat(False);
	ARegenPerSec.SetMaxLength(2);
	ARegenPerSec.Align = TA_Left;
	ARegenPerSec.SetValue(String(class'NWMutator'.default.RegenAmmoPerSec));
	ARegenPerSec.EditBoxWidth = WinWidth / 8;

	bRegenHealth = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 205, 270, 1));
	bRegenHealth.SetText("Enable Health Regeneration");
	bRegenHealth.bChecked = class'NWMutator'.default.bRegenerateHealth;

	HRegenPerSec = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 225, 270, 1));
	HRegenPerSec.SetText("Health Regeneration Amount (per second)");
	HRegenPerSec.SetNumericOnly(True);
	HRegenPerSec.SetNumericFloat(False);
	HRegenPerSec.SetMaxLength(2);
	HRegenPerSec.Align = TA_Left;
	HRegenPerSec.SetValue(String(class'NWMutator'.default.RegenHealthPerSec));
	HRegenPerSec.EditBoxWidth = WinWidth / 8;

	ModifRespawn = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 260, 270, 1));
	ModifRespawn.SetText("Modifiers Respawn Time (seconds)");
	ModifRespawn.SetNumericOnly(True);
	ModifRespawn.SetNumericFloat(False);
	ModifRespawn.SetMaxLength(2);
	ModifRespawn.Align = TA_Left;
	ModifRespawn.SetValue(String(class'NWMutator'.default.ModifiersRespawnTimeSec));
	ModifRespawn.EditBoxWidth = WinWidth / 8;

	bSpawnPSModif = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 280, 270, 1));
	bSpawnPSModif.SetText("Enable Modifiers in Respawn Points");
	bSpawnPSModif.bChecked = class'NWMutator'.default.bEnableModifAtRespawnLoc;



	Multi_WRE = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 300, 270, 1));
	Multi_WRE.SetText("W.R.E. Ammo Multiplier");
	Multi_WRE.SetNumericOnly(True);
	Multi_WRE.SetNumericFloat(False);
	Multi_WRE.SetMaxLength(2);
	Multi_WRE.Align = TA_Left;
	Multi_WRE.SetValue(String(class'NWMutator'.default.ammo_WRE));
	Multi_WRE.EditBoxWidth = WinWidth / 8;

	Multi_Flame = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 320, 270, 1));
	Multi_Flame.SetText("Flame Tracker Ammo Multiplier");
	Multi_Flame.SetNumericOnly(True);
	Multi_Flame.SetNumericFloat(False);
	Multi_Flame.SetMaxLength(2);
	Multi_Flame.Align = TA_Left;
	Multi_Flame.SetValue(String(class'NWMutator'.default.ammo_FlameT));
	Multi_Flame.EditBoxWidth = WinWidth / 8;

	Multi_Bolt = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 340, 270, 1));
	Multi_Bolt.SetText("Bolt Rifle Ammo Multiplier");
	Multi_Bolt.SetNumericOnly(True);
	Multi_Bolt.SetNumericFloat(False);
	Multi_Bolt.SetMaxLength(2);
	Multi_Bolt.Align = TA_Left;
	Multi_Bolt.SetValue(String(class'NWMutator'.default.ammo_BoltR));
	Multi_Bolt.EditBoxWidth = WinWidth / 8;

	Multi_Grav = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 360, 270, 1));
	Multi_Grav.SetText("Graviton Ammo Multiplier");
	Multi_Grav.SetNumericOnly(True);
	Multi_Grav.SetNumericFloat(False);
	Multi_Grav.SetMaxLength(2);
	Multi_Grav.Align = TA_Left;
	Multi_Grav.SetValue(String(class'NWMutator'.default.ammo_Graviton));
	Multi_Grav.EditBoxWidth = WinWidth / 8;

	Multi_Freez = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 380, 270, 1));
	Multi_Freez.SetText("Freezer Ammo Multiplier");
	Multi_Freez.SetNumericOnly(True);
	Multi_Freez.SetNumericFloat(False);
	Multi_Freez.SetMaxLength(2);
	Multi_Freez.Align = TA_Left;
	Multi_Freez.SetValue(String(class'NWMutator'.default.ammo_Freezer));
	Multi_Freez.EditBoxWidth = WinWidth / 8;

	Multi_Vulcan = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 400, 270, 1));
	Multi_Vulcan.SetText("Vulcan Ammo Multiplier");
	Multi_Vulcan.SetNumericOnly(True);
	Multi_Vulcan.SetNumericFloat(False);
	Multi_Vulcan.SetMaxLength(2);
	Multi_Vulcan.Align = TA_Left;
	Multi_Vulcan.SetValue(String(class'NWMutator'.default.ammo_Vulcan));
	Multi_Vulcan.EditBoxWidth = WinWidth / 8;

	Multi_Miner = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 420, 270, 1));
	Multi_Miner.SetText("The Miner Ammo Multiplier");
	Multi_Miner.SetNumericOnly(True);
	Multi_Miner.SetNumericFloat(False);
	Multi_Miner.SetMaxLength(2);
	Multi_Miner.Align = TA_Left;
	Multi_Miner.SetValue(String(class'NWMutator'.default.ammo_TheMiner));
	Multi_Miner.EditBoxWidth = WinWidth / 8;

	Multi_MML = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 440, 270, 1));
	Multi_MML.SetText("MultiMissile Launcher Ammo Multiplier");
	Multi_MML.SetNumericOnly(True);
	Multi_MML.SetNumericFloat(False);
	Multi_MML.SetMaxLength(2);
	Multi_MML.Align = TA_Left;
	Multi_MML.SetValue(String(class'NWMutator'.default.ammo_MMLauncher));
	Multi_MML.EditBoxWidth = WinWidth / 8;

	Multi_IRPR = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 460, 270, 1));
	Multi_IRPR.SetText("I.R.P.R. Ammo Multiplier");
	Multi_IRPR.SetNumericOnly(True);
	Multi_IRPR.SetNumericFloat(False);
	Multi_IRPR.SetMaxLength(2);
	Multi_IRPR.Align = TA_Left;
	Multi_IRPR.SetValue(String(class'NWMutator'.default.ammo_IRPR));
	Multi_IRPR.EditBoxWidth = WinWidth / 8;

	Multi_Cybot = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 480, 270, 1));
	Multi_Cybot.SetText("Cybot Launcher Ammo Multiplier");
	Multi_Cybot.SetNumericOnly(True);
	Multi_Cybot.SetNumericFloat(False);
	Multi_Cybot.SetMaxLength(2);
	Multi_Cybot.Align = TA_Left;
	Multi_Cybot.SetValue(String(class'NWMutator'.default.ammo_Cybot));
	Multi_Cybot.EditBoxWidth = WinWidth / 8;

	Multi_SBolt = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 500, 270, 1));
	Multi_SBolt.SetText("Enhanced Bolt Rifle Ammo Multiplier");
	Multi_SBolt.SetNumericOnly(True);
	Multi_SBolt.SetNumericFloat(False);
	Multi_SBolt.SetMaxLength(2);
	Multi_SBolt.Align = TA_Left;
	Multi_SBolt.SetValue(String(class'NWMutator'.default.ammo_SBoltR));
	Multi_SBolt.EditBoxWidth = WinWidth / 8;

}



function Notify(UWindowDialogControl C, byte E)
{

	switch(E) {
		case DE_Change: // the message sent by sliders and checkboxes
			switch(C) 
			{

				case MaxH: 
					class'NWMutator'.default.MaxHealth = Int(MaxH.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case StartH: 
					class'NWMutator'.default.StartHealth = Int(StartH.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case TimedInvInterval: 
					class'NWMutator'.default.RandomInventoryIntervalSec = Int(TimedInvInterval.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case ARegenPerSec: 
					class'NWMutator'.default.RegenAmmoPerSec = Int(ARegenPerSec.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case HRegenPerSec: 
					class'NWMutator'.default.RegenHealthPerSec = Int(HRegenPerSec.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case ModifRespawn: 
					class'NWMutator'.default.ModifiersRespawnTimeSec = Int(ModifRespawn.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_WRE: 
					class'NWMutator'.default.ammo_WRE = Int(Multi_WRE.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_Flame: 
					class'NWMutator'.default.ammo_FlameT = Int(Multi_Flame.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_Bolt: 
					class'NWMutator'.default.ammo_BoltR = Int(Multi_Bolt.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_Grav: 
					class'NWMutator'.default.ammo_Graviton = Int(Multi_Grav.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_Freez: 
					class'NWMutator'.default.ammo_Freezer = Int(Multi_Freez.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_Vulcan: 
					class'NWMutator'.default.ammo_Vulcan = Int(Multi_Vulcan.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_Miner: 
					class'NWMutator'.default.ammo_TheMiner = Int(Multi_Miner.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_MML: 
					class'NWMutator'.default.ammo_MMLauncher = Int(Multi_MML.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_IRPR: 
					class'NWMutator'.default.ammo_IRPR = Int(Multi_IRPR.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_Cybot: 
					class'NWMutator'.default.ammo_Cybot = Int(Multi_Cybot.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case Multi_SBolt: 
					class'NWMutator'.default.ammo_SBoltR = Int(Multi_SBolt.GetValue());
					class'NWMutator'.static.StaticSaveConfig();
					break;



				case bSpawnPSModif:
					class'NWMutator'.default.bEnableModifAtRespawnLoc = bSpawnPSModif.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case EMHMode:
					class'NWMutator'.default.EnableMonsterHuntMode = EMHMode.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case MHOnly:
					class'NWMutator'.default.MonsterHuntOnly = MHOnly.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case GiveRandWeap:
					class'NWMutator'.default.GiveRandomWeaponOnRespawn = GiveRandWeap.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case bTimedInv:
					class'NWMutator'.default.TimedRandomInventory = bTimedInv.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case bMonPin:
					class'NWMutator'.default.bMonsterPinata = bMonPin.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case bRegenAmmo:
					class'NWMutator'.default.bRegenerateAmmo = bRegenAmmo.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;
				case bRegenHealth:
					class'NWMutator'.default.bRegenerateHealth = bRegenHealth.bChecked;
					class'NWMutator'.static.StaticSaveConfig();
					break;


			}				
		break;
	}
}


