// 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. //============================================================================= // Object that displays the notebook // ------------------------------------------------------------ // Created by Rui Guimarães // © 2007, Geodelft // // Date Id Modification // 2007-04-06 Gui Created // 2007-06-09 Gui Bug Corrections (Help Menu) // 2007-06-24 gui Corrected bug with character " //============================================================================= class MenuNotebook extends GUIPage; var int OptionSelected; var GeoPlayerController GeoPC; var bool bIgnoreEsc; var automated GUIImage Image_MainLogo; var Material BackPicture; var float DialogTop; var float DialogHeight; var float DialogLeft; var float DialogWidth; var float ButtonWidth; var float ButtonHeight; var float ButtonHGap; var float ButtonVGap; var float SButtonSize; var float SButtonSizeLarge; var float SButtonVGap; var float SButtonHGap; var float LabelTitleHeight; var float LabelTitleWidth; const BUTTON_BACKGROUND = 0; const BUTTON_CLOSE = 1; const BUTTON_HELP = 2; const BUTTON_NEXT = 3; const BUTTON_OK = 4; const BUTTON_COUNT = 5; const TEXTBOX = 7; const BUTTON_END = 53; const BUTTON_REST = 54; const BUTTON_CONT = 55; var string FirstBullit, NL_FirstBullit, EN_FirstBullit, XthBullit, XthBullit_Note, EN_XthBullit_Note, NL_XthBullit_Note, AfterLastBullit, NL_New_Note, EN_New_Note, NoNotes,EN_NoNotes,NL_NoNotes, AutoNote, En_AutoNote, NL_AutoNote; const CONTROL_LABEL_TITLE = 5; const SCORE_LABEL_TITLE = 0; const FIRST_SCORELABEL_INDEX = 14; var string NoteBookTitleText, NL_NoteBookTitleText, EN_NoteBookTitleText; var string RestartButtonLabel, EN_RestartButton, NL_RestartButton; var string EndButtonLabel, EN_EndButton, NL_EndButton; var string ContButtonLabel, EN_ContButtonLabel, NL_ContButtonLabel; var string TakeNote, EN_TakeNote, NL_TakeNote; //============================================================================= // Date Id Modification // 2007-04-06 gui Created //============================================================================= function bool IsEndScore() { return GeoPC.bIsGameOver; } //============================================================================= // Date Id Modification // 2007-04-06 gui Created //============================================================================= function GeoPlayerController GetGeoPC() { return GeoPlayerController(PlayerOwner()); } //============================================================================= // Date Id Modification // 2007-04-06 gui Created // 2007-04-27 zmr variables commented because of warning //============================================================================= function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.InitComponent(MyController, MyOwner); GeoPC = GetGeoPC(); if(GeoPC!=None) { UpdateLanguage(); } else { warn("ERROR WITH TYPE OF GAME"); } OnKeyEvent = InternalOnKeyEvent; OnClose = InternalOnClose; Controls[BUTTON_BACKGROUND].WinTop = DialogTop; Controls[BUTTON_BACKGROUND].WinLeft = DialogLeft; Controls[BUTTON_BACKGROUND].WinWidth = DialogWidth; Controls[BUTTON_BACKGROUND].WinHeight = DialogHeight; // Close button Controls[BUTTON_CLOSE].WinTop = DialogTop + SButtonVGap; Controls[BUTTON_CLOSE].WinLeft = DialogLeft + DialogWidth - (SButtonSize) - SButtonHGap; Controls[BUTTON_CLOSE].WinWidth = SButtonSize; Controls[BUTTON_CLOSE].WinHeight = SButtonSize; Controls[BUTTON_CLOSE].SetVisibility(true); // when set to true change position of help button!!! // Helk button Controls[BUTTON_HELP].WinTop = Controls[BUTTON_CLOSE].WinTop; Controls[BUTTON_HELP].WinLeft = Controls[BUTTON_CLOSE].WinLeft - (SButtonSize) - SButtonHGap;; Controls[BUTTON_HELP].WinWidth = SButtonSize; Controls[BUTTON_HELP].WinHeight = SButtonSize; /* NOT USED LEFT HERE TO ADJUST POSITIONS*/ Controls[BUTTON_OK].WinTop = Controls[6].WinTop; Controls[BUTTON_OK].WinLeft = DialogLeft + DialogWidth - (SButtonSize * 1.5) - SButtonHGap; /* END */ // Rest button Controls[BUTTON_NEXT].WinTop = Controls[BUTTON_OK].WinTop; Controls[BUTTON_NEXT].WinLeft = Controls[BUTTON_OK].WinLeft - (SButtonSizeLarge * 1.1) - SButtonHGap; Controls[BUTTON_NEXT].WinWidth = SButtonSizeLarge * 2; Controls[BUTTON_NEXT].WinHeight = SButtonSizeLarge * 0.7; Controls[BUTTON_NEXT].bVisible = true; Controls[CONTROL_LABEL_TITLE].WinTop = DialogTop + SButtonVGap; Controls[CONTROL_LABEL_TITLE].WinLeft = DialogLeft + SButtonHGap; Controls[CONTROL_LABEL_TITLE].WinHeight = LabelTitleHeight; Controls[CONTROL_LABEL_TITLE].WinWidth = LabelTitleWidth; GUILabel(Controls[CONTROL_LABEL_TITLE]).Caption = NoteBookTitleText; moEditBox(Controls[6]).MyEditBox.MaxWidth=400; GUIButton(Controls[3]).caption=TakeNote; UpdateNotes(); GeoPC.geoFb.logEvent("show_notebook"); } //============================================================================= // Date Id Modification // 2007-04-06 gui Created //============================================================================= function UpdateNotes() { local GeoNotebook NTB; local int TotalNotes, i; local string NewContent; NTB = new class'GeoNotebook'; TotalNotes = NTB.TotalNotes(); NewContent = NoNotes; for(i=0; i