//=============================================================================
// NXMiscMenuPage.
//=============================================================================
class NXMiscMenuPage expands UMenuPageWindow;

var UWindowCheckBox bKongNeverStay, bForcePuff, bShowK, bInvTele, bLockWarn;
var UWindowEditControl AntiCheckR, SeekCheckR, CustomRT, WarnRad, ShockSize;

function AfterCreate()
{
    Super.AfterCreate();

    DesiredWidth = 220;
    DesiredHeight = 290;
}

function Created()
{
	AntiCheckR = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 10, 270, 1));
	AntiCheckR.SetText("Nuclear Missile Seeking Check Radius");
	AntiCheckR.SetNumericOnly(True);
	AntiCheckR.SetNumericFloat(False);
	AntiCheckR.SetMaxLength(5);
	AntiCheckR.Align = TA_Left;
	AntiCheckR.SetValue(String(class'AntiSlv'.default.CheckRadius));
	AntiCheckR.EditBoxWidth = WinWidth / 8;

	SeekCheckR = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 30, 270, 1));
	SeekCheckR.SetText("Seek Missile Seeking Check Radius");
	SeekCheckR.SetNumericOnly(True);
	SeekCheckR.SetNumericFloat(False);
	SeekCheckR.SetMaxLength(5);
	SeekCheckR.Align = TA_Left;
	SeekCheckR.SetValue(String(class'CarriedMissile'.default.CheckRadius));
	SeekCheckR.EditBoxWidth = WinWidth / 8;

	bKongNeverStay = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 60, 270, 1));
	bKongNeverStay.SetText("Launcher Never Stays");
	bKongNeverStay.bChecked = class'Konglauncher'.default.bNeverStay;

	bForcePuff = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 80, 270, 1));
	bForcePuff.SetText("Force Launcher puff release");
	bForcePuff.bChecked = class'Konglauncher'.default.bForceLaunchPuff;

	CustomRT = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 100, 270, 1));
	CustomRT.SetText("Launcher Respawn Time");
	CustomRT.SetNumericOnly(True);
	CustomRT.SetNumericFloat(False);
	CustomRT.SetMaxLength(3);
	CustomRT.Align = TA_Left;
	CustomRT.SetValue(String(Int(class'Konglauncher'.default.CustomRespawnTime)));
	CustomRT.EditBoxWidth = WinWidth / 8;

	bShowK = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 130, 270, 1));
	bShowK.SetText("Show keys initially (on launch)");
	bShowK.bChecked = class'SLHUD'.default.bShowKeys;

	bInvTele = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 160, 270, 1));
	bInvTele.SetText("Invert Jet Teleport Direction");
	bInvTele.bChecked = class'StrangeShell'.default.bInvertTeleport;

	bLockWarn = UWindowCheckBox(CreateControl(class'UWindowCheckBox', 10, 190, 270, 1));
	bLockWarn.SetText("Enable Locked Missile Warning Message");
	bLockWarn.bChecked = class'StrangeShell'.default.bLockedMissileWarning;

	WarnRad = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 210, 270, 1));
	WarnRad.SetText("Locked Missile Warning Detection Radius");
	WarnRad.SetNumericOnly(True);
	WarnRad.SetNumericFloat(False);
	WarnRad.SetMaxLength(4);
	WarnRad.Align = TA_Left;
	WarnRad.SetValue(String(class'StrangeShell'.default.MissileWarnRadius));
	WarnRad.EditBoxWidth = WinWidth / 8;

	ShockSize = UWindowEditControl(CreateControl(class'UWindowEditControl', 10, 240, 270, 1));
	ShockSize.SetText("Shockwave Size Multiplier");
	ShockSize.SetNumericOnly(True);
	ShockSize.SetNumericFloat(False);
	ShockSize.SetMaxLength(2);
	ShockSize.Align = TA_Left;
	ShockSize.SetValue(String(Int(class'StrangeWave'.default.shockMult)));
	ShockSize.EditBoxWidth = WinWidth / 8;
}



function Notify(UWindowDialogControl C, byte E)
{

	switch(E) {
		case DE_Change: // the message sent by sliders and checkboxes
			switch(C) 
			{
				case bKongNeverStay:
					class'Konglauncher'.default.bNeverStay = bKongNeverStay.bChecked;
					class'Konglauncher'.static.StaticSaveConfig();
					break;
				case bForcePuff:
					class'Konglauncher'.default.bForceLaunchPuff = bForcePuff.bChecked;
					class'Konglauncher'.static.StaticSaveConfig();
					break;
				case bShowK:
					class'SLHUD'.default.bShowKeys = bShowK.bChecked;
					class'SLHUD'.static.StaticSaveConfig();
					break;
				case bInvTele:
					class'StrangeShell'.default.bInvertTeleport = bInvTele.bChecked;
					class'StrangeShell'.static.StaticSaveConfig();
					break;
				case bLockWarn:
					class'StrangeShell'.default.bLockedMissileWarning = bLockWarn.bChecked;
					class'StrangeShell'.static.StaticSaveConfig();
					break;


				
				case AntiCheckR:
					class'AntiSlv'.default.CheckRadius = Int(AntiCheckR.GetValue());
					class'AntiSlv'.static.StaticSaveConfig();
					break;
				case SeekCheckR:
					class'CarriedMissile'.default.CheckRadius = Int(SeekCheckR.GetValue());
					class'CarriedMissile'.static.StaticSaveConfig();
					break;
				case CustomRT:
					class'Konglauncher'.default.CustomRespawnTime = Int(CustomRT.GetValue());
					class'Konglauncher'.static.StaticSaveConfig();
					break;
				case WarnRad:
					class'StrangeShell'.default.MissileWarnRadius = Int(WarnRad.GetValue());
					class'StrangeShell'.static.StaticSaveConfig();
					break;
				case ShockSize:
					class'StrangeWave'.default.shockMult = Int(ShockSize.GetValue());
					class'StrangeWave'.static.StaticSaveConfig();
					break;
			}				
		break;
	}
}


