// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. class Tab_InstantActionMain extends GUITabPanel; #exec OBJ LOAD FILE=RuntimeInterfaceContent.utx var config string LastMap; // Stores the last known settings var GUIListBox MyMapList; var GUIImage MyMapImage; var GUIScrollTextBox MyMapScroll; var GUIButton LoadMapButton; function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.Initcomponent(MyController, MyOwner); MyMapList = GUIListBox(Controls[0]); MyMapImage = GUIImage(Controls[1]); MyMapScroll = GUIScrollTextBox(Controls[2]); LoadMapButton = GUIButton(Controls[4]); MyMapList.List.OnChange = MapListChange; MyMapList.List.OnDblClick = MapListDblClick; ReadMapList(); if ( (LastMap=="") || (MyMapList.List.Find(LastMap)=="") ) MyMapList.List.SetIndex(0); ReadMapInfo(MyMapList.List.Get()); Controls[0].SetFocus(none); } // Play is called when the play button is pressed. It saves any releavent data and then // returns any additions to the URL function string Play() { SaveConfig(); return ""; } function ReadMapList() { local int i; MyMapList.List.Clear(); Controller.GetMapList("", MyMapList.List); MyMapList.List.RemoveItem("Entry"); MyMapList.List.RemoveItem("AutoPlay"); for(i = 0; i < 10; i++) MyMapList.List.RemoveItem("Auto"$i); MyMapList.List.SortList(); MyMapList.List.SetIndex(0); } function ReadMapInfo(string MapName) { local LevelSummary L; local string mDesc; if(MapName == "") return; L = LevelSummary(DynamicLoadObject(MapName$".LevelSummary", class'LevelSummary')); //Screen Shot MyMapImage.Image = Material(DynamicLoadObject(MapName$".Screenshot", class'Material')); if(MyMapImage.Image == NONE) MyMapImage.Image = Material'NoLevelPreview'; /* Title and Author the old way //Title if ( L != none ) GUILabel(Controls[5]).Caption = L.Title; else GUILabel(Controls[5]).Caption = MapName; //Author if (L.Author != "") GUILabel(Controls[6]).Caption = L.Author; else GUILabel(Controls[6]).Caption = "Anonymous"; */ //Title mDesc = "Title: "; if ( L != none ) mDesc = mDesc $ L.Title; else mDesc = mDesc $ MapName; //Author mDesc = mDesc $ "|Author: "; if (L.Author != "") mDesc = mDesc $ L.Author; else mDesc = mDesc $ "Anonymous"; //Description - useing LevelEnterText as hack mDesc = mDesc $ "|"; if (L.LevelEnterText != "") mDesc = mDesc $ L.LevelEnterText; else mDesc = mDesc $ "No Description Available!"; MyMapScroll.SetContent(mDesc); } function MapListChange(GUIComponent Sender) { if (!Controller.bCurMenuInitialized) return; LastMap = MyMapList.List.Get(); SaveConfig(); ReadMapInfo(LastMap); } function bool LoadMap(GUIComponent Sender) { local string FullURL, FirstMap; //MainMenu(Controller.ActivePage).pPlayer.InternalApply(none); FirstMap = MyMapList.List.Get(); FullURL = FirstMap; log("UT2InstantActionMain::PlayButtonClick - Sending [open"@FullURL$"] to the console"); Console(Controller.Master.Console).ConsoleCommand("start"@FullURL); // Was buffered. Is not now. Controller.CloseAll(false); return true; } defaultproperties { Begin Object Class=GUIListBox Name=IAMain_MapList WinWidth=0.478984 WinHeight=0.463633 WinLeft=0.021641 WinTop=0.161406 bVisibleWhenEmpty=True StyleName="SquareMenuButton" Hint="Select the map to play" End Object Controls(0)=GUIListBox'IAMain_MapList' Begin Object Class=GUIImage Name=IAMain_MapImage WinWidth=0.443750 //WinHeight=0.405312 WinHeight=0.463633 WinLeft=0.531796 WinTop=0.163489 Image=Material'RuntimeInterfaceContent.NoLevelPreview' ImageColor=(R=255,G=255,B=255,A=255); ImageStyle=ISTY_Scaled ImageRenderStyle=MSTY_Normal End Object Controls(1)=GUIImage'IAMain_MapImage' Begin Object Class=GUIScrollTextBox Name=IAMain_MapScroll WinWidth=0.435000 WinHeight=0.340000 WinLeft=0.534569 WinTop=0.65 CharDelay=0.0025 EOLDelay=0.5 bNeverFocus=true. //StyleName="NoBackground" bVisibleWhenEmpty=True End Object Controls(2)=GUIScrollTextBox'IAMain_MapScroll' Begin Object class=GUIImage Name=IAMainBK2 WinWidth=0.45 //WinHeight=0.41 WinHeight=0.468633 WinLeft=0.527891 WinTop=0.161406 Image=Material'GUIContent.BorderBoxA1' ImageColor=(R=255,G=255,B=255,A=160); ImageRenderStyle=MSTY_Normal ImageStyle=ISTY_Stretched End Object Controls(3)=GUIImage'IAMainBK2' Begin Object class=GUIButton Name=LoadMapB Caption="Load Map" Hint="Click to Load the Selected Map" WinLeft=0.021641 WinTop=0.66 WinWidth=0.15 WinHeight=0.060000 OnClick=LoadMap End Object Controls(4)=GUIButton'LoadMapB' // Title and Author the old way // Begin Object class=GUILabel Name=IAMain_MapName // Caption="Untitled" // TextALign=TXTA_Center // TextFont="HeaderFont" // TextColor=(R=220,G=180,B=0,A=255) // WinWidth=0.382813 // WinHeight=32.000000 // WinLeft=0.562304 // WinTop=0.52 // End Object // Controls(5)=GUILabel'IAMain_MapName' // // Begin Object class=GUILabel Name=IAMain_MapAuthor // Caption="Anonymous" // TextALign=TXTA_Center // TextFont="SmallHeaderFont" // TextColor=(R=255,G=255,B=255,A=255) // WinWidth=0.445313 // WinHeight=17.000000 // WinLeft=0.531054 // WinTop=0.58 // End Object // Controls(6)=GUILabel'IAMain_MapAuthor' WinTop=0.15 WinLeft=0 WinWidth=1 WinHeight=0.77 bAcceptsInput=false }