private static void SetupTextures() { GeneralIni.Create(); SetupBackgroundSettings(); ButtonsPerPage = PositioningIni.ReadInt32("General", "ButtonsPerPage", 4); for (int i = 1; i <= ButtonsPerPage; i++) { if (PositioningIni.DoesKeyExist("Button" + i, "XOffset") && PositioningIni.DoesKeyExist("Button" + i, "YOffset")) { int XOffset = PositioningIni.ReadInt32("Button" + i, "XOffset", 0); int YOffset = PositioningIni.ReadInt32("Button" + i, "YOffset", 0); buttonOffsets.Add(new Point(XOffset, YOffset)); } else { //Albo1125.Common.CommonLibrary.ExtensionMethods.DisplayPopupTextBoxWithConfirmation("PoliceSmartRadio DisplayPositioning.ini Error", "Your UI has set " + ButtonsPerPage + " buttons per page, but has not specified XOffsets and YOffsets for so many buttons. Aborting.", true); //return; } } OnFootButtonPages = SetupButtonPage(onFootXML); InVehicleButtonPages = SetupButtonPage(inVehicleXML); if (firstTimeLaunch) { } CurrentButtonPages = OnFootButtonPages; CurrentPage = CurrentButtonPages.Count > 0 ? CurrentButtonPages[0] : new ButtonPage(); DoneLoadingTextures = true; Game.LogTrivial("Police SmartRadio is done loading. Button actions ready to be added."); SetupUserGeneralSettings(); ButtonSelectSound.Load(); ButtonScrollSound.Load(); }
public void Initialize() { InitBrowser(BrowserType.Firefox); driver.Navigate().GoToUrl(ButtonPage.BaseUrl); Methods.Methods.ImplicitWaitForSeconds(driver, 3); ButtonPage = new ButtonPage(driver); }
public void Test_Click() { int expected = 5; int actual = TestClass.returnFive(); ButtonPage.testy(); Assert.AreEqual(expected, actual); }
private static void cascadeCurrentButtonPages(bool pageRangeCheck = true) { List <ButtonPage> cascadedButtonPages = new List <ButtonPage>(); List <Button> availableButtons = new List <Button>(); CurrentButtonPages = OnFootPagesActive ? OnFootButtonPages : InVehicleButtonPages; foreach (ButtonPage bp in CurrentButtonPages) { foreach (Button button in bp.Buttons) { if (button.IsAvailable && button.Enabled) { availableButtons.Add(button); } } } int addingToPage = 0; int itemsOnPage = 0; foreach (Button b in availableButtons) { if (cascadedButtonPages.Count <= addingToPage) { cascadedButtonPages.Add(new ButtonPage()); } cascadedButtonPages[addingToPage].Buttons.Add(b); b.updateRectangle(itemsOnPage); itemsOnPage++; if (itemsOnPage == ButtonsPerPage) { addingToPage++; itemsOnPage = 0; } } CurrentButtonPages = cascadedButtonPages; if (CurrentPageIndex >= CurrentButtonPages.Count && pageRangeCheck) { CurrentPageIndex = CurrentButtonPages.Count - 1; if (CurrentPageIndex < 0) { CurrentPageIndex = 0; } } if (CurrentButtonPages.Count > 0) { CurrentPage = CurrentButtonPages[CurrentPageIndex]; } else { CurrentButtonPages.Add(new ButtonPage()); CurrentPage = CurrentButtonPages[0]; } }
private static void goToPreviousPage(bool playSounds = false) { if (PlayRadioButtonSounds && playSounds) { ButtonScrollSound.Play(); } cascadeCurrentButtonPages(false); if (CurrentPageIndex == 0) { CurrentPage = CurrentButtonPages.Last(); CurrentPageIndex = CurrentButtonPages.Count - 1; } else { CurrentPage = CurrentButtonPages[CurrentPageIndex - 1]; CurrentPageIndex--; } CurrentButtonIndex = CurrentPage.Buttons.Count - 1; }
private static void goToNextPage(bool playSounds = false) { if (PlayRadioButtonSounds && playSounds) { ButtonScrollSound.Play(); } cascadeCurrentButtonPages(false); CurrentButtonIndex = 0; if (CurrentButtonPages.Count <= CurrentPageIndex + 1) { CurrentPage = CurrentButtonPages[0]; CurrentPageIndex = 0; } else { CurrentPage = CurrentButtonPages[CurrentPageIndex + 1]; CurrentPageIndex++; } }
private static void SetupTextures() { GeneralIni.Create(); SetupBackgroundSettings(); ButtonsPerPage = PositioningIni.ReadInt32("General", "ButtonsPerPage", 4); for (int i = 1; i <= ButtonsPerPage; i++) { if (PositioningIni.DoesKeyExist("Button" + i, "XOffset") && PositioningIni.DoesKeyExist("Button" + i, "YOffset")) { int XOffset = PositioningIni.ReadInt32("Button" + i, "XOffset", 0); int YOffset = PositioningIni.ReadInt32("Button" + i, "YOffset", 0); buttonOffsets.Add(new Point(XOffset, YOffset)); } else { Albo1125.Common.CommonLibrary.ExtensionMethods.DisplayPopupTextBoxWithConfirmation("PoliceSmartRadio DisplayPositioning.ini Error", "Your UI has set " + ButtonsPerPage + " buttons per page, but has not specified XOffsets and YOffsets for so many buttons. Aborting.", true); return; } } OnFootButtonPages = SetupButtonPage(onFootXML); InVehicleButtonPages = SetupButtonPage(inVehicleXML); if (firstTimeLaunch) { Albo1125.Common.CommonLibrary.ExtensionMethods.DisplayPopupTextBoxWithConfirmation("PoliceSmartRadio: First Launch", "Welcome to PoliceSmartRadio! First time launch setup will now proceed. You can select which buttons to add on foot and in vehilce. If you make a mistake or change your mind, you will have to edit the XML files manually.", true); } CurrentButtonPages = OnFootButtonPages; CurrentPage = CurrentButtonPages.Count > 0 ? CurrentButtonPages[0] : new ButtonPage(); DoneLoadingTextures = true; Game.LogTrivial("Police SmartRadio is done loading. Button actions ready to be added."); SetupUserGeneralSettings(); ButtonSelectSound.Load(); ButtonScrollSound.Load(); MainLogic(); }
private static void MainLogic() { GameFiber.StartNew(delegate { while (true) { GameFiber.Yield(); if (ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.LControlKey) && ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.LShiftKey) && ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.Z)) { handleEditMode(); } else if (CurrentButtonPages.Count > 0) { if ((Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(ToggleRadioKey) && (ToggleRadioModifierKey == Keys.None || Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownRightNowComputerCheck(ToggleRadioModifierKey))) || (Game.IsControllerButtonDown(ToggleRadioButton) && (Game.IsControllerButtonDownRightNow(ToggleRadioModifierButton) || ToggleRadioModifierButton == ControllerButtons.None))) { CurrentButtonIndex = 0; if (!RadioShowing) { cascadeCurrentButtonPages(); } if (ResetRadioWhenOpening) { CurrentPageIndex = 0; } RadioShowing = !RadioShowing; } if (RadioShowing) { if (Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(NextButtonKey) || Game.IsControllerButtonDown(NextButtonButton)) { MoveButtonIndex(true); } else if (Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(PreviousButtonKey) || Game.IsControllerButtonDown(PreviousButtonButton)) { MoveButtonIndex(false); } else if (Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(SelectButtonKey) || Game.IsControllerButtonDown(SelectButtonButton)) { RadioShowing = false; if (CurrentPage.Buttons.Count > CurrentButtonIndex) { if (CurrentPage.Buttons[CurrentButtonIndex].IsAvailable) { handleButtonPress(CurrentPage.Buttons[CurrentButtonIndex]); } else { Game.LogTrivial("This PoliceSmartRadio button was set as currently not available."); } } else { Game.LogTrivial("Current button out of range on select (blank page)?"); Game.DisplayNotification("You'll need to add buttons to your SmartRadio first."); } } else if (ExtensionMethods.IsKeyDownComputerCheck(NextPageKey) || Game.IsControllerButtonDown(NextPageButton)) { goToNextPage(true); } else if (ExtensionMethods.IsKeyDownComputerCheck(PreviousPageKey) || Game.IsControllerButtonDown(PreviousPageButton)) { goToPreviousPage(true); CurrentButtonIndex = 0; } } else { if (Game.LocalPlayer.Character.IsInAnyVehicle(false) && OnFootPagesActive) { CurrentButtonPages = InVehicleButtonPages; cascadeCurrentButtonPages(); CurrentPage = CurrentButtonPages[0]; CurrentPageIndex = 0; CurrentButtonIndex = 0; OnFootPagesActive = false; } else if (!Game.LocalPlayer.Character.IsInAnyVehicle(false) && !OnFootPagesActive) { CurrentButtonPages = OnFootButtonPages; cascadeCurrentButtonPages(); CurrentPage = CurrentButtonPages[0]; CurrentPageIndex = 0; CurrentButtonIndex = 0; OnFootPagesActive = true; } } } } }); }
private void AssinarMensagens() { MessagingCenter.Subscribe <ActivityIndicatorPage>(this, "GoActivity", (msg) => { //App.Current.MainPage = new Navigation.Pagina1(); Detail = new ActivityIndicatorPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <ProgressBarPage>(this, "GoProgressBar", (msg) => { Detail = new ProgressBarPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <BoxViewPage>(this, "GoBoxView", (msg) => { Detail = new BoxViewPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <LabelPage>(this, "GoLabel", (msg) => { Detail = new LabelPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <ButtonPage>(this, "GoButton", (msg) => { Detail = new ButtonPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <EntryEditorPage>(this, "GoEntryEditor", (msg) => { Detail = new EntryEditorPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <DatePickerPage>(this, "GoDatePicker", (msg) => { Detail = new DatePickerPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <TimePickerPage>(this, "GoTimePicker", (msg) => { Detail = new TimePickerPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <PickerPage>(this, "GoPickerPage", (msg) => { Detail = new PickerPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <SearchBarPage>(this, "GoSearchPage", (msg) => { Detail = new SearchBarPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <SliderStepperPage>(this, "GoSliderStepper", (msg) => { Detail = new SliderStepperPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <SwitchPage>(this, "GoSwitch", (msg) => { Detail = new SwitchPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <ImagePage>(this, "GoImagePage", (msg) => { Detail = new ImagePage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <ListViewPage>(this, "GoListView", (msg) => { Detail = new ListViewPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <TableViewPage>(this, "GoTableViewPage", (msg) => { Detail = new TableViewPage(); //Esconder a master IsPresented = false; }); MessagingCenter.Subscribe <WebViewPage>(this, "GoWebView", (msg) => { Detail = new WebViewPage(); //Esconder a master IsPresented = false; }); }
public void SetUp() { _mainPage = new MainPage(Driver).GoToMainPage(); _buttonPage = _mainPage.GoToButtonPage(); }
private void TrocaTelaCommand() { var pageActivity = new ActivityIndicatorPage(); GoActivityIndicator = new Command(() => { MessagingCenter.Send <ActivityIndicatorPage>(pageActivity, "GoActivity"); }); var pageProgressBar = new ProgressBarPage(); GoProgressBar = new Command(() => { MessagingCenter.Send <ProgressBarPage>(pageProgressBar, "GoProgressBar"); }); var pageBoxView = new BoxViewPage(); GoBoxView = new Command(() => { MessagingCenter.Send <BoxViewPage>(pageBoxView, "GoBoxView"); }); var pageLabel = new LabelPage(); GoLabel = new Command(() => { MessagingCenter.Send <LabelPage>(pageLabel, "GoLabel"); }); var pageButton = new ButtonPage(); GoButton = new Command(() => { MessagingCenter.Send <ButtonPage>(pageButton, "GoButton"); }); var pageEntryEditor = new EntryEditorPage(); GoEntryEditor = new Command(() => { MessagingCenter.Send <EntryEditorPage>(pageEntryEditor, "GoEntryEditor"); }); var pageDatePicker = new DatePickerPage(); GoDatePicker = new Command(() => { MessagingCenter.Send <DatePickerPage>(pageDatePicker, "GoDatePicker"); }); var pageTimePicker = new TimePickerPage(); GoTimePicker = new Command(() => { MessagingCenter.Send <TimePickerPage>(pageTimePicker, "GoTimePicker"); }); var pagePickerPage = new PickerPage(); GoPickerPage = new Command(() => { MessagingCenter.Send <PickerPage>(pagePickerPage, "GoPickerPage"); }); var pageSearchBar = new SearchBarPage(); GoSearchPage = new Command(() => { MessagingCenter.Send <SearchBarPage>(pageSearchBar, "GoSearchPage"); }); var pageSliderStepper = new SliderStepperPage(); GoSliderStepper = new Command(() => { MessagingCenter.Send <SliderStepperPage>(pageSliderStepper, "GoSliderStepper"); }); var pageSwitch = new SwitchPage(); GoSwitch = new Command(() => { MessagingCenter.Send <SwitchPage>(pageSwitch, "GoSwitch"); }); var imagePage = new ImagePage(); GoImagePage = new Command(() => { MessagingCenter.Send <ImagePage>(imagePage, "GoImagePage"); }); var listView = new ListViewPage(); GoListView = new Command(() => { MessagingCenter.Send <ListViewPage>(listView, "GoListView"); }); var tablePage = new TableViewPage(); GoTableViewPage = new Command(() => { MessagingCenter.Send <TableViewPage>(tablePage, "GoTableViewPage"); }); var webView = new WebViewPage(); GoWebView = new Command(() => { MessagingCenter.Send <WebViewPage>(webView, "GoWebView"); }); }
public IEnumerator Start() { // wait until display has initialized while (!Display.IsInitialized()) { yield return(null); } // output red hello world at 10,5 on layer 0 string menuStr = "Menu:"; Vector2 menuStart = new Vector2(0, 0); renderText( str: menuStr, x: (int)menuStart.x, y: (int)menuStart.y, fgColor: Color.red, clickable: true, hoverable: true ); renderText( str: "?", x: (int)menuStart.x + menuStr.Length, y: (int)menuStart.y, fgColor: Color.yellow, clickable: true, hoverable: true ); menus = new ButtonList[] { new ButtonList( new Button[] { new Button( text: "clear", mouseDown: delegate { Debug.Log("clear"); this.renderPage = ""; this.clearLayer = 1; } ), new Button( text: "Description", mouseDown: delegate { Debug.Log("DescriptionPage"); this.renderPage = "DescriptionPage"; this.clearLayer = 1; } ), new Button( text: "Button", mouseDown: delegate { Debug.Log("ButtonPage"); this.renderPage = "ButtonPage"; this.clearLayer = 1; } ), new Button( text: "ButtonList", mouseDown: delegate { Debug.Log("ButtonListPage"); this.renderPage = "ButtonListPage"; this.clearLayer = 1; } ), new Button( text: "Player", mouseDown: delegate { Debug.Log("PlayerPage"); this.renderPage = "PlayerPage"; this.clearLayer = 1; } ), new Button( text: "Map", mouseDown: delegate { Debug.Log("MapPage"); this.renderPage = "MapPage"; this.clearLayer = 1; } ), new Button( text: "Container", mouseDown: delegate { Debug.Log("ContainerPage"); this.renderPage = "ContainerPage"; this.clearLayer = 1; } ) }, x: 1, y: 1, layer: 0 ) }; buttonPage = new ButtonPage(x: 20, y: 1); buttonListPage = new ButtonListPage(x: 20, y: 1); descriptionPage = new DescriptionPage(x: 20, y: 1); playerPage = new PlayerPage(x: 20, y: 1); mapPage = new MapPage(x: 20, y: 1); containerPage = new ContainerPage(x: 20, y: 1); /* * menuButtons[0] = new Button( * text: "a Room", * x: 0, * y: 1 * ); * * menuButtons[1] = new Button( * text: "@ Walking", * x: 0, * y: 2 * ); */ /*for (int x = 0; x < menu.Length; x++) * { * Cell cell = Display.CellAt(0, 0 + x, 0); * cell.SetContent( * menu.Substring(x, 1), * Color.clear, * Color.red); * }*/ /* * // add clickable cell text on layer 2 * string clickableText = "Click->"; * for (int x = 0; x < clickableText.Length; x++) * { * Cell cell = Display.CellAt(2, x, 17); * cell.SetContent( * clickableText.Substring(x, 1), * Color.clear, * Color.yellow); * } */ // add clickable cell on layer 0 /* * Cell clickable = Display.CellAt(0, 0 + menu.Length, 0); * clickable.SetContent( * "?", * Color.black, * Color.yellow); * clickable.clickAction = this; * clickable.hoverAction = this; */ /* * Cell clickable2 = Display.CellAt(0, 0 + menu.Length, 1); * clickable2.SetContent( * "#", * Color.black, * Color.yellow); * clickable2.clickAction = this; * clickable2.hoverAction = this; */ //StartCoroutine(RandomGrid()); //StartCoroutine(Transition()); }
private void IrParaPaginaButton(object s, EventArgs e) { Detail = new ButtonPage(); }