private async void AddServer() { string SrvUri = ServiceUri.Text.Trim(); if (string.IsNullOrEmpty(SrvUri)) { return; } try { new Uri(SrvUri); } catch (Exception) { await Popups.ShowDialog(new MessageDialog( "Invalid Uri" )); return; } XParameter Param = new XParameter(SrvUri); Param.SetValue(new XKey("uri", 1)); ServerReg.SetParameter(Param); ServerReg.Save(); ServiceUri.Text = ""; RefreshServers(); }
private async void CloseInputBox() { if (!(string.IsNullOrEmpty(TweetInput.Text) || TweetInput.Text == (" " + Keywords.Text + " #wenku10"))) { bool Discard = false; StringResources stx = StringResources.Load("Message"); await Popups.ShowDialog(UIAliases.CreateDialog( stx.Str("ConfirmDiscard") , () => Discard = true , stx.Str("Yes"), stx.Str("No") )); if (!Discard) { return; } } InReplyTo = null; ReplyToName.Text = ""; TransitionDisplay.SetState(TweetBox, TransitionState.Inactive); MajorControls = CommentControls; ControlChanged?.Invoke(this); }
private async Task HandleSelectMenuItemActivation(Guid localAccountId, NavigationManager.MainMenuSelections menuItem) { if (CurrentAccount != null && (localAccountId == Guid.Empty || CurrentAccount.LocalAccountId == localAccountId)) { var mainScreen = GetMainScreenViewModel(); if (mainScreen != null) { Popups.Clear(); mainScreen.Popups.Clear(); if (mainScreen.AvailableItems.Contains(menuItem)) { mainScreen.SelectedItem = menuItem; } } } else { if (localAccountId != Guid.Empty) { AccountsManager.SetLastLoginIdentifier(localAccountId); } NavigationManager.MainMenuSelection = menuItem; await HandleNormalLaunchActivation(); } }
public async void ConfirmSMSCode() { var result = await PerformNetworkOperation(async() => { var vm = new VerfiyPhoneNumber(); vm.PhoneNumber = PhoneNumber; vm.SMSCode = SMSCode; var confirmSMSResult = await RestClient.PostAsync("/api/verify/sms", vm, new CancellationTokenSource()); if (!confirmSMSResult.Successful) { return(confirmSMSResult); } var refreshResult = await RefreshUserFromServerAsync(); if (!refreshResult.Successful) { return(refreshResult); } Logger.AddCustomEvent(LagoVista.Core.PlatformSupport.LogLevel.Error, "VerifyUserViewModel_ConfirmSMSCode", "SMS Confirmed", new KeyValuePair <string, string>("userid", AuthManager.User.Id)); await Popups.ShowAsync(ClientResources.Verify_SMS_Confirmed); ShowPhoneConfirm = false; ShowEmailConfirm = true; return(refreshResult); }); if (result.Successful) { await TransitionToNextView(); } }
private async void ShowNews() { NewsStory.Stop(); Announcements NewsDialog = new Announcements(); await Popups.ShowDialog(NewsDialog); }
public override void OnTick() { base.OnTick(); bool hasDisplayedPopup = false; bool hasDisplayedTio = false; lock (Popups) { foreach (var popup in Popups.OrderByDescending(p => p.Priority).ThenByDescending(p => p.CurrentTick)) { if (popup.CurrentTick > popup.Duration + popup.DisplayDelay) { Popups.Remove(popup); continue; } if (popup.CurrentTick > popup.DisplayDelay) { if (popup.MessageType == MessageType.Popup && !hasDisplayedPopup) { SendMessage(popup.Message, type: (byte)popup.MessageType); hasDisplayedPopup = true; } if (popup.MessageType == MessageType.Tip && !hasDisplayedTio) { SendMessage(popup.Message, type: (byte)popup.MessageType); hasDisplayedTio = true; } } popup.CurrentTick++; } } }
public async void ResetPassword() { if (await Popups.ConfirmAsync(Resources.SimulatorCoreResources.UnlockPassword_ResetPassword_Title, Resources.SimulatorCoreResources.UnlockPassword_ResetPassword_Prompt)) { await ViewModelNavigation.NavigateAndPickAsync <SetStoragePasswordViewModel>(this, StorageUnlocked, CancelCredentialsEntry); } }
private void FormPopupDisplay_Load(object sender, EventArgs e) { textDescription.Text = PopupCur.Description.Replace("\r\n", "\n").Replace("\n", "\r\n"); if (PopupCur.UserNum != 0) { textUser.Text = Userods.GetUser(PopupCur.UserNum).UserName; } textCreateDate.Text = ""; if (PopupCur.DateTimeEntry.Year > 1880) { textCreateDate.Text = PopupCur.DateTimeEntry.ToShortDateString() + " " + PopupCur.DateTimeEntry.ToShortTimeString(); } DateTime dateT = Popups.GetLastEditDateTimeForPopup(PopupCur.PopupNum); textEditDate.Text = ""; if (dateT.Year > 1880) { textEditDate.Text = dateT.ToShortDateString() + " " + dateT.ToShortTimeString(); //Sets the Edit date to the entry date of the last popup change that was archived for this popup. } for (int i = 1; i <= 4; i++) { comboMinutes.Items.Add(i.ToString()); } for (int i = 1; i <= 11; i++) { comboMinutes.Items.Add((i * 5).ToString()); } comboMinutes.Text = "10"; for (int i = 1; i <= 12; i++) { comboHours.Items.Add(i.ToString()); } comboHours.Text = "1"; MinutesDisabled = 0; }
private async void ImportToken(object sender, RoutedEventArgs e) { NameValue <string> NV = new NameValue <string>("", ""); StringResources stx = StringResources.Load("AppResources", "ContextMenu"); Dialogs.NameValueInput NVInput = new Dialogs.NameValueInput( NV, stx.Text("New") + stx.Text("AccessTokens", "ContextMenu") , stx.Text("Name"), stx.Text("AccessTokens", "ContextMenu") ); await Popups.ShowDialog(NVInput); if (NVInput.Canceled) { return; } try { TokMgr.ImportAuth(NV.Name, NV.Value); ReloadAuths(TokenList, SHTarget.TOKEN, TokMgr); } catch (Exception) { } }
public void Start() { if (popupManager == null) { popupManager = this; } }
private async void ChangeBackground(object sender, RoutedEventArgs e) { MenuFlyoutItem item = sender as MenuFlyoutItem; string[] Argv = item.Tag.ToString().Split(','); if (Argv[0] == "Preset") { bool No = true; StringResources stx = StringResources.Load("Message", "ContextMenu"); MessageDialog MsgBox = new MessageDialog(stx.Str("BInfoView_PresetBg_Mesg"), stx.Text("PresetBackground", "ContextMenu")); MsgBox.Commands.Add(new UICommand(stx.Str("Yes"), x => { No = false; })); MsgBox.Commands.Add(new UICommand(stx.Str("No"))); await Popups.ShowDialog(MsgBox); if (No) { return; } } InfoBgContext.SetBackground(Argv[0]); }
public void ShowPopoup(Popups popup, bool hideWindows = false) { SettingsButt.gameObject.SetActive (false); BackButt.gameObject.SetActive (false); ScreenUserSetupInst.gameObject.SetActive (false); TestManagerInst.gameObject.SetActive (false); BackImage.gameObject.SetActive(false); if (hideWindows) { MainMenuScreenInst.gameObject.SetActive(false); TestManagerInst.gameObject.SetActive(false); BackImage.gameObject.SetActive(false); TestProgress.Instance.gameObject.SetActive(false); ConclusionInst.gameObject.SetActive(false); } switch (popup) { case Popups.Settings: SettingsScreenInst.gameObject.SetActive (true); break; case Popups.Confirmation: ConfirmationPopoupInst.gameObject.SetActive (true); break; case Popups.Password: PasswordPopoupInst.gameObject.SetActive(true); PasswordPopoupInst.GetComponentInChildren<InputField>().text = ""; break; case Popups.UserSetup: ScreenUserSetupInst.gameObject.SetActive(true); break; } }
private void FillGrid() { PopupList = Popups.GetForFamily(PatCur); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TablePopupsForFamily", "Patient"), 120); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePopupsForFamily", "Level"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePopupsForFamily", "Disabled"), 60, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePopupsForFamily", "Popup Message"), 120); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < PopupList.Count; i++) { row = new ODGridRow(); row.Cells.Add(Patients.GetPat(PopupList[i].PatNum).GetNameLF()); row.Cells.Add(Lan.g("enumEnumPopupLevel", PopupList[i].PopupLevel.ToString())); row.Cells.Add(PopupList[i].IsDisabled?"X":""); row.Cells.Add(PopupList[i].Description); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private async Task HandleQuickAddItem(TaskOrEventType type) { if (CurrentAccount == null) { await HandleNormalLaunchActivation(); } var mainScreen = GetMainScreenViewModel(); if (mainScreen != null && mainScreen.CurrentAccount != null && mainScreen.Classes != null && mainScreen.Classes.Count > 0) { Popups.Clear(); var newModel = AddTaskOrEventViewModel.CreateForAdd(mainScreen, new AddTaskOrEventViewModel.AddParameter() { Classes = mainScreen.Classes.ToArray(), DueDate = DateTime.Today, Type = type }); // For iOS, we can't clear and then add, we need to replace if (mainScreen.Popups.Count >= 1) { mainScreen.Popups[0] = newModel; while (mainScreen.Popups.Count > 1) { mainScreen.Popups.RemoveAt(1); } } else { mainScreen.ShowPopup(newModel); } } }
public async void SendResetPasswordLink() { if (String.IsNullOrEmpty(EmailAddress)) { await Popups.ShowAsync(ClientResources.Register_Email_Required); return; } var emailRegEx = new Regex(EMAIL_REGEX); if (!emailRegEx.Match(EmailAddress).Success) { await Popups.ShowAsync(ClientResources.Register_Email_Invalid); return; } if ((await PerformNetworkOperation(CallSendInvite)).Successful) { await Popups.ShowAsync(ClientResources.SendResetPasswordLink_Message); await ViewModelNavigation.GoBackAsync(); } }
private async void Toggled_PageClick(object sender, RoutedEventArgs e) { if (!TemplateSet) { return; } if (TogPageClick.IsOn && GRConfig.ContentReader.ReadingAnchor) { StringResources stx = StringResources.Load("Settings"); MessageDialog Msg = new MessageDialog(stx.Text("Layout_ContentReader_UsePageClick_Warning"), stx.Text("Layout_ContentReader_UsePageClick")); Msg.Commands.Add( new UICommand(stx.Text("Enabled")) ); Msg.Commands.Add( new UICommand(stx.Text("Disabled"), (x) => TogPageClick.IsOn = false) ); await Popups.ShowDialog(Msg); } GRConfig.ContentReader.ReadingAnchor = !TogPageClick.IsOn; if (TogPageClick.IsOn) { GRConfig.ContentReader.DoubleTap = TogDoubleTap.IsOn = false; } }
public async void OpenItem(object DataContext) { if (DataContext is GRRow <FTSResult> RsRow) { Chapter Ch = Shared.BooksDb.Chapters.Find(RsRow.Source.ChapterId); if (Ch == null) { StringResources stx = StringResources.Load("Message"); await Popups.ShowDialog(UIAliases.CreateDialog(string.Format(stx.Str("FTSNeedsRebuild")))); return; } Ch.Book = Shared.BooksDb.QueryBook(x => x.Id == Ch.BookId).FirstOrDefault(); // Chapter is hard-linked to Volume. So we can load it confidently await Shared.BooksDb.LoadCollectionAsync(Ch.Book, x => x.Volumes, x => x.Index); foreach (Volume V in Ch.Book.Volumes) { await Shared.BooksDb.LoadCollectionAsync(V, x => x.Chapters, x => x.Index); } BookItem BkItem = ItemProcessor.GetBookItem(Ch.Book); PageProcessor.NavigateToReader(BkItem, Ch); } }
private async void DiscardComment() { string Data; CommentInput.Document.GetText(Windows.UI.Text.TextGetOptions.None, out Data); Data = Data.Trim(); if (!string.IsNullOrEmpty(Data)) { StringResources stx = StringResources.Load("Message"); MessageDialog ConfirmDialog = new MessageDialog("Are you sure you want to discard your message?"); bool No = true; ConfirmDialog.Commands.Add(new UICommand(stx.Str("Yes"), x => No = false)); ConfirmDialog.Commands.Add(new UICommand(stx.Str("No"))); await Popups.ShowDialog(ConfirmDialog); if (No) { return; } } DropComment(); }
private async void SetSubsKey(object sender, RoutedEventArgs e) { StringResources stx = StringResources.Load("ContextMenu", "AppResources", "Tips"); ValueHelpInput NVInput = new ValueHelpInput( stx.Text("UseDefault", "AppResources") , stx.Text("SetSubsKey") , null, stx.Text("HowToGetSubs", "Tips") ); NVInput.AllowEmpty = true; NVInput.HelpBtnClick = (s, NOP) => { var j = Windows.System.Launcher.LaunchUriAsync(new Uri(AppLinks.HELP_API_KEY)); }; await Popups.ShowDialog(NVInput); if (NVInput.Canceled) { return; } ImageSrv.SetApiKey(NVInput.Value); }
void ReachNext() { lastPlanetReachTime = Time.time; comboDecayTimer = 0; NextSlot.PlayParticles(); NextSlot.PlanetReached(); goal = null; MapController.MoveSlots(); int score = CurrentSlot.ScoreGain * ScoreMultiplier; if (WasClose) { Popups.ShowPopup(closeMessages.GetRandomElement(), closePosition, Popups.PopupType.Close); AudioManager.Ref.PlaySound(AudioManager.Sound.Close); } if (CurrentSlot.IsCheckpoint) { GameController.GalaxyReached(); } else { GameController.PlanetReached(); } GameController.IncrementScore(score); ReachedPlanet(); if (GameController.IsSkippingLevels) { TryJumpToNext(); } }
private async Task HandleViewTaskOrEventActivation(Guid localAccountId, Guid itemId) { if (CurrentAccount == null || CurrentAccount.LocalAccountId != localAccountId) { AccountsManager.SetLastLoginIdentifier(localAccountId); await HandleNormalLaunchActivation(); } var mainScreen = GetMainScreenViewModel(); if (mainScreen != null && mainScreen.CurrentAccount != null) { Popups.Clear(); var singleExam = await SingleTaskOrEventViewItemsGroup.LoadAsync(localAccountId, itemId); if (singleExam != null && singleExam.Item != null) { mainScreen.ShowItem(singleExam.Item); // Remove all but latest popup // Have to do this AFTER showing the popup since on iOS if we first clear and then show immediately, iOS freaks out while (mainScreen.Popups.Count > 1) { mainScreen.Popups.RemoveAt(0); } } } }
private async void Delete(object sender, RoutedEventArgs e) { bool DoDelete = SelectedItem.Count == 0; if (!DoDelete) { StringResources stx = StringResources.Load("Message"); MessageDialog MsgBox = new MessageDialog(SelectedItem.DeleteMessage); MsgBox.Commands.Add(new UICommand(stx.Str("Yes"), x => { DoDelete = true; })); MsgBox.Commands.Add(new UICommand(stx.Str("No"))); await Popups.ShowDialog(MsgBox); } if (DoDelete) { if (SelectedItem.Value is CryptAES) { AESMgr.RemoveAuth(SelectedItem.Value.Value, ( CryptAES )SelectedItem.Value); ReloadAuths(KeyList, SHTarget.KEY, AESMgr); } else { TokMgr.RemoveAuth(SelectedItem.Value.Value, SelectedItem.Value); ReloadAuths(TokenList, SHTarget.TOKEN, TokMgr); } SelectedItem = null; } }
private void InitAppBar() { StringResources stx = StringResources.Load("Settings", "Message", "ContextMenu"); AppBarButton LogoutBtn = UIAliases.CreateAppBarBtn(SegoeMDL2.ChevronLeft, stx.Text("Account_Logout")); LogoutBtn.Click += async(s, e) => { bool Yes = false; await Popups.ShowDialog(UIAliases.CreateDialog( stx.Str("ConfirmLogout", "Message") , () => Yes = true , stx.Str("Yes", "Message"), stx.Str("No", "Message") )); if (Yes) { X.Singleton <IMember>(XProto.SHMember).Logout(); ControlFrame.Instance.GoBack(); ControlFrame.Instance.BackStack.Remove(PageId.SH_USER_INFO); } }; SecondaryIconButton ManageAuth = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Manage, stx.Text("ManageAuths", "ContextMenu")); ManageAuth.Click += (s, e) => ControlFrame.Instance.SubNavigateTo(this, () => new ManageAuth()); MajorControls = new ICommandBarElement[] { LogoutBtn }; Major2ndControls = new ICommandBarElement[] { ManageAuth }; }
public async void Send() { await PerformNetworkOperation(async() => { var queryString = String.Empty; foreach (var param in InputCommandParameters) { if (!String.IsNullOrEmpty(queryString)) { queryString += "&"; } queryString += param.ToQueryStringPair(); } var client = new HttpClient(); var endPoint = _inputCommandEndPoints.Where(inp => inp.InputCommand.Key == SelectedInputCommand.Key).FirstOrDefault(); if (endPoint != null) { var uri = String.IsNullOrEmpty(queryString) ? endPoint.EndPoint : $"{endPoint.EndPoint}?{queryString}"; var result = await client.GetAsync(uri); if (!result.IsSuccessStatusCode) { await Popups.ShowAsync(result.ReasonPhrase + $" ({result.StatusCode})"); } } }); SelectedInputCommand = InputCommands.FirstOrDefault(); DeviceStatusVisible = true; InputCommandVisible = false; }
void SetScore(int score) { scoreGathered += score - currentScore; currentScore = score; if (isBestScoreBeaten == false && bestScore > 0 && bestScore < currentScore) { Popups.ShowPopup("New\nHighscore!", GetScoreLabelPosition(), Popups.PopupType.HighScore); isBestScoreBeaten = true; AudioManager.Ref.PlaySound(AudioManager.Sound.HighScore); } else if (isAverageBeaten == false && AverageScore > 0 && AverageScore < currentScore) { Popups.ShowPopup("Over\nAverage!", GetScoreLabelPosition(), Popups.PopupType.AverageScore); isAverageBeaten = true; AudioManager.Ref.PlaySound(AudioManager.Sound.AverageScore); } try { HApi.Gameplay.SetCurrentScore(score); } catch (Exception e) { Debug.LogWarning(e); } }
public async void DeleteSimulator(object simulatorId) { if (simulatorId != null) { if (await Popups.ConfirmAsync(ClientResources.ConfirmDelete_Title, ClientResources.ConfirmDelete_Msg)) { await PerformNetworkOperation(async() => { var uri = $"/api/simulator/{simulatorId}"; var result = await RestClient.DeleteAsync(uri); if (result.Success) { var removedSimulator = ListItems.Where(sim => sim.Id == simulatorId.ToString()).FirstOrDefault(); if (removedSimulator != null) { var simList = ListItems.ToList(); simList.Remove(removedSimulator); ListItems = simList; } } return(result.ToInvokeResult()); }); } } }
private async Task HandleSelectMenuItemActivation(Guid localAccountId, NavigationManager.MainMenuSelections menuItem) { // If we already have a current account and it matches the specified (or unspecified) account ID if (CurrentAccount != null && (localAccountId == Guid.Empty || CurrentAccount.LocalAccountId == localAccountId)) { var mainScreen = GetMainScreenViewModel(); if (mainScreen != null) { Popups.Clear(); mainScreen.Popups.Clear(); if (mainScreen.AvailableItems.Contains(menuItem)) { mainScreen.SelectedItem = menuItem; } } } // Otherwise it's a fresh boot, or wrong account else { if (localAccountId != Guid.Empty) { AccountsManager.SetLastLoginIdentifier(localAccountId); } NavigationManager.MainMenuSelection = menuItem; await HandleNormalLaunchActivation(); } }
public async void Send() { IsBusy = true; try { switch (MsgTemplate.Transport.Value) { case TransportTypes.TCP: await SendTCPMessage(); break; case TransportTypes.UDP: await SendUDPMessage(); break; case TransportTypes.AzureServiceBus: await SendServiceBusMessage(); break; case TransportTypes.AzureEventHub: await SendEventHubMessage(); break; case TransportTypes.AzureIoTHub: await SendIoTHubMessage(); break; case TransportTypes.MQTT: await SendMQTTMessage(); break; case TransportTypes.RestHttps: case TransportTypes.RestHttp: await SendRESTRequest(); break; } } catch (Exception ex) { await Popups.ShowAsync(ex.Message); ReceivedContennt = ex.Message; } finally { IsBusy = false; } }
private void butOK_Click(object sender, System.EventArgs e) { if (textDescription.Text == "") { MsgBox.Show(this, "Please enter text first"); return; } //PatNum cannot be set if (PopupCur.IsNew) { //PopCur date got set on load PopupCur.PopupLevel = (EnumPopupLevel)comboPopupLevel.SelectedIndex; PopupCur.IsDisabled = checkIsDisabled.Checked; PopupCur.Description = textDescription.Text; PopupCur.UserNum = Security.CurUser.UserNum; Popups.Insert(PopupCur); } else { if (PopupCur.Description != textDescription.Text) //if user changed the description { Popup popupArchive = PopupCur.Copy(); popupArchive.IsArchived = true; popupArchive.PopupNumArchive = PopupCur.PopupNum; Popups.Insert(popupArchive); PopupCur.Description = textDescription.Text; PopupCur.UserNum = Security.CurUser.UserNum; } //No need to make an archive entry for changes to PopupLevel or IsDisabled so they get set on every OK Click. PopupCur.PopupLevel = (EnumPopupLevel)comboPopupLevel.SelectedIndex; PopupCur.IsDisabled = checkIsDisabled.Checked; Popups.Update(PopupCur); } DialogResult = DialogResult.OK; }
public static void ShowTextInput(this Popups popups, IDeckSaveCallback callback, string loadedDeckName, string problems, string popupType, string header, string description, string okText) { popups.ShowSaveDeck(callback, loadedDeckName, problems); typeof(Popups).GetField("popupType", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(popups, popupType); typeof(Popups).GetField("header", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(popups, header); typeof(Popups).GetField("description", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(popups, description); typeof(Popups).GetField("okText", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(popups, okText); }
public static void GotoPopup(Popups popUp) { ReadOnlyCollection <IWebElement> popups = Driver.Instance.FindElements(By.ClassName(classNameToFind: "panel-heading")); IWebElement selectedPopup = popups[(int)popUp]; PopupCommands.DoubleClick(selectedPopup); Driver.PleaseWait(); }
public static void ShowLogin(Popups popups, IOkStringsCancelCallback callback, string username, string problems, string popupType, string header, string description, string okText) { popups.ShowSaveDeck (instance, username, problems); instance.popupType = popupType; instance.callback = callback; typeof(Popups).GetField ("popupType", BindingFlags.Instance | BindingFlags.NonPublic).SetValue (popups, "login"); typeof(Popups).GetField ("header", BindingFlags.Instance | BindingFlags.NonPublic).SetValue (popups, header); typeof(Popups).GetField ("description", BindingFlags.Instance | BindingFlags.NonPublic).SetValue (popups, description); typeof(Popups).GetField ("okText", BindingFlags.Instance | BindingFlags.NonPublic).SetValue (popups, okText); }
void Session_popupClosed(Popups.popupBase sender, Popups.popupClosedEventArgs e) { //Event deregistrieren Session.popupClosed -= Session_popupClosed; //Veränderte Daten setzen _dateFrom = (DateTime) e.Result[Popups.statisticFilterPopup.DCKEY_DATE_FROM]; _dateTo = (DateTime) e.Result[Popups.statisticFilterPopup.DCKEY_DATE_TO]; _osMajor = (int) e.Result[Popups.statisticFilterPopup.DCKEY_OS_MAJOR]; _osMinor = (int) e.Result[Popups.statisticFilterPopup.DCKEY_OS_MINOR]; _selectedOSIndex = (int) e.Result[Popups.statisticFilterPopup.DCKEY_SELECTED_OS_INDEX]; }
public static void Create(Vector3 position, Transform parent, Popups state, bool isSubroutine, bool persist = false) { Popup tobeCreated; if (Pool.Count > 0) { tobeCreated = Pool[0]; Pool.RemoveAt(0); tobeCreated.gameObject.SetActive(true); tobeCreated.transform.position = position; } else { Transform g = (Transform)GameObject.Instantiate(CombatStaticPrefabReference.Instance.Popup, position, Quaternion.identity); tobeCreated = g.GetComponent<Popup>(); } if (parent != null) tobeCreated.transform.SetParent(parent); tobeCreated.SetSprite(state, isSubroutine, persist); }
public void SetSprite(Popups toPopup, bool isSubroutine, bool persist) { Color color = BadColor; if (isSubroutine) color = GoodColor; switch (toPopup) { case Popups.Block: this.visual.sprite = Block; break; case Popups.Reboot: this.visual.sprite = Reboot; break; case Popups.Freeze: this.visual.sprite = Freeze; color = FreezeColor; break; case Popups.Lag: this.visual.sprite = Lag; if (isSubroutine) color = BadColor; else color = GoodColor; break; } visual.color = color; if (persist) { } else { StartCoroutine(SelfDestruct()); } }
public PopupsWrapper(Popups popups) { this.popups = popups; HidePopupMethodInfo = popups.GetType().GetMethod("HidePopup", BindingFlags.NonPublic | BindingFlags.Instance); CreateGUISkins (); }
public void EnablePopup(Popups popup) { //Time.timeScale = 0; currentPopup = popup; }
public void ShowLogin(Popups popups, IOkStringsCancelCallback callback, string username, string problems, string popupType, string header, string description, string okText) { PatchPopups.ShowLogin (popups, callback, username, problems, popupType, header, description, okText); }
void Session_popupClosed(Popups.popupBase sender, Popups.popupClosedEventArgs e) { Session.popupClosed -= Session_popupClosed; if(sender.GetType() == typeof(Popups.updateVersionPopup)) { if(!string.IsNullOrEmpty(e.Result[Popups.updateVersionPopup.DCKEY_VERSION].ToString())) _package.releaseInfo.Version = e.Result[Popups.updateVersionPopup.DCKEY_VERSION].ToString(); _package.Published = (bool) e.Result[Popups.updateVersionPopup.DCKEY_PUBLISHED]; _package.isServicePack = (bool) e.Result[Popups.updateVersionPopup.DCKEY_SERVICE_PACK]; base.Node.Text = _package.ToString(); initializeData(); } }