Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowClientWindow | +--UWindow.UWindowDialogClientWindow | +--UMenu.UMenuDialogClientWindow | +--UTMenu.KillGameQueryClient
UWindowSmallButton
NoButton
YesText,
NoText
UMenuLabelControl
QueryLabel
string
QueryText
int
SlotIndex
SlotWindow
YesButton
void
Created()
NoPressed()
Notify(UWindowDialogControl C, byte E)
Paint(Canvas C, float X, float Y)
Resized()
YesPressed()
00001 class KillGameQueryClient extends UMenuDialogClientWindow; 00002 00003 // Window 00004 var UMenuLabelControl QueryLabel; 00005 00006 var UWindowSmallButton YesButton; 00007 var UWindowSmallButton NoButton; 00008 00009 var localized string QueryText; 00010 var localized string YesText, NoText; 00011 00012 var SlotWindow SlotWindow; 00013 var int SlotIndex; 00014 00015 function Created() 00016 { 00017 GetPlayerOwner().SetPause( True ); 00018 00019 QueryLabel = UMenuLabelControl(CreateWindow(class'UMenuLabelControl', WinWidth+20, 0, WinWidth-40, 12)); 00020 QueryLabel.SetText(QueryText); 00021 00022 NoButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', WinWidth-56, WinHeight-24, 48, 16)); 00023 NoButton.SetText(NoText); 00024 YesButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', WinWidth-106, WinHeight-24, 48, 16)); 00025 YesButton.SetText(YesText); 00026 00027 Super.Created(); 00028 } 00029 00030 function Resized() 00031 { 00032 local int CenterWidth, CenterPos; 00033 00034 CenterWidth = (WinWidth/4)*3; 00035 CenterPos = (WinWidth - CenterWidth)/2; 00036 00037 QueryLabel.WinLeft = CenterPos; 00038 QueryLabel.SetSize(CenterWidth, QueryLabel.WinHeight); 00039 QueryLabel.WinTop = (WinHeight - QueryLabel.WinHeight)/2 - 11; 00040 00041 NoButton.WinLeft = WinWidth-52; 00042 NoButton.WinTop = WinHeight-20; 00043 YesButton.WinLeft = WinWidth-102; 00044 YesButton.WinTop = WinHeight-20; 00045 } 00046 00047 function Paint(Canvas C, float X, float Y) 00048 { 00049 local Texture T; 00050 00051 Super.Paint(C, X, Y); 00052 00053 T = GetLookAndFeelTexture(); 00054 00055 DrawUpBevel( C, 0, WinHeight-22, WinWidth, 22, T); 00056 } 00057 00058 function Notify(UWindowDialogControl C, byte E) 00059 { 00060 Super.Notify(C, E); 00061 00062 switch(E) 00063 { 00064 case DE_Click: 00065 switch (C) 00066 { 00067 case YesButton: 00068 YesPressed(); 00069 break; 00070 case NoButton: 00071 NoPressed(); 00072 break; 00073 } 00074 } 00075 } 00076 00077 function YesPressed() 00078 { 00079 if (SlotWindow != None) 00080 { 00081 SlotWindow.Saves[SlotIndex] = ""; 00082 SlotWindow.SaveConfig(); 00083 SlotWindow.SlotButton[SlotIndex].Text = class'SlotWindow'.Default.EmptyText; 00084 class'ManagerWindow'.Default.DOMDoorOpen[SlotIndex] = 0; 00085 class'ManagerWindow'.Default.CTFDoorOpen[SlotIndex] = 0; 00086 class'ManagerWindow'.Default.ASDoorOpen[SlotIndex] = 0; 00087 class'ManagerWindow'.Default.ChalDoorOpen[SlotIndex] = 0; 00088 class'ManagerWindow'.Default.TrophyDoorOpen[SlotIndex] = 0; 00089 class'ManagerWindow'.Static.StaticSaveConfig(); 00090 } 00091 00092 Close(); 00093 } 00094 00095 function NoPressed() 00096 { 00097 Close(); 00098 } 00099 00100 defaultproperties 00101 { 00102 QueryText="Are you sure you want to remove this save game?" 00103 YesText="Yes" 00104 NoText="No" 00105 }