private void onPromptButtonPressed(DPrompt.ButtonFlags pressed) { if (pressed != DPrompt.ButtonFlags.YES) { return; } LocomotionController currentController = LocomotionHelper.GetCurrentController(base.gameObject); if (currentController is SitController) { LocomotionHelper.SetCurrentController <SwimController>(base.gameObject); } bubbleState = BubbleState.TransitionToHidden; playAudioEvent(mutableData.AirCriticalAudioEvent, EventAction.StopSound); GameObject gameObject = GameObject.FindWithTag(UIConstants.Tags.UI_Tray_Root); if (gameObject != null) { StateMachineContext component = gameObject.GetComponent <StateMachineContext>(); if (component != null) { component.SendEvent(new ExternalEvent("Root", "noUI")); } } Invoke("startBubbleScreenWipe", 0.7f); swimController.ResurfaceAccepted(); dispatcher.DispatchEvent(default(DivingEvents.PlayerResurfaced)); }
private void onButtonPressed(DPrompt.ButtonFlags pressed) { switch (pressed) { case DPrompt.ButtonFlags.OK: base.Fsm.Event(OkEvent); break; case DPrompt.ButtonFlags.CANCEL: base.Fsm.Event(CancelEvent); break; case DPrompt.ButtonFlags.YES: base.Fsm.Event(YesEvent); break; case DPrompt.ButtonFlags.NO: base.Fsm.Event(NoEvent); break; case DPrompt.ButtonFlags.CLOSE: base.Fsm.Event(CloseEvent); break; } Finish(); }
private void deleteConfirmationButton(DPrompt.ButtonFlags pressed, long equipmentIdToDelete) { if (pressed == DPrompt.ButtonFlags.YES) { Service.Get <INetworkServicesManager>().InventoryService.DeleteCustomEquipment(equipmentIdToDelete); } }
private void onExitConfirmPromptComplete(DPrompt.ButtonFlags button) { if (button == DPrompt.ButtonFlags.OK) { Service.Get <GameStateController>().ExitWorld(); } }
private void onConfirmClearLayoutPromptButtonClicked(DPrompt.ButtonFlags flags) { if (DPrompt.IsConfirmation(flags)) { clearCurrentLayout(); } }
private void onIglooConfirmStructureRemovalPromptButtonClicked(DPrompt.ButtonFlags flags) { if (flags == DPrompt.ButtonFlags.YES) { Service.Get <EventDispatcher>().DispatchEvent(new ObjectManipulationEvents.DeleteSelectedItemEvent(deleteChildren: true)); } }
private void onChangeServerPromptButtonClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.YES || pressed == DPrompt.ButtonFlags.OK) { changeServer(); } }
public override void OnEnter() { DPrompt.ButtonFlags buttonFlags = DPrompt.ButtonFlags.None; if (OkButton) { buttonFlags |= DPrompt.ButtonFlags.OK; } if (CancelButton) { buttonFlags |= DPrompt.ButtonFlags.CANCEL; } if (YesButton) { buttonFlags |= DPrompt.ButtonFlags.YES; } if (NoButton) { buttonFlags |= DPrompt.ButtonFlags.NO; } if (CloseButton) { buttonFlags |= DPrompt.ButtonFlags.CLOSE; } DPrompt data = new DPrompt(i18nTitleText, i18nBodyText, buttonFlags, Image, IsModal); Service.Get <PromptManager>().ShowPrompt(data, onButtonPressed, PrefabOverride); }
private void onRoomJoinButtonPressed(DPrompt.ButtonFlags buttonFlag) { showingError = false; int num; switch (buttonFlag) { case DPrompt.ButtonFlags.RETRY: if (connectionManager.ConnectionState == ConnectionManager.NetworkConnectionState.BasicConnection && sessionManager.HasSession) { gameStateController.ChangeServer(null); return; } reconnectionAttempts = 0; showNetworkErrorPrompt("GlobalUI.ErrorMessages.NetworkError.Title", "GlobalUI.ErrorMessages.RetryFailureError"); return; default: num = ((buttonFlag != DPrompt.ButtonFlags.OK) ? 1 : 0); break; case DPrompt.ButtonFlags.CANCEL: num = 0; break; } if (num == 0) { gameStateController.ExitWorld(); } }
private void onIglooConfirmDeletePromptButtonClicked(DPrompt.ButtonFlags flags) { if (flags == DPrompt.ButtonFlags.YES) { manageIgloos.DeleteIglooLayout(savedIglooMetaData.LayoutId); } }
private void onUnfriendPlayerPromptButtonClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.YES) { Service.Get <EventDispatcher>().DispatchEvent(default(PlayerCardEvents.UnfriendPlayer)); } }
private void onLoseProgressPromptDone(DPrompt.ButtonFlags button) { if (button == DPrompt.ButtonFlags.OK) { returnToSelectTemplate(); } }
private void onResetSunsetQuestDismissed(DPrompt.ButtonFlags buttonFlags) { if (buttonFlags == DPrompt.ButtonFlags.YES) { showCredits(); } }
private void onRemoveAccountPromptButtonClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.YES || pressed == DPrompt.ButtonFlags.OK) { this.OnRemoveAccount.InvokeSafe(accountData.Username, this); } }
public void ShowFatal(string type, string format, params object[] args) { DPrompt.ButtonFlags buttons = DPrompt.ButtonFlags.None; DPrompt data = new DPrompt(type, string.Format(format, args), buttons); ShowPrompt(data, null, FatalPrefab); }
private IEnumerator loadPrompt() { DPrompt.ButtonFlags buttonFlags = DPrompt.ButtonFlags.None; for (int j = 0; j < PromptDefinition.Buttons.Length; j++) { buttonFlags |= PromptDefinition.Buttons[j]; } Sprite image = null; if (!string.IsNullOrEmpty(PromptDefinition.SpriteContentKey.Key)) { AssetRequest <Sprite> spriteRequest = Content.LoadAsync(PromptDefinition.SpriteContentKey); yield return(spriteRequest); image = spriteRequest.Asset; } if (!string.IsNullOrEmpty(PromptDefinition.PrefabContentKey.Key)) { AssetRequest <GameObject> prefabRequest = Content.LoadAsync(PromptDefinition.PrefabContentKey); yield return(prefabRequest); if ((bool)prefabRequest.Asset.GetComponent <PromptController>()) { Prefab = prefabRequest.Asset.GetComponent <PromptController>(); } } string titleText2 = PromptDefinition.i18nTitleText; string bodyText2 = PromptDefinition.i18nBodyText; bool translate = !string.IsNullOrEmpty(titleTextInsert) || !string.IsNullOrEmpty(bodyTextInsert); Localizer localizer = Service.Get <Localizer>(); string titleDesktopText = $"{titleText2}.Desktop"; string bodyDesktopText = $"{bodyText2}.Desktop"; titleText2 = (localizer.tokens.ContainsKey(titleDesktopText) ? titleDesktopText : titleText2); bodyText2 = (localizer.tokens.ContainsKey(bodyDesktopText) ? bodyDesktopText : bodyText2); if (translate) { titleText2 = (string.IsNullOrEmpty(titleTextInsert) ? localizer.GetTokenTranslation(titleText2) : string.Format(localizer.GetTokenTranslation(titleText2), titleTextInsert)); bodyText2 = (string.IsNullOrEmpty(bodyTextInsert) ? localizer.GetTokenTranslation(bodyText2) : string.Format(localizer.GetTokenTranslation(bodyText2), bodyTextInsert)); } _promptData = new DPrompt(titleText2, bodyText2, buttonFlags, image, PromptDefinition.IsModal, PromptDefinition.AutoClose, translate, PromptDefinition.UseCloseButton); List <PromptController.CustomButtonDefinition> customButtons = new List <PromptController.CustomButtonDefinition>(PromptDefinition.CustomButtonKeys.Length); for (int i = 0; i < PromptDefinition.CustomButtonKeys.Length; i++) { AssetRequest <CustomButton> request = Content.LoadAsync(PromptDefinition.CustomButtonKeys[i]); yield return(request); if (request.Asset != null) { customButtons.Add(request.Asset.Definition); } } _promptData.CustomButtons = customButtons.ToArray(); if (onCompleteHandler != null) { onCompleteHandler(this); } }
private void onExitConfirmationClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.YES) { ShutdownHelper shutdownHelper = new ShutdownHelper(this); shutdownHelper.Shutdown(); } }
private void onLoseProgressPromptDone(DPrompt.ButtonFlags button) { if (button == DPrompt.ButtonFlags.OK) { Service.Get <CatalogServiceProxy>().cache.ClearCache(); Service.Get <GameStateController>().ReturnToZoneScene(); } }
private void onJumpToIglooPromptButtonClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.YES) { joinIgloo(); } closeJoinIglooPrompt(); }
private void onConfirmationPromptButtonsClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.OK) { Service.Get <PropService>().LocalPlayerStoreProp(); destroySelf(); } }
private void resendActivationEmail(DPrompt.ButtonFlags button) { if (button == DPrompt.ButtonFlags.YES) { Service.Get <MixLoginCreateService>().OnParentalApprovalEmailSendSuccess += onSendSuccess; Service.Get <MixLoginCreateService>().ParentalApprovalEmailSend(Service.Get <SessionManager>().LocalUser); } }
private void onFailPromptClose(DPrompt.ButtonFlags flags) { saveStatus = SaveStatus.FAIL; CustomizationContext.EventBus.DispatchEvent(default(CustomizerWidgetEvents.ResetCoinCountWidgetCount)); CustomizationContext.EventBus.DispatchEvent(default(CustomizerWidgetEvents.ShowCoinCountWidget)); CustomizationContext.EventBus.DispatchEvent(default(CustomizerUIEvents.SaveItemFailure)); ClothingDesignerContext.EventBus.DispatchEvent(new ClothingDesignerUIEvents.UpdateCameraState(ClothingDesignerCameraState.Default, animateCamera: true)); }
private void onJumpToFriendPromptButtonClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.YES) { Service.Get <ActionConfirmationService>().ConfirmAction(typeof(PlayerCardEvents.JoinPlayer), null, onJumpToFriendConfirmationSuccess); } playerCardController.IsShowingJumpPrompt = false; }
public ErrorData(string titleToken, string messageToken, Action <DPrompt.ButtonFlags> callback = null) { TitleToken = titleToken; MessageToken = messageToken; Callback = callback; PromptPrefab = null; Buttons = DPrompt.ButtonFlags.None; }
private void onShowExitWorldPromptCallback(DPrompt.ButtonFlags pressed) { showingPrompt = false; if (pressed == DPrompt.ButtonFlags.YES) { Service.Get <GameStateController>().ExitWorld(); } }
protected override GameObject createButtonObject(DPrompt data, int buttonIndex, DPrompt.ButtonFlags flag, ref string i18nText) { if (flag == DPrompt.ButtonFlags.CLOSE) { closeButton.SetActive(value: true); return(closeButton); } return(base.createButtonObject(data, buttonIndex, flag, ref i18nText)); }
private void onShowQuitAppPromptCallback(DPrompt.ButtonFlags pressed) { showingPrompt = false; if (pressed == DPrompt.ButtonFlags.YES) { ShutdownHelper shutdownHelper = new ShutdownHelper(this); shutdownHelper.Shutdown(); } }
private void onFailPromptClose(DPrompt.ButtonFlags flags) { CoroutineRunner.Start(waitAFrame(), this, "waitAFrame"); CustomizationContext.EventBus.DispatchEvent(default(CustomizerUIEvents.SwitchToSave)); CustomizationContext.EventBus.DispatchEvent(default(CustomizerUIEvents.ResetRotation)); CustomizationContext.EventBus.DispatchEvent(default(CustomizerUIEvents.EndPurchaseMoment)); CustomizationContext.EventBus.DispatchEvent(default(CustomizerEffectsEvents.ItemSaved)); ClothingDesignerContext.EventBus.DispatchEvent(new ClothingDesignerUIEvents.UpdateCameraState(ClothingDesignerCameraState.Default, animateCamera: true)); }
private void onConfirmationPromptButtonsClicked(DPrompt.ButtonFlags pressed) { if (pressed == DPrompt.ButtonFlags.OK) { Service.Get <ActionConfirmationService>().ConfirmAction(typeof(PropCancel), null, delegate { UnequipProp(); }); } }
private void onIglooConfirmUnfinishedBusinessPromptButtonClicked(DPrompt.ButtonFlags flags) { if (flags == DPrompt.ButtonFlags.NO) { stateController.ShowLoadingModalPopup(); stateController.DataManager.LayoutManager.RemoveActiveSceneLayout(); eventChannel.AddListener <SceneTransitionEvents.LayoutGameObjectsLoaded>(onSceneLayoutLoaded); stateController.DataManager.LayoutManager.AddNewSceneLayoutData(publishedLayout); } stateController.DataManager.StartSync(); }