private void DeleteButtonOnEventClicked(UIComponent component, UIMouseEventParameter eventparam) { ConfirmPanel.ShowModal( Locale.Get($"{Configuration.ResourcePrefix}TOOLTIPS", "DeleteButton"), string.Format(Locale.Get($"{Configuration.ResourcePrefix}TEXTS", "DeleteConfirmationMessage"), _fileNameLabel.text), (comp, ret) => { if (ret != 1) { return; } PresetsUtils.Delete(_fileNameLabel.text); if (UISaveWindow.Instance != null) { UISaveWindow.Instance.RefreshFileList(); } else { UILoadWindow.Instance.RefreshFileList(); } }); }
public static void OnDeleteLinesClick() { if (!ImprovedPublicTransportMod.inGame) { return; } if (!OptionsWrapper <Settings> .Options.DeleteBusLines && !OptionsWrapper <Settings> .Options.DeleteTramLines && !OptionsWrapper <Settings> .Options.DeleteTrainLines && !OptionsWrapper <Settings> .Options.DeleteMetroLines && !OptionsWrapper <Settings> .Options.DeleteMonorailLines && !OptionsWrapper <Settings> .Options.DeleteShipLines && !OptionsWrapper <Settings> .Options.DeletePlaneLines) { return; } WorldInfoPanel.Hide <PublicTransportWorldInfoPanel>(); ConfirmPanel.ShowModal(Localization.Get("SETTINGS_LINE_DELETION_TOOL_CONFIRM_TITLE"), Localization.Get("SETTINGS_LINE_DELETION_TOOL_CONFIRM_MSG"), (s, r) => { if (r != 1) { return; } Singleton <SimulationManager> .instance.AddAction(() => { SimulationManager.instance.AddAction(DeleteLines); }); }); }
public void ShowConfirm(bool y) { if (y) { ConfirmPanel.SetActive(true); ShopButton.SetActive(false); BtnAvatar.SetActive(false); InfoButton.GetComponent <Button>().interactable = false; SettingsButton.GetComponent <Button>().interactable = false; AccountBtnIcon.GetComponent <Button>().interactable = false; LeaderButton.GetComponent <Button>().interactable = false; PlayScreen.GetComponentInChildren <Button>().interactable = false; Camera.GetComponent <CameraController>().enabled = false; } else { ConfirmPanel.SetActive(false); ShopButton.SetActive(true); BtnAvatar.SetActive(true); InfoButton.GetComponent <Button>().interactable = true; SettingsButton.GetComponent <Button>().interactable = true; PlayScreen.GetComponentInChildren <Button>().interactable = true; AccountBtnIcon.GetComponent <Button>().interactable = true; LeaderButton.GetComponent <Button>().interactable = true; Camera.GetComponent <CameraController>().enabled = true; } }
public static void Export(string filename) { string file = Path.Combine(MoveItTool.saveFolder, filename + ".xml"); if (File.Exists(file)) { ConfirmPanel.ShowModal("Overwrite file", "The file '" + filename + "' already exists.\n Do you want to overwrite it?", (comp, ret) => { if (ret == 1) { MoveItTool.instance.Export(filename); instance.RefreshFileList(); instance.fileNameInput.Focus(); instance.fileNameInput.SelectAll(); } }); } else { MoveItTool.instance.Export(filename); instance.RefreshFileList(); instance.fileNameInput.Focus(); instance.fileNameInput.SelectAll(); } }
public override void Do() { bool po = false; foreach (InstanceState state in m_states) { if (state is ProcState) { po = true; break; } } if (!MoveItTool.POShowDeleteWarning || !po) { DoImplementation(false); return; } ConfirmPanel panel = UIView.library.ShowModal <ConfirmPanel>("ConfirmPanel", delegate(UIComponent comp, int value) { if (value == 1) { DoImplementation(false); } }); panel.SetMessage("Deleting PO", "Procedural Objects can not be undeleted. Are you sure?"); }
public static void Export(string filename) { string file = Path.Combine(MoveItTool.saveFolder, filename + ".xml"); if (File.Exists(file)) { ConfirmPanel.ShowModal(Str.xml_OverwriteTitle, String.Format(Str.xml_OverwriteMessage, filename), (comp, ret) => { if (ret == 1) { MoveItTool.instance.Export(filename); instance.RefreshFileList(); instance.fileNameInput.Focus(); instance.fileNameInput.SelectAll(); } }); } else { MoveItTool.instance.Export(filename); instance.RefreshFileList(); instance.fileNameInput.Focus(); instance.fileNameInput.SelectAll(); } }
// Use this for initialization void Start() { //UserData.ResetUserData(); m_BG = GetComponent <BoxGenerator>(); m_InfoBar = GameObject.FindGameObjectWithTag("InfoBar").GetComponent <InfoBar>(); m_ConfirmPanel = GameObject.Find("ConfirmPanel").GetComponentInChildren <ConfirmPanel>(); }
public void OnConfirmSubmitCardDeckButtonClick() { if (IsReadOnly) { return; } if (CurrentEditBuildButton == null) { OnCreateNewBuildButtonClick(); NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("Notice_SelectBuildManagerSelect_DeckCreatedPleaseSelectCards"), 0f, 1f); } else if (!CurrentEditBuildButton.BuildInfo.IsEnergyEnough()) { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize(LanguageManager.Instance.GetText("Notice_StartMenu_CardEnergyOverYourEnergy"), LanguageManager.Instance.GetText("Common_GotIt"), LanguageManager.Instance.GetText("Common_Ignore"), cp.CloseUIForm, new UnityAction(ConfirmDeck) + cp.CloseUIForm); } else { ConfirmDeck(); } }
public static void Export(string filename) { var file = Path.Combine(Configuration.AutoSaveFolderPath, filename + ".xml"); if (File.Exists(file)) { ConfirmPanel.ShowModal( Locale.Get($"{Configuration.ResourcePrefix}TEXTS", "OverwriteButton"), string.Format(Locale.Get($"{Configuration.ResourcePrefix}TEXTS", "OverwriteConfirmationMessage"), filename), (comp, ret) => { if (ret != 1) { return; } //DebugUtils.Log("Deleting " + file); File.Delete(file); PresetsUtils.Export(filename); Instance.RefreshFileList(); }); } else { PresetsUtils.Export(filename); Instance.RefreshFileList(); } }
void Start() { foreach (string serverTypeName in Enum.GetNames(typeof(ServerTypes))) { ServerDropdown.options[(int)Enum.Parse(typeof(ServerTypes), serverTypeName)] = new Dropdown.OptionData(LanguageManager.Instance.GetText("Server_" + serverTypeName)); } ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize( LanguageManager.Instance.GetText("LoginMenu_NeedNetwork"), LanguageManager.Instance.GetText("Common_Yes"), LanguageManager.Instance.GetText("Common_No"), delegate { ReturnToOnlineMode(true); cp.CloseUIForm(); }, delegate { cp.CloseUIForm(); ReturnToSingleMode(); }); cp.UIType.IsESCClose = false; cp.UIType.IsClickElsewhereClose = false; }
public void RefreshLeftPanelInfo(GeoGroupInfo ci) { LifeBar.value = ci.Life; LifeText.text = Mathf.RoundToInt(ci.Life).ToString(); SpeedBar.value = ci.Speed; SpeedText.text = Mathf.RoundToInt(ci.Speed).ToString(); DamageBar.value = ci.Damage; DamageText.text = Mathf.RoundToInt(ci.Damage).ToString(); VisionBar.value = ci.Vision; VisionText.text = Mathf.RoundToInt(ci.Vision).ToString(); GeneralSize.text = Mathf.Round(ci.GeneralSize / 10) + "cm"; Mass.text = Mathf.Round(ci.Mass) + "kg"; DietButton.onClick.RemoveAllListeners(); DietButton.onClick.AddListener(delegate { if (string.IsNullOrEmpty(NameInputField.text)) { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize("Please set the name first", "Confirm", null, delegate { cp.CloseUIForm(); }, delegate { }); return; } else { DietPanel.gameObject.SetActive(true); DietPanel.Refresh(ci); } }); }
public override void Awake() { height = 46; fileNameLabel = AddUIComponent <UILabel>(); fileNameLabel.textScale = 0.9f; fileNameLabel.autoSize = false; fileNameLabel.height = 30; fileNameLabel.verticalAlignment = UIVerticalAlignment.Middle; fileNameLabel.relativePosition = new Vector3(8, 8); deleteButton = UIUtils.CreateButton(this); deleteButton.name = "MoveIt_DeleteFileButton"; deleteButton.text = "X"; deleteButton.size = new Vector2(40f, 30f); deleteButton.relativePosition = new Vector3(430 - deleteButton.width - 8, 8); deleteButton.tooltip = "Delete saved path"; saveLoadButton = UIUtils.CreateButton(this); saveLoadButton.name = "MoveIt_SaveLoadFileButton"; saveLoadButton.text = UISaveWindow.instance != null ? "Export" : "Import"; saveLoadButton.size = new Vector2(80f, 30f); saveLoadButton.relativePosition = new Vector3(deleteButton.relativePosition.x - saveLoadButton.width - 8, 8); saveLoadButton.eventClicked += (c, p) => { if (UISaveWindow.instance != null) { UISaveWindow.Export(fileNameLabel.text); } else { UILoadWindow.Close(); MoveItTool.instance.Import(fileNameLabel.text); } }; deleteButton.eventClicked += (c, p) => { ConfirmPanel.ShowModal("Delete file", "Do you want to delete the file '" + fileNameLabel.text + "' permanently?", (comp, ret) => { if (ret == 1) { MoveItTool.instance.Delete(fileNameLabel.text); if (UISaveWindow.instance != null) { UISaveWindow.instance.RefreshFileList(); } else { UILoadWindow.instance.RefreshFileList(); } } }); }; fileNameLabel.width = saveLoadButton.relativePosition.x - 16f; }
private void Awake() { configMenuPanel.SetActive(false); if (!confirmPanel) { confirmPanel = FindObjectOfType <ConfirmPanel>(); } }
private void Awake() { mapMoveController = LuigisZip.Instance.luigis[zoneId]; if (confirmPanel == null) { //No va :((( confirmPanel = MenuManager.Instance.confirmPanel; } }
private static void OnBindingMouseDown(UIComponent comp, UIMouseEventParameter p) { if (m_EditingBinding == null) { p.Use(); m_EditingBinding = (Shortcut)p.source.objectUserData; UIButton uIButton = p.source as UIButton; uIButton.buttonsMask = (UIMouseButton.Left | UIMouseButton.Right | UIMouseButton.Middle | UIMouseButton.Special0 | UIMouseButton.Special1 | UIMouseButton.Special2 | UIMouseButton.Special3); uIButton.text = "Press any key"; p.source.Focus(); UIView.PushModal(p.source); } else if (!IsUnbindableMouseButton(p.buttons)) { p.Use(); UIView.PopModal(); InputKey inputKey = SavedInputKey.Encode(ButtonToKeycode(p.buttons), IsControlDown(), IsShiftDown(), IsAltDown()); List <Shortcut> currentAssigned; if (!IsAlreadyBound(m_EditingBinding, inputKey, out currentAssigned)) { if (m_EditingBinding.inputKey != inputKey) { m_EditingBinding.inputKey = inputKey; Shortcut.SaveShorcuts(); } UIButton uIButton = p.source as UIButton; uIButton.text = SavedInputKey.ToLocalizedString("KEYNAME", m_EditingBinding.inputKey); uIButton.buttonsMask = UIMouseButton.Left; m_EditingBinding = null; } else { string arg = (currentAssigned.Count <= 1) ? Locale.Get("KEYMAPPING", currentAssigned[0].name) : Locale.Get("KEYMAPPING_MULTIPLE"); string message = string.Format(Locale.Get("CONFIRM_REBINDKEY", "Message"), SavedInputKey.ToLocalizedString("KEYNAME", inputKey), arg); ConfirmPanel.ShowModal(Locale.Get("CONFIRM_REBINDKEY", "Title"), message, delegate(UIComponent c, int ret) { if (ret == 1) { m_EditingBinding.inputKey = inputKey; for (int i = 0; i < currentAssigned.Count; i++) { currentAssigned[i].inputKey = 0; } Shortcut.SaveShorcuts(); RefreshKeyMapping(); } UIButton uIButton = p.source as UIButton; uIButton.text = SavedInputKey.ToLocalizedString("KEYNAME", m_EditingBinding.inputKey); uIButton.buttonsMask = UIMouseButton.Left; m_EditingBinding = null; }); } } }
public override void OnClickInternal(UIMouseEventParameter p) { ConfirmPanel.ShowModal(Translation.GetString("Clear_Traffic"), Translation.GetString("Clear_Traffic") + "?", delegate(UIComponent comp, int ret) { if (ret == 1) { UtilityManager.Instance.RequestClearTraffic(); } UIBase.GetTrafficManagerTool(true).SetToolMode(ToolMode.None); }); }
private void DeleteBrushButton_eventClicked(UIComponent component, UIMouseEventParameter mouseEventParameter) { ConfirmPanel.ShowModal(Translation.Instance.GetTranslation("FOREST-BRUSH-MODAL-WARNING"), Translation.Instance.GetTranslation("FOREST-BRUSH-PROMPT-DELETE"), (d, i) => { if (i == 1) { ForestBrush.Instance.BrushTool.DeleteCurrent(); } }); }
public void OnReturnButtonClick() { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize("Confirm to leave? Your changes will be discarded.", "Confirm", "Cancel", delegate { cp.CloseUIForm(); OnClose(); }, delegate { cp.CloseUIForm(); }); }
public void OnLoad() { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize("If the presets are loaded, all species here would be cleared. Continue?", "Continue", "Cancel", delegate { NatureController.Instance.LoadAllSpeciesFromXML(); cp.CloseUIForm(); }, delegate { cp.CloseUIForm(); }); }
public void OnSave() { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize("If you export these species as presets, existing presets would be cleared. Continue?", "Continue", "Cancel", delegate { NatureController.Instance.OnSaveAllCreatures(); cp.CloseUIForm(); }, delegate { cp.CloseUIForm(); }); }
public void ShowUpdateConfirmPanel() { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize( LanguageManager.Instance.GetText("LoginMenu_ClientNeedUpdate"), LanguageManager.Instance.GetText("Common_Yes"), LanguageManager.Instance.GetText("Common_Cancel"), (new UnityAction(delegate { Application.OpenURL("www.biangstudio.com/mech-storm"); })) + cp.CloseUIForm, cp.CloseUIForm ); }
public static ConfirmPanel Instance() { if (!confirmPanel) { confirmPanel = FindObjectOfType(typeof(ConfirmPanel)) as ConfirmPanel; if (!confirmPanel) { Debug.LogError("There needs to be one active ConfirmUpgradePanel script on a GameObject in your scene."); } } return(confirmPanel); }
public void Execute() { ModLogger.Debug("Executing ShowWorkshopAssetInfo command for workshopid '{0}'", _workshopAssetRowData.WorkshopId); if (Steam.IsOverlayEnabled() && _workshopAssetRowData.WorkshopId > 0) { Steam.ActivateGameOverlayToWorkshopItem(new PublishedFileId(_workshopAssetRowData.WorkshopId)); } else { ConfirmPanel.ShowModal(UITexts.WorkshopAssetInfoOpenInBrowserTitle, UITexts.WorkshopAssetInfoOpenInBrowserMessage, AskInfoModalCallback); } }
private void OnChapterMapRoundCountChange(string value_str, UnityAction onSaveChapter, UnityAction onRefreshStory) { if (int.TryParse(value_str, out int value)) { if (isReturning) { Cur_Chapter.ChapterMapRoundCount = value; return; } if (value < Chapter.SystemMinMapRoundCount) { SetChapterMapRoundCount(Chapter.SystemMinMapRoundCount.ToString(), false); } else if (value > Chapter.SystemMaxMapRoundCount) { SetChapterMapRoundCount(Chapter.SystemMaxMapRoundCount.ToString(), false); } else { RoundCountBefore = Cur_Chapter.ChapterMapRoundCount; Cur_Chapter.ChapterMapRoundCount = value; if (isSelected) { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize(LanguageManager.Instance.GetText("StoryEditorPanel_Notice_ChangeChapterRoundCount"), LanguageManager.Instance.GetText("Common_Yes"), LanguageManager.Instance.GetText("Common_No"), delegate { cp.CloseUIForm(); Cur_Chapter.Levels.Clear(); onSaveChapter(); onRefreshStory(); }, delegate { cp.CloseUIForm(); isReturning = true; SetChapterMapRoundCount(RoundCountBefore.ToString(), false); isReturning = false; }); cp.UIType.IsESCClose = false; cp.UIType.IsClickElsewhereClose = false; } } } else { SetChapterMapRoundCount(Chapter.SystemMaxMapRoundCount.ToString(), false); } }
public static void ShowConfirmDialog(string title, string text, Action onConfirm, Action onCancel) { ConfirmPanel.ShowModal(title, text, (_, result) => { if (result != 1) { onCancel(); } else { onConfirm(); } }); }
// Start is called before the first frame update void Start() { soundManager = FindObjectOfType <SoundManager>(); goal = FindObjectOfType <GoalManager>(); manager = FindObjectOfType <Manager>(); levelButton = FindObjectOfType <LevelButton>(); confirmPAnel = FindObjectOfType <ConfirmPanel>(); endgame = FindObjectOfType <EndGameManager>(); scoreManager = FindObjectOfType <ScoreManager>(); gameData = FindObjectOfType <GameData>(); board = FindObjectOfType <Board>(); //ContinueOk(); }
// Use this for initialization void Start() { m_ConfirmPanel = GameObject.Find("ConfirmPanel").GetComponentInChildren <ConfirmPanel>(); for (int i = 0; i < m_SkillBt.Length; i++) { m_SkillBt[i] = BoxElementControl.GetSkillButton(i); } m_Amount[0] = m_MetalAmount; m_Amount[1] = m_WoodAmount; m_Amount[2] = m_WaterAmount; m_Amount[3] = m_FireAmount; m_Amount[4] = m_EarthAmount; }
private void Awake() { Instance = this; cg = GetComponent <CanvasGroup>(); cg.alpha = 0; cg.blocksRaycasts = false; buttonYes.onClick.AddListener(OnPresYes); buttonNo.onClick.AddListener(OnPresNo); ((RectTransform)transform).anchoredPosition = Vector2.zero; }
private static void ShowSubscriptionPrompt() { if (!GetSubscriptionHelpMessages(out var reason, out var solution)) { ShowError(reason, solution); return; } else { ConfirmPanel.ShowModal("Missing dependency: Harmony", "The dependency 'Harmony' is required for some mod(s) to work correctly. Do you want to subscribe to it in the Steam Workshop?", OnConfirm); } }
private static void OnBindingKeyDown(UIComponent comp, UIKeyEventParameter p) { if (m_EditingBinding != null && !IsModifierKey(p.keycode)) { p.Use(); UIView.PopModal(); KeyCode keycode = p.keycode; InputKey inputKey = (p.keycode == KeyCode.Escape) ? (InputKey)m_EditingBinding.inputKey : SavedInputKey.Encode(keycode, p.control, p.shift, p.alt); if (p.keycode == KeyCode.Backspace) { inputKey = 0; } List <Shortcut> currentAssigned; if (!IsAlreadyBound(m_EditingBinding, inputKey, out currentAssigned)) { if (m_EditingBinding.inputKey != inputKey) { m_EditingBinding.inputKey = inputKey; Shortcut.SaveShorcuts(); } UITextComponent uITextComponent = p.source as UITextComponent; uITextComponent.text = SavedInputKey.ToLocalizedString("KEYNAME", inputKey); m_EditingBinding = null; } else { string arg = (currentAssigned.Count <= 1) ? currentAssigned[0].name : Locale.Get("KEYMAPPING_MULTIPLE"); string message = string.Format(Locale.Get("CONFIRM_REBINDKEY", "Message"), SavedInputKey.ToLocalizedString("KEYNAME", inputKey), arg); ConfirmPanel.ShowModal(Locale.Get("CONFIRM_REBINDKEY", "Title"), message, delegate(UIComponent c, int ret) { if (ret == 1) { for (int i = 0; i < currentAssigned.Count; i++) { currentAssigned[i].inputKey = 0; } } m_EditingBinding.inputKey = inputKey; Shortcut.SaveShorcuts(); RefreshKeyMapping(); UITextComponent uITextComponent = p.source as UITextComponent; uITextComponent.text = SavedInputKey.ToLocalizedString("KEYNAME", m_EditingBinding.inputKey); m_EditingBinding = null; }); } } }