## GUI
Class GUIController

source: C:\XIII\GUI\Classes\GUIController.uc

    Core.Object
       |
       +--Engine.Interactions
          |
          +--Engine.Interaction
             |
             +--Engine.BaseGUIController
                |
                +--GUI.GUIController

Direct Known Subclasses:XIIIRootWindow

class GUIController
extends Engine.BaseGUIController

    // ====================================================================
    //  (c) 2002, Epic Games, Inc.  All Rights Reserved
    // ====================================================================

Variables
`bool` | `CableDisconnected` true if the profile has been selected (in that case, the first menu is not XIIISelectProfile but XIIMenu
`float` | `DelayOfInactivityBeforeCallingTimeOut` after this delay (in seconds), with no input from the user, the event NoInputTimeOut() is called
`Array` | `FontStack` Holds all the possible fonts
`float` | `MenuMouseSens` true if the profile has been selected (in that case, the first menu is not XIIISelectProfile but XIIMenu
`Array` | `MouseCursorOffset` Only X,Y used, between 0 and 1. 'Hot Spot' of cursor material.
`Array` | `MouseCursors` Holds a list of all possible mouse
`Array` | `StyleStack` Holds all of the possible styles
`float` | `TimeOfLastInput` date when the last user input occurred
`bool` | `TimeOutArmed` if true, the time out system is armed. When NoInputTimeOut() is called, the system is automatically disarmed. Use SetInputTimeOut() to re-arm it needed
`VideoPlayer` | `VP` Used to play videos
`bool` | `bContinueWithoutSaving` true if the user hasn't selected/created a profile and still want to play; no save possible
`bool` | `bLoadingPossible` false means no media. Not redundant with previous one.
`bool` | `bProfileSelected` true if the profile has been selected (in that case, the first menu is not XIIISelectProfile but XIIMenu
`bool` | `bSavingPossible` false means no media. Not redundant with previous one.
`XIIIMenuData` | `myMenuData` Only X,Y used, between 0 and 1. 'Hot Spot' of cursor material.

Function Summary
`bool` | `DoesMemoryCardIncludeThisProfile(out int)`
`bool` | `EndOfPressStartPage()`
    // To tell if we are leaving the press start menu page
`int` | `GetConnectionStatus(out string)`
    // To correctly handle the connection request to a distant server
`string` | `GetCurrentRes()`
    // Find a style on the stack
`void` | `GetDefaultDescription(out string)`
    // default = false
`string` | `GetMainMenuClass()`
    // Returns the current res as a string
`int` | `GetMaxNumberOfSavingSlots()`
`string` | `GetXIIIEngineVersion()`
    // init static classes
`bool` | `HasMemoryCardBeenChanged()`
    // Allows to waits for the OTE_Nothing state (in case something else is being processed)
`bool` | `HasMouseMoved()`
`string` | `InitController()`
    // Returns GameEngine.MainMenuClass
`void` | `InitStateFrame(Object object)`
    // To allow menu pages to have state code, call this function
`bool` | `InternalMenuInit(GUIPage NewMenu, optional bool, optional string, optional string)`
`bool` | `IsCreateProfileFinished(out int)`
`bool` | `IsEraseSlotFinished(out int)`
`bool` | `IsGetSlotContentDateAndTimeFinished(out int, out int, out Byte, out Byte, out Byte, out Byte)`
`bool` | `IsGetSlotContentDescriptionFinished(out int, out string)`
`bool` | `IsMemoryCardReady()`
`bool` | `IsReadSlotFinished(out int)`
`bool` | `IsReadUserConfigFinished(out int)`
`bool` | `IsSavingMediaAvailable()`
    // Interface to the save game device
`bool` | `IsSlotEmptyFinished(out int, out INT)`
`bool` | `IsThereACheckpoint()`
`bool` | `IsUseProfileFinished(out int)`
`bool` | `IsWriteSlotFinished(out int)`
`bool` | `IsWriteUserConfigFinished(out int)`
`bool` | `LoadAtCheckpoint(optional bool)`
`void` | `LoadIngameMenu()`
`void` | `LoadMainMenu()`
`bool` | `OpenMenu(string NewMenuName, optional bool, optional string, optional string)`
    // ================================================
    // OpenMenuXXXXX - Opens a new menu and places it on the stack
    // if bReplace == false, places it on top; if bReplace == true, replace the stack top element
`void` | `RebootToDashboardFromScripts(int _iWhereToGo, int param1, int param2)`
    // to reboot correctly on XBox, do nothing on other plateforms
`bool` | `RequestCreateProfile(string UserName)`
`bool` | `RequestEraseSlot(int SlotNumber)`
`bool` | `RequestGetProfileList()`
    // The engine HAS TO be the one who detects that. Not the menu *MUST BE CALLED ONLY ONCE BY FRAME* only in RootWindow !
`bool` | `RequestGetSlotContentDateAndTime(int SlotNumber)`
`bool` | `RequestGetSlotContentDescription(int SlotNumber)`
`bool` | `RequestIsSlotEmpty(int SlotNumber)`
`bool` | `RequestReadSlot(int SlotNumber)`
`bool` | `RequestReadUserConfig()`
`bool` | `RequestUseProfile(string UserName)`
`bool` | `RequestWriteSlot(int SlotNumber, optional string, optional bool)`
`bool` | `RequestWriteUserConfig()`
`void` | `ResetFocus()`
`void` | `ResetKeyboard()`
`void` | `SetControllerStatus(bool On)`
`void` | `SetInputTimeOut(bool Arm, optional float)`
    // To arm/disarm the time out when user input is lacking. Also used to modify the delay.
`bool` | `SetMemoryCardActivation(int OnOff)`
    // The engine HAS TO be the one who detects that. Not the menu *MUST BE CALLED ONLY ONCE BY FRAME* only in RootWindow !
`bool` | `StartNewCheckOnMemoryCardForThisProfile(out int, string UserName)`
`GUIPage` | `TopPage()`

Source Code

    00001	// ====================================================================
    00002	//  (c) 2002, Epic Games, Inc.  All Rights Reserved
    00003	// ====================================================================
    00004
    00005	class GUIController extends BaseGUIController
    00006			native;
    00007
    00008	var	editinline export	array<GUIPage>		MenuStack;			// Holds the stack of menus
    00009	var						GUIPage				ActivePage;			// Points to the currently active page
    00010	var editinline 			Array<GUIFont>		FontStack;			// Holds all the possible fonts
    00011	var 					Array<GUIStyles>	StyleStack;			// Holds all of the possible styles
    00012	var						Array<string>		StyleNames;			// Holds the name of all styles to use
    00013	var editinline 			Array<Material>		MouseCursors;		// Holds a list of all possible mouse
    00014	var editinline			Array<vector>		MouseCursorOffset;  // Only X,Y used, between 0 and 1. 'Hot Spot' of cursor material.
    00015	var transient			XIIIMenuData		myMenuData;
    00016
    00017	var                     bool                bContinueWithoutSaving; // true if the user hasn't selected/created a profile and still want to play; no save possible
    00018	var                     bool                bSavingPossible; // false means no media. Not redundant with previous one.
    00019	var                     bool                bLoadingPossible; // false means no media. Not redundant with previous one.
    00020	var                     bool                bProfileSelected; // true if the profile has been selected (in that case, the first menu is not XIIISelectProfile but XIIMenu
    00021
    00022	var						int					MouseX,MouseY;		// Where is the mouse currently located
    00023	var						int					LastMouseX, LastMouseY;
    00024	var						bool				ShiftPressed;		// Shift key is being held
    00025	var						bool				AltPressed;			// Alt key is being held
    00026	var						bool				CtrlPressed;		// Ctrl key is being held
    00027	var                     bool                CableDisconnected;
    00028
    00029	var						float				DblClickWindow;			// How long do you have for a double click
    00030	var						float				LastClickTime;			// When did the last click occur
    00031	var						int					LastClickX,LastClickY;	// Who was the active component
    00032
    00033	var						float				ButtonRepeatDelay;		// The amount of delay for faking button repeats
    00034	var						byte     			RepeatKey;				// Used to determine what should repeat
    00035	var						float				RepeatDelta; 			// Data var
    00036	var						float				RepeatTime;				// How long until the next repeat;
    00037	var						float				CursorFade;				// How visible is the cursor
    00038	var						int					CursorStep;				// Are we fading in or out
    00039
    00040	var						float				FastCursorFade;			// How visible is the cursor
    00041	var						int					FastCursorStep;			// Are we fading in or out
    00042
    00043	var						GUIComponent		FocusedControl;			// Top most Focused control
    00044	var						GUIComponent 		ActiveControl;			// Which control is currently active
    00045	var						GUIComponent		SkipControl;			// This control should be skipped over and drawn at the end
    00046	var						GUIComponent		MoveControl;			// Used for visual design
    00047
    00048	var						bool				bIgnoreNextRelease;				// Used to make sure discard errant releases.
    00049
    00050	var						bool				bHighlightCurrent;		// Highlight the current control being edited
    00051
    00052
    00053	var						bool				bCurMenuInitialized;	// Has the current Menu Finished initialization
    00054
    00055	var						string				GameResolution;
    00056	var config				float				MenuMouseSens;
    00057
    00058	var						bool				MainNotWanted;			// Set to true if you don't want main to appear.
    00059
    00060	// Sounds
    00061	var						sound				MouseOverSound;
    00062	var						sound				ClickSound;
    00063	var						sound				EditSound;
    00064	var						sound				UpSound;
    00065	var						sound				DownSound;
    00066
    00067	var						bool				bForceMouseCheck;		// HACK
    00068	var						bool				bIgnoreUntilPress;		// HACK
    00069
    00070	// no user input: time out management (to launch video...)
    00071	var const               bool                TimeOutArmed;                               // if true, the time out system is armed. When NoInputTimeOut() is called, the system is automatically disarmed. Use SetInputTimeOut() to re-arm it needed
    00072	var                     float               DelayOfInactivityBeforeCallingTimeOut;      // after this delay (in seconds), with no input from the user, the event NoInputTimeOut() is called
    00073	var const               float               TimeOfLastInput;                            // date when the last user input occurred
    00074
    00075
    00076	var	Material	DefaultPens[2]; 	// Contain to hold some default pens for drawing purposes
    00077
    00078
    00079	var VideoPlayer VP;   // Used to play videos
    00080	var(StartMap)  string    URL;
    00081
    00082	native event GUIFont GetMenuFont(string FontName); 	// Finds a given font in the FontStack
    00083	native event GUIStyles GetStyle(string StyleName); 	// Find a style on the stack
    00084	native function string GetCurrentRes();				// Returns the current res as a string
    00085	native function string GetMainMenuClass();			// Returns GameEngine.MainMenuClass
    00086
    00087	native function string InitController();			// init static classes
    00088
    00089	native function string GetXIIIEngineVersion();
    00090
    00091	native function ResetKeyboard();
    00092
    00093	// to reboot correctly on XBox, do nothing on other plateforms
    00094	native static final function RebootToDashboardFromScripts(int _iWhereToGo, int param1, int param2);
    00095
    00096
    00097	// To allow menu pages to have state code, call this function
    00098	native static final function InitStateFrame(Object object);
    00099
    00100	// Interface to the save game device
    00101	native static final function bool IsSavingMediaAvailable();
    00102
    00103	native static final function bool RequestCreateProfile(string UserName);
    00104	native static final function bool IsCreateProfileFinished(out int ReturnCode);
    00105
    00106	native static final function bool RequestUseProfile(string UserName);
    00107	native static final function bool IsUseProfileFinished(out int ReturnCode);
    00108
    00109	native static final function bool DoesMemoryCardIncludeThisProfile(out int ReturnCode);
    00110	native static final function bool StartNewCheckOnMemoryCardForThisProfile(out int ReturnCode, string UserName);
    00111
    00112	native static final function bool IsMemoryCardReady();					// Allows to waits for the OTE_Nothing state (in case something else is being processed)
    00113	native static final function bool HasMemoryCardBeenChanged();			// The engine HAS TO be the one who detects that. Not the menu *MUST BE CALLED ONLY ONCE BY FRAME* only in RootWindow !
    00114	native static final function bool SetMemoryCardActivation(int OnOff);	// The engine HAS TO be the one who detects that. Not the menu *MUST BE CALLED ONLY ONCE BY FRAME* only in RootWindow !
    00115
    00116
    00117	native static final function bool RequestGetProfileList();
    00118	native static final function bool IsGetProfileListFinished(out int ReturnCode, out array<string> Profile);
    00119
    00120	native static final function bool IsThereACheckpoint();
    00121	native static final function bool LoadAtCheckpoint(optional bool ForceLoadAtMapStart);      // default = false
    00122	native static final function GetDefaultDescription(out string Description);
    00123
    00124	native static final function int GetMaxNumberOfSavingSlots();
    00125
    00126	native static final function bool RequestIsSlotEmpty(int SlotNumber);
    00127	native static final function bool IsSlotEmptyFinished(out int ReturnCode, out INT IsEmpty);
    00128
    00129	native static final function bool RequestGetSlotContentDescription(int SlotNumber);
    00130	native static final function bool IsGetSlotContentDescriptionFinished(out int ReturnCode, out string Description);
    00131
    00132	native static final function bool RequestGetSlotContentDateAndTime(int SlotNumber);
    00133	native static final function bool IsGetSlotContentDateAndTimeFinished(out int ReturnCode, out int Year, out Byte Month, out Byte Day, out Byte Hour, out Byte Min );
    00134
    00135	native static final function bool RequestEraseSlot(int SlotNumber);
    00136	native static final function bool IsEraseSlotFinished(out int ReturnCode);
    00137
    00138	native static final function bool RequestReadSlot(int SlotNumber);
    00139	native static final function bool IsReadSlotFinished(out int ReturnCode);
    00140
    00141	native static final function bool RequestWriteSlot(int SlotNumber, optional string ContentDescription, optional bool bAtLastCheckpoint);
    00142	native static final function bool IsWriteSlotFinished(out int ReturnCode);
    00143
    00144	native static final function bool RequestReadUserConfig();
    00145	native static final function bool IsReadUserConfigFinished(out int ReturnCode);
    00146
    00147	native static final function bool RequestWriteUserConfig();
    00148	native static final function bool IsWriteUserConfigFinished(out int ReturnCode);
    00149
    00150
    00151	// To tell if we are leaving the press start menu page
    00152	native static final function bool EndOfPressStartPage();
    00153
    00154	// To arm/disarm the time out when user input is lacking. Also used to modify the delay.
    00155	native static final function SetInputTimeOut(bool Arm, optional float DelayBeforeTimeOut);
    00156
    00157
    00158
    00159	// To correctly handle the connection request to a distant server
    00160	native static final function int GetConnectionStatus(out string ErrorMsg);
    00161
    00162
    00163
    00164
    00165	delegate bool OnNeedRawKeyPress(byte NewKey);
    00166
    00167
    00168
    00169
    00170
    00171	// ================================================
    00172	// OpenMenuXXXXX - Opens a new menu and places it on the stack
    00173	// if bReplace == false, places it on top; if bReplace == true, replace the stack top element
    00174	function bool OpenMenu(string NewMenuName, optional bool bReplace, optional string Param1, optional string Param2)
    00175	{
    00176		local int CorrectIdx, i;
    00177	    CorrectIdx = -1;
    00178
    00179	    // if in main menu, page is in main menu array
    00180	    // -> CAREFUL : if pages are in both, initialize them two times.
    00181		if (myMenuData.bMainMenuLoaded)
    00182		{
    00183			for(i=0; i<myMenuData.XIIIMenuStackStrings.Length; i++)
    00184			{
    00185				if( myMenuData.XIIIMenuStackStrings[i] == NewMenuName )
    00186				{
    00187					CorrectIdx = i;
    00188					break;
    00189				}
    00190			}
    00191	        if (CorrectIdx < 0)
    00192	        {
    00193	            log("MENU FAILURE menu page class not found : "@NewMenuName);
    00194	            return false;
    00195	        }
    00196	        else
    00197			    return OpenMenuWithClass(myMenuData.XIIIMenuStack[CorrectIdx].ClassObj, bReplace, Param1, Param2);
    00198		}
    00199		else// always the case, ingame menu is not unloaded if (myMenuData.bIngameMenuLoaded)
    00200		{
    00201			for(i=0; i<myMenuData.XIIIIngameMenuStackStrings.Length; i++)
    00202			{
    00203				if( myMenuData.XIIIIngameMenuStackStrings[i] == NewMenuName )
    00204				{
    00205					CorrectIdx = i;
    00206					break;
    00207				}
    00208			}
    00209	        if (CorrectIdx < 0)
    00210	        {
    00211	            log("MENU FAILURE menu page class not found : "@NewMenuName);
    00212	            return false;
    00213	        }
    00214	        else
    00215	    		return OpenMenuWithClass(myMenuData.XIIIIngameMenuStack[CorrectIdx].ClassObj, bReplace, Param1, Param2);
    00216		}
    00217	}
    00218
    00219
    00220	function LoadMainMenu()
    00221	{
    00222		myMenuData.LoadMainMenu();
    00223	}
    00224
    00225	function LoadIngameMenu()
    00226	{
    00227		myMenuData = new(none)class'XIIIMenuData';
    00228		myMenuData.LoadIngameMenu();
    00229	}
    00230
    00231	function bool OpenMenuWithClass(class<GUIPage> NewMenuClass, optional bool bReplace, optional string Param1, optional string Param2)
    00232	{
    00233		local GUIPage NewMenu;
    00234
    00235		NewMenu = new(None) NewMenuClass;
    00236	    InitStateFrame(NewMenu);
    00237		return InternalMenuInit(NewMenu, bReplace, Param1, Param2);
    00238	}
    00239
    00240	function bool InternalMenuInit(GUIPage NewMenu, optional bool bReplace, optional string Param1, optional string Param2)
    00241	{
    00242		local GUIPage CurMenu;
    00243		bCurMenuInitialized=false;
    00244		if (NewMenu!=None)
    00245
{ 00246 CurMenu = ActivePage; 00247 00248 if (bReplace == false) 00249 { // Add this menu to the top of the stack and give it focus 00250 NewMenu.ParentPage = CurMenu; 00251 MenuStack.Length = MenuStack.Length+1; 00252 MenuStack[MenuStack.Length-1] = NewMenu; 00253 } 00254 else 00255 { // replace the top element 00256 NewMenu.ParentPage = CurMenu.ParentPage; 00257 if (CurMenu==None) MenuStack.Length = MenuStack.Length+1; 00258 MenuStack[MenuStack.Length-1] = NewMenu; 00259 00260 NewMenu.MenuState = MSAT_Focused; 00261 } 00262 00263 ActivePage = NewMenu; 00264 ResetFocus(); 00265 00266 // check for parameters first because creation could depend on parameter passed 00267 NewMenu.HandleParameters(Param1, Param2); 00268 00269 // Initialize this Menu 00270 NewMenu.InitComponent(Self, none); 00271 00272 // Remove focus from the last menu 00273 if (CurMenu!=None) 00274 { 00275 CurMenu.MenuState = MSAT_Blurry; 00276 CurMenu.OnDeActivate(); 00277 } 00278 00279 NewMenu.CheckResolution(false); 00280 NewMenu.OnOpen(); // Pass along the event 00281 NewMenu.MenuState = MSAT_Focused; 00282 NewMenu.OnActivate(); 00283 NewMenu.PlayOpenSound(); 00284 00285 SetControllerStatus(true); 00286 bCurMenuInitialized=true; 00287 00288 bForceMouseCheck = true; 00289 00290 return true; 00291 } 00292 else 00293 { 00294 log("Could not create menu"@NewMenu); 00295 return false; 00296 } 00297 } 00298 00299 event bool CloseMenu(optional bool bCanceled, optional string Param1, optional string Param2) // Close the top menu. returns true if success. 00300 { 00301 local GUIPage CurMenu; 00302 local int CurIndex; 00303 00304 if (MenuStack.Length <= 0) 00305 { 00306 log("Attempting to close a non-existing menu page"); 00307 return false; 00308 } 00309 00310 CurIndex = MenuStack.Length-1; 00311 CurMenu = MenuStack[CurIndex]; 00312 00313 // Remove the menu from the stack 00314 MenuStack.Remove(MenuStack.Length-1,1); 00315 00316 // Look for the resolution switch 00317 CurMenu.PlayCloseSound(); // Play the closing sound 00318 CurMenu.OnClose(bCanceled); 00319 00320 CurMenu.MenuOwner=None; 00321 CurMenu.Controller=None; 00322 00323 MoveControl = None; 00324 SkipControl = None; 00325 00326 // Grab the next page on the stack 00327 bCurMenuInitialized=false; 00328 if (MenuStack.Length>0) // Pass control back to the previous menu 00329 { 00330 ActivePage = MenuStack[MenuStack.Length-1]; 00331 ActivePage.MenuState = MSAT_Focused; 00332 ActivePage.CheckResolution(true); 00333 00334 // check for parameters first because creation could depend on parameter passed 00335 ActivePage.HandleParameters(Param1, Param2); 00336 00337 ActivePage.OnReOpen(); 00338 ActivePage.OnActivate(); 00339 00340 ActiveControl = none; 00341 00342 ActivePage.FocusFirst(None,true); 00343 } 00344 else 00345 { 00346 if (!CurMenu.bAllowedAsLast) 00347 { 00348 return true; 00349 } 00350 00351 FocusedControl = None; 00352 ActiveControl = None; 00353 SkipControl = None; 00354 MoveControl = None; 00355 00356 ActivePage = None; 00357 SetControllerStatus(false); 00358 } 00359 00360 bCurMenuInitialized=true; 00361 bForceMouseCheck = true; 00362 return true; 00363 } 00364 00365 function GUIPage TopPage() 00366 { 00367 return ActivePage; 00368 } 00369 00370 function SetControllerStatus(bool On) 00371 { 00372 00373 bActive = On; 00374 bVisible = On; 00375 bRequiresTick=On; 00376 00377 // Attempt to Pause as well as show the windows mouse cursor. 00378 ViewportOwner.bShowWindowsMouse=On; 00379 00380 // Add code to pause/unpause/hide/etc the game here. 00381 if (On) 00382 bIgnoreUntilPress = true; 00383 else 00384 ViewportOwner.Actor.ConsoleCommand("toggleime 0"); 00385 } 00386 00387 00388 event CloseAll(bool bCancel) 00389 { 00390 local int i; 00391 // Close the current menu manually before we clean up the stack. 00392 if( MenuStack.Length >= 0 ) 00393 { 00394 if ( !CloseMenu(bCancel) ) 00395 return; 00396 } 00397 00398 for (i=0;i<MenuStack.Length;i++) 00399 { 00400 MenuStack[i].CheckResolution(true); 00401 MenuStack[i].Controller = None; 00402 MenuStack[i] = None; 00403 } 00404 00405 if (GameResolution!="") 00406 { 00407 ViewportOwner.Actor.ConsoleCommand("SETRES"@GameResolution); 00408 GameResolution=""; 00409 } 00410 00411 myMenuData.UnLoadMainMenu(); 00412 // never unload ingame menu 00413 00414 FocusedControl = None; 00415 ActiveControl = None; 00416 SkipControl = None; 00417 MoveControl = None; 00418 ActivePage = None; 00419 MenuStack.Remove(0,MenuStack.Length); 00420 SetControllerStatus(false); 00421 } 00422 00423 event InitializeController() 00424 { 00425 local int i; 00426 local class<GUIStyles> NewStyleClass; 00427 00428 for (i=0;i<StyleNames.Length;i++) 00429 { 00430 NewStyleClass = class<GUIStyles>(DynamicLoadObject(StyleNames[i],class'class')); 00431 if (NewStyleClass != None) 00432 if (!RegisterStyle(NewStyleClass)) 00433 log("Could not create requested style"@StyleNames[i]); 00434 00435 } 00436 // initialise menu array and load the ingame one 00437 LoadIngameMenu(); 00438 00439 // Arm and init the time out system if necessary 00440 if (TimeOutArmed) 00441 { 00442 SetInputTimeOut(TimeOutArmed); 00443 } 00444 bContinueWithoutSaving=false; 00445 bProfileSelected=false; 00446 bSavingPossible=false; 00447 } 00448 00449 function bool RegisterStyle(class<GUIStyles> StyleClass) 00450 { 00451 local GUIStyles NewStyle; 00452 00453 if (StyleClass != None && !StyleClass.default.bRegistered) 00454 { 00455 NewStyle = new(None) StyleClass; 00456 00457 // Check for errors 00458 if (NewStyle != None) 00459 { 00460 // Dynamic Array Auto Sizes StyleStack. 00461 StyleStack[StyleStack.Length] = NewStyle; 00462 NewStyle.Controller = self; 00463 NewStyle.Initialize(); 00464 return true; 00465 } 00466 } 00467 return false; 00468 } 00469 00470 event ChangeFocus(GUIComponent Who) 00471 { 00472 return; 00473 } 00474 00475 function ResetFocus() 00476 { 00477 00478 if (ActiveControl!=None) 00479 { 00480 ActiveControl.MenuStateChange(MSAT_Blurry); 00481 ActiveControl=None; 00482 } 00483 00484 RepeatKey=0; 00485 RepeatTime=0; 00486 00487 } 00488 00489 event MoveFocused(GUIComponent Ctrl, int bmLeft, int bmTop, int bmWidth, int bmHeight, float ClipX, float ClipY) 00490 { 00491 local float val; 00492 00493 00494 if (AltPressed) 00495 val = 5; 00496 else 00497 val = 1; 00498 00499 if (bmLeft!=0) 00500 { 00501 if (Ctrl.WinLeft<1) 00502 Ctrl.WinLeft = Ctrl.WinLeft + ( (Val/ClipX) * bmLeft); 00503 else 00504 Ctrl.WinLeft += (Val*bmLeft); 00505 } 00506 00507 if (bmTop!=0) 00508 { 00509 if (Ctrl.WinTop<1) 00510 Ctrl.WinTop = Ctrl.WinTop + ( (Val/ClipY) * bmTop); 00511 else 00512 Ctrl.WinTop+= (Val*bmTop); 00513 } 00514 00515 if (bmWidth!=0) 00516 { 00517 if (Ctrl.WinWidth<1) 00518 Ctrl.WinWidth = Ctrl.WinWidth + ( (Val/ClipX) * bmWidth); 00519 else 00520 Ctrl.WinWidth += (Val*bmWidth); 00521 } 00522 00523 if (bmHeight!=0) 00524 { 00525 if (Ctrl.WinHeight<1) 00526 Ctrl.WinHeight = Ctrl.WinHeight + ( (Val/ClipX) * bmHeight); 00527 else 00528 Ctrl.WinHeight += (Val*bmHeight); 00529 } 00530 } 00531 00532 function bool HasMouseMoved() 00533 { 00534 if (MouseX==LastMouseX && MouseY==LastMouseY) 00535 return false; 00536 else 00537 return true; 00538 } 00539 00540 event bool NeedsMenuResolution() 00541 { 00542 if ( (ActivePage!=None) && (ActivePage.bRequire640x480) ) 00543 return true; 00544 else 00545 return false; 00546 } 00547 00548 event SetRequiredGameResolution(string GameRes) 00549 { 00550 GameResolution = GameRes; 00551 } 00552 00553 00554 // This event is called when the user didn't create any input for a delay longer than DelayOfInactivityBeforeCallingTimeOut. 00555 //event NoInputTimeOut(); 00556 event NoInputTimeOut() 00557 { 00558 local int myPF; 00559 myPF = int(XIIIGameInfo(ViewportOwner.Actor.Level.Game).PlateForme); 00560 00561 //log("POUR iNFO myPF ="@myPF$", ActivePage ="@ActivePage); 00562 00563 if (myPF == 1 && ActivePage.IsA('XIIIMenuPressStart') ) 00564 { 00565 //log("Time out PSX2 !!!!!"); 00566 VP = new class'VideoPlayer'; 00567 if ( VP != none ) 00568 { 00569 log("video launched"); 00570 VP.Open("trailer"); 00571 VP.play(); 00572 URL="mapmenu"; 00573 //GetPlayerOwner().ConsoleCommand("QUIT 5"); // quit 5 00574 //GetPlayerOwner().ClientTravel(URL, TRAVEL_Absolute, false); 00575 closeall(true); 00576 ViewportOwner.Actor.ClientTravel(URL, TRAVEL_Absolute, false); 00577 gotostate(''); 00578 //return true; 00579 } 00580 } 00581 //ViewportOwner.Actor.ConsoleCommand("SCE_DEMO_ENDREASON_PLAYABLE_INACTIVITY_TIMEOUT"); // quit 1 00582 00583 } 00584 00585 00586 00587 00588 defaultproperties 00589 { 00590 FontStack(0)=GUISmallFont'GUI.GUIController.GUI_SmallFont' 00591 FontStack(1)=GUIBigFont'GUI.GUIController.GUI_BigFont' 00592 StyleNames(0)="GUI.STY_SquareButton" 00593 StyleNames(1)="GUI.STY_Listbox" 00594 StyleNames(2)="GUI.STY_NoAlphaButton" 00595 StyleNames(3)="GUI.STY_ScaleButton" 00596 StyleNames(4)="GUI.STY_Label" 00597 StyleNames(5)="GUI.STY_LabelWhite" 00598 StyleNames(6)="GUI.STY_MsgBoxButton" 00599 MouseCursors(0)=Texture'XIIIMenuStart.MouseCursorM' 00600 DblClickWindow=0.500000 00601 ButtonRepeatDelay=0.350000 00602 CursorStep=1 00603 FastCursorStep=1 00604 bHighlightCurrent=True 00605 MenuMouseSens=1.000000 00606 TimeOutArmed=True 00607 DelayOfInactivityBeforeCallingTimeOut=60.000000 00608 DefaultPens(0)=Texture'XIIIMenuStart.menublanc' 00609 DefaultPens(1)=Texture'XIIIMenuStart.menunoir' 00610 }

End Source Code