XIDInterf
Class XIIIMsgBoxQuitGame

source: C:\XIII\XIDInterf\Classes\XIIIMsgBoxQuitGame.uc
Core.Object
   |
   +--GUI.GUI
      |
      +--GUI.GUIComponent
         |
         +--GUI.GUIMultiComponent
            |
            +--GUI.GUIPage
               |
               +--XIDInterf.XIIIWindow
                  |
                  +--XIDInterf.XIIIMsgBox
                     |
                     +--XIDInterf.XIIIMsgBoxQuitGame
Direct Known Subclasses:None

class XIIIMsgBoxQuitGame
extends XIDInterf.XIIIMsgBox

// ==================================================================== // (c) 2003 Ubi Soft. All Rights Reserved // ====================================================================
Variables
 int T
 bool bQuitGame
 sound hSoundConfirmQuitGame
 GUIComponent mySender

States
STA_QuitGame

Function Summary
 bool ButtonClick(GUIComponent Sender)
 void ReturnMsgBoxQuitGame()


State STA_QuitGame Function Summary
 bool InternalOnKeyEvent(out byte, out byte, float delta)



Source Code


00001	// ====================================================================
00002	//  (c) 2003 Ubi Soft.  All Rights Reserved
00003	// ====================================================================
00004	
00005	class XIIIMsgBoxQuitGame extends XIIIMsgBox;
00006	
00007	var int T;
00008	var sound hSoundConfirmQuitGame;
00009	var GUIComponent mySender;
00010	var bool bQuitGame;
00011	
00012	
00013	
00014	function ReturnMsgBoxQuitGame()
00015	{
00016		T = XIIIGUIButton(mySender).Tag;
00017		ParentPage.InactiveFadeColor=ParentPage.Default.InactiveFadeColor;
00018		Controller.CloseMenu(true);
00019		OnButtonClick(T);
00020	}
00021	
00022	function bool ButtonClick(GUIComponent Sender)
00023	{
00024		if ( XIIIGUIButton(Sender).Tag == QBTN_Yes )
00025		{
00026			GetPlayerOwner().PlayMenu(hSoundConfirmQuitGame);
00027			mySender = Sender;
00028			GotoState('STA_QuitGame');
00029			return true;
00030		}
00031		else
00032		{
00033			ReturnMsgBoxQuitGame();
00034		}
00035	}
00036	
00037	
00038	// little time to play end sound
00039	State STA_QuitGame
00040	{	
00041		event BeginState()
00042		{
00043			SetTimer(0.5,false);
00044		}
00045	
00046		function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
00047		{
00048			if ( bQuitGame )
00049			{
00050				return true;
00051			}
00052			else
00053			{
00054				bQuitGame = true;
00055				return Super.InternalOnKeyEvent(Key,State,delta);
00056			}
00057		}
00058	
00059		event Timer()
00060		{
00061			ReturnMsgBoxQuitGame();
00062		}
00063	}
00064	
00065	
00066	
00067	
00068	defaultproperties
00069	{
00070	     hSoundConfirmQuitGame=Sound'XIIIsound.Interface__AmbianceMenu.AmbianceMenu__hQuited'
00071	     Controls(0)=GUILabel'XIDInterf.XIIIMsgBox.TitleText'
00072	     Controls(1)=GUILabel'XIDInterf.XIIIMsgBox.lblQuestion'
00073	}

End Source Code