private void showUnfriendPrompt(PromptLoaderCMD promptLoader) { string i18nText = string.Format(Service.Get <Localizer>().GetTokenTranslation(promptLoader.PromptData.TextFields[DPrompt.PROMPT_TEXT_BODY].I18nText), displayName); promptLoader.PromptData.SetText(DPrompt.PROMPT_TEXT_BODY, i18nText, isTranslated: true); Service.Get <PromptManager>().ShowPrompt(promptLoader.PromptData, onUnfriendPlayerPromptButtonClicked, promptLoader.Prefab); }
private void showMembershipExpiringPrompt() { PromptDefinition promptDefinition = Service.Get <PromptManager>().GetPromptDefinition("MembershipExpiringPrompt"); PromptLoaderCMD promptLoaderCMD = new PromptLoaderCMD(this, promptDefinition, onMembershipExpiringPromptLoaded); promptLoaderCMD.Execute(); }
public void OnUnfriendPlayerButtonClicked() { PromptDefinition promptDefinition = Service.Get <PromptManager>().GetPromptDefinition("UnfriendPrompt"); PromptLoaderCMD promptLoaderCMD = new PromptLoaderCMD(this, promptDefinition, showUnfriendPrompt); promptLoaderCMD.Execute(); }
public bool ShowPrompt(string promptId, Action <DPrompt.ButtonFlags> callback) { Dictionary <string, PromptDefinition> dictionary = Service.Get <GameData>().Get <Dictionary <string, PromptDefinition> >(); if (dictionary.ContainsKey(promptId)) { PromptLoaderCMD promptLoaderCMD = new PromptLoaderCMD(this, dictionary[promptId], showPrompt, callback); promptLoaderCMD.Execute(); return(true); } Log.LogError(this, $"Could not find prompt definition: {promptId}"); return(false); }
private void showJumpToFriendServerPrompt(PromptLoaderCMD promptLoader) { string i18nText = "-"; WorldDefinition world = Service.Get <ZoneTransitionService>().GetWorld(playerWorld); if (world != null) { i18nText = Service.Get <Localizer>().GetTokenTranslation(LocalizationLanguage.GetLanguageToken(world.Language)); } promptLoader.PromptData.SetText("Prompt.Text.World", playerWorld, isTranslated: true); promptLoader.PromptData.SetText("Prompt.Text.Language", i18nText, isTranslated: true); Service.Get <PromptManager>().ShowPrompt(promptLoader.PromptData, onJumpToFriendPromptButtonClicked, promptLoader.Prefab); }
private void checkAndDisplayMessage() { if (!isShowingMessage && queuedAlerts.Count > 0) { isShowingMessage = true; IModerationAlert alert = queuedAlerts.Peek(); PromptDefinition promptDefinition = Service.Get <PromptManager>().GetPromptDefinition(alert.IsCritical ? "ModerationCriticalPrompt" : "ModerationWarningPrompt"); PromptLoaderCMD promptLoaderCMD = new PromptLoaderCMD(this, promptDefinition, delegate(PromptLoaderCMD loader) { showModerationPrompt(loader, alert); }); promptLoaderCMD.Execute(); } }
public void ShowPrompt(string promptId, string titleTextInsert, string bodyTextInsert, Action <DPrompt.ButtonFlags> callback) { Dictionary <string, PromptDefinition> dictionary = Service.Get <GameData>().Get <Dictionary <string, PromptDefinition> >(); if (dictionary.ContainsKey(promptId)) { PromptLoaderCMD promptLoaderCMD = new PromptLoaderCMD(this, dictionary[promptId], titleTextInsert, bodyTextInsert, showPrompt, callback); promptLoaderCMD.Execute(); } else { Log.LogError(this, $"Could not find prompt definition: {promptId}"); } }
public void OnJumpToFriendButtonClicked() { if (!playerCardController.IsShowingJumpPrompt) { playerCardController.IsShowingJumpPrompt = true; CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); PresenceData component = cPDataEntityCollection.GetComponent <PresenceData>(cPDataEntityCollection.LocalPlayerHandle); if (component.World == playerWorld) { Service.Get <PromptManager>().ShowPrompt("JumpToFriendPrompt", onJumpToFriendPromptButtonClicked); return; } PromptDefinition promptDefinition = Service.Get <PromptManager>().GetPromptDefinition("JumpToFriendServerPrompt"); PromptLoaderCMD promptLoaderCMD = new PromptLoaderCMD(this, promptDefinition, showJumpToFriendServerPrompt); promptLoaderCMD.Execute(); } }
private void showModerationPrompt(PromptLoaderCMD promptLoader, IModerationAlert alert) { if (alert.IsCritical) { CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); if (cPDataEntityCollection.TryGetComponent <DisplayNameData>(cPDataEntityCollection.LocalPlayerHandle, out var component)) { promptLoader.PromptData.SetText(DPrompt.PROMPT_TEXT_TITLE, component.DisplayName, isTranslated: true); } else { Log.LogError(this, "Could not find display name data on local player"); } promptLoader.PromptData.SetText("Moderation.Text.Time", "11hrs 26m", isTranslated: true); } promptLoader.PromptData.SetText(DPrompt.PROMPT_TEXT_BODY, alert.Text, isTranslated: true); Service.Get <PromptManager>().ShowPrompt(promptLoader.PromptData, onModerationPromptClosed, promptLoader.Prefab); }
private void onMembershipExpiringPromptLoaded(PromptLoaderCMD promptLoader) { Service.Get <PromptManager>().ShowPrompt(promptLoader.PromptData, onMembershipExpiringPromptButtonClicked, promptLoader.Prefab); Service.Get <ICPSwrveService>().Action("game.google_account_hold_prompt", "view"); }
private void showPrompt(PromptLoaderCMD promptLoader) { GameObject gameObject = ShowPrompt(promptLoader.PromptData, promptLoader.PromptCallback, promptLoader.Prefab); gameObject.name = promptLoader.PromptDefinition.Id; }
public void ShowPrompt(PromptDefinition promptDefinition, Action <DPrompt.ButtonFlags> callback) { PromptLoaderCMD promptLoaderCMD = new PromptLoaderCMD(this, promptDefinition, showPrompt, callback); promptLoaderCMD.Execute(); }