public void Initialize(double taskGuessRate) { stepScheme = StepScheme; currentSteps = null; try { //Clone list so we don't risk modifying script memory currentSteps = scriptObject.ExecuteFunction <List <int> >("Initialize", context, ParameterCount).ToList(); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"Initialize\" failed with error: {excp.Message}."); } }
public override bool IsDone() { try { return(scriptObject.ExecuteFunction <bool>("End", context)); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"End\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"End\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"End\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"End\" failed with error: {excp.Message}."); } return(true); }
string IStringParameterTemplate.GetValue(int stepNumber) { try { return(scriptObject.ExecuteFunction <string>("GetValue", context, stepNumber)); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"GetValue\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"GetValue\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"GetValue\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"GetValue\" failed with error: {excp.Message}."); } return(""); }
bool ISimpleDoubleStepTemplate.CouldStepTo(int stepNumber) { try { return(scriptObject.ExecuteFunction <bool>("CouldStepTo", context, stepNumber)); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"CouldStepTo\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"CouldStepTo\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"CouldStepTo\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"CouldStepTo\" failed with error: {excp.Message}."); } return(false); }
private void AddDebugButtons() { _containerView = new UIView(); _containerView.Frame = new RectangleF(10, 280, 300, 100); // Add send email button _emailButton = UIButton.FromType(UIButtonType.RoundedRect); _emailButton.Frame = new RectangleF(10, 0, 300, 40); _emailButton.SetTitle(" Send error report by email", UIControlState.Normal); _emailButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center; _emailButton.TouchDown += new EventHandler(EmailButtonTouchDown); _containerView.AddSubview(_emailButton); // Debug details _debugButton = UIButton.FromType(UIButtonType.RoundedRect); _debugButton.Frame = new RectangleF(10, 45, 300, 40); _debugButton.SetTitle(" Debug information", UIControlState.Normal); _debugButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center; _debugButton.TouchDown += delegate { ModalDialog.Alert("Debug", DebugInfo()); }; _containerView.AddSubview(_debugButton); Section section = new Section(_containerView); _bindingContext.Root.Add(section); }
private void EmailButtonTouchDown(object sender, EventArgs e) { if (File.Exists(Settings.Current.LogFile)) { if (MFMailComposeViewController.CanSendMail) { NSData data = NSData.FromFile(Settings.Current.LogFile); MFMailComposeViewController mailController = new MFMailComposeViewController(); mailController.SetSubject("Really simple iPhone error report"); mailController.SetToRecipients(new string[] { "*****@*****.**" }); mailController.SetMessageBody("Really simple error report", false); mailController.AddAttachmentData(data, "text/plain", "error.log"); mailController.Finished += HandleMailFinished; this.PresentModalViewController(mailController, true); } else { ModalDialog.Alert("No email account found", "Please configure an email account before sending an error report"); } } else { ModalDialog.Alert("No log file was found", "The error log was empty. Please try sending this again after the error occurs."); } }
private bool TestNameValid(string newName) { if (string.IsNullOrEmpty(newName)) { ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Invalid User Name", bodyText: "You cannot add a user with an empty name."); return(false); } if (newName.Contains("/") || newName.Contains(".") || newName.Contains("\\")) { ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Invalid User Name", bodyText: "Name is invalid. Cannot contain characters:'/', '.', or '\\'."); return(false); } //Check if user name is available if (PlayerData.UserExists(newName)) { ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Invalid User Name", bodyText: "User already exists. Users must have unique names."); return(false); } return(true); }
private void Submit(string newName) { newName = newName.Trim(); //Abort and warn if the name is bad or not unique if (!TestNameValid(newName)) { return; } //Check if user addition was successful if (PlayerData.AddUser(newName) == false) { ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Invalid User Name", bodyText: "There was a problem creating user name."); return; } if (LoadUser(newName) == false) { ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Unable to log into user {newName}."); return; } SettingsMenu.PullPushableSettings(); //Switch to main menu menuManager.SetWindowState(MenuManager.WindowState.Title); }
public void TryCancelChanges() { if (settingDirty) { ModalDialog.ShowSimpleModal(ModalDialog.Mode.ConfirmCancel, "Discard Changes?", "Are you sure you want to discard your changes and return to the Menu?", (ModalDialog.Response response) => { switch (response) { case ModalDialog.Response.Confirm: CancelChanges(); break; case ModalDialog.Response.Cancel: //Do Nothing break; default: Debug.LogError($"Unexpected ModalDialog.Response: {response}"); break; } }); } else { CancelChanges(); } }
void OpenDialog() { string textRef = dialogTexts[mCurIndex].GetStringRef(); if (!string.IsNullOrEmpty(textRef)) { if (clearModals.Value) { var uiMgr = ModalManager.main; if (uiMgr.GetTop() != modal.Value) { uiMgr.CloseAll(); } } if (usePortrait.Value) { ModalDialog.OpenApplyPortrait(modal.Value, portrait.Value as Sprite, nameText.GetStringRef(), textRef, OnDialogNext); } else { ModalDialog.Open(modal.Value, nameText.GetStringRef(), textRef, OnDialogNext); } mIsNext = false; } else { mCurIndex++; mIsNext = true; } }
/// <summary> /// /// </summary> void ShowIncomingModal(CodecActiveCallItem call) { (Parent as IAVWithVCDriver).PrepareForCodecIncomingCall(); IncomingCallModal = new ModalDialog(TriList); string msg; string icon; if (call.Type == eCodecCallType.Audio) { icon = "Phone"; msg = string.Format("Incoming phone call from: {0}", call.Name); } else { icon = "Camera"; msg = string.Format("Incoming video call from: {0}", call.Name); } IncomingCallModal.PresentModalDialog(2, "Incoming Call", icon, msg, "Ignore", "Accept", false, false, b => { if (b == 1) { Codec.RejectCall(call); } else //2 { AcceptIncomingCall(call); } IncomingCallModal = null; }); }
public void Initialize(double taskGuessRate) { stepScheme = StepScheme; try { currentStep = scriptObject.ExecuteFunction <int>("Initialize", context); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"Initialize\" failed with error: {excp.Message}."); } }
// Use this for initialization void Start() { //ActionType = 1; floor = GameObject.Find("Floor").GetComponent <Floor>(); pmotion = GetComponent <PlayerMotion>(); dlg = GameObject.Find("Canvas").GetComponent <ModalDialog>(); audio_source = gameObject.AddComponent <AudioSource>(); sounds = new Dictionary <string, AudioClip>() { { "walk", audio_walk }, { "turn", audio_turn }, { "hit_wall", audio_hit_wall }, }; radarLine = gameObject.AddComponent <LineRenderer>(); radarLine.material = new Material(Shader.Find("Particles/Additive")); radarLine.startColor = new Color32(12, 220, 12, 128); radarLine.endColor = radarLine.startColor; radarLine.startWidth = 0.1f; radarLine.endWidth = 0.1f; defaultColor = GetComponent <Transform>().Find("Body").GetComponent <Renderer>().material.color; routeRenderer = gameObject.AddComponent <RouteRenderer>(); }
/// <summary> /// Displays the add device dialog box. /// </summary> public void Show(bool updateUI) { if (updateUI) { UpdateUI(); } else { if (EditMode) { ModalDialog.Title = SR.DialogEditFileSystemTitle; } else { ModalDialog.Title = SR.DialogAddFileSystemTitle; } } if (Page.IsValid) { TabContainer1.ActiveTabIndex = 0; } ModalDialog.Show(); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); // Don't attempt to refresh if we're loading this controller from startup if (!_loadedFromStartup && Settings.Current.NeedsUpdate()) { if (!IsOnline()) { ModalDialog.Alert("No or slow internet connection", "An update is available for the feeds, but no connection is currently available"); ShowFirstItem(); } else { Settings.Current.LastItemId = ""; Settings.Current.LastControllerId = ""; // Show the modal update dialog _loadingView = new LoadingFeedsView(); _loadingView.LoadingComplete += new EventHandler(LoadingViewComplete); _loadingView.Stopped += LoadingViewStopped; _loadingView.Frame = new RectangleF(_loadingView.Bounds.Location, new SizeF(300, 400)); _loadingView.Initialize(); } } else { ShowFirstItem(); } }
private void ShowStats(AgentPrivate agent) { ModalDialog modalDialog = agent.Client.UI.ModalDialog; OperationCompleteEvent result = (OperationCompleteEvent)WaitFor(modalDialog.Show, getVisitorMessage(), "OK", "Reset"); if (result.Success && modalDialog.Response == "Reset") { WaitFor(modalDialog.Show, "Are you sure you want to reset visitor counts?", "Yes!", "Cancel"); if (modalDialog.Response == "Yes!") { // Make a new dictionary of everyone still here to replace the current tracking info. Dictionary <string, Visitor> stillHere = Visitors; Visitors = new Dictionary <string, Visitor>(); foreach (var visitor in stillHere) { Visitor v = new Visitor(); v.TotalTime = TimeSpan.Zero; v.VisitStarted = Stopwatch.GetTimestamp(); v.Here = true; Visitors[visitor.Key] = v; } WaitFor(modalDialog.Show, "Visitor times reset.", "", "Ok"); } } }
private void EditContact() { var v = new ContactView(); v.DataContext = ItemSelected; ItemSelected.ShowTSL = this.ShowTSL; var oldContact = new Contact() { AreaCode = ItemSelected.Phone.AreaCode, Number = ItemSelected.Phone.Number, NameAbbr = ItemSelected.Phone.NameAbbr, UnitName = ItemSelected.Phone.UnitName, Password = ItemSelected.Password, PhoneNumberId = ItemSelected.Phone.PhoneNumberId, TSLAreaCode = ItemSelected.TSLAreaCode, TSLNumber = ItemSelected.TSLNumber }; this.App.AddLog(string.Format("Thay đổi số Ä‘iện thoại {0} {1}", oldContact.AreaCode, oldContact.Number), true); if (ModalDialog.ShowControl(v, "Sá»a danh bạ") == true) { var service = Proxy.CreateProxy(); service.SaveContact(ItemSelected.Phone); this.App.AddLog(string.Format("LÆ°u thay đổi số Ä‘iện thoại {0} {1}", ItemSelected.Phone.AreaCode, ItemSelected.Phone.Number), true); } else { ItemSelected.Phone = oldContact; this.App.AddLog(string.Format("Hủy thay đổi số Ä‘iện thoại {0} {1}", oldContact.AreaCode, oldContact.Number), true); } ItemSelected.Refesh(); }
// Token: 0x0600004A RID: 74 RVA: 0x0000412C File Offset: 0x0000232C public static bool dontOverwriteExistingFile(string sFullPath, CamIntOverwriteMode overwriteMode, out bool cancel) { cancel = false; bool flag = overwriteMode == CamIntOverwriteMode.Overwrite; bool result; if (flag) { result = false; } else { bool flag2 = false; bool flag3 = File.Exists(sFullPath); bool flag4 = flag3; if (flag4) { bool flag5 = overwriteMode == CamIntOverwriteMode.Cancel; if (flag5) { cancel = true; return(true); } bool flag6 = overwriteMode == CamIntOverwriteMode.Skip; if (flag6) { return(true); } bool flag7 = ItCNCFileWriter.bNeverOverwrite; if (flag7) { flag2 = true; } else { bool flag8 = !ItCNCFileWriter.bAlwaysOverwrite; if (flag8) { string fileName = Path.GetFileName(sFullPath); string lclTitleProceed = ItCNCFileWriter._lclTitleProceed; ModalDialog modalDialog = new ModalDialog(lclTitleProceed); modalDialog.MainContent = "msgProceedWithOverwrite".LocaliseFormat(new string[] { fileName }); modalDialog.CommonButtons = (ModalDialogButtons.Yes | ModalDialogButtons.Cancel); modalDialog.DefaultButton = ModalDialogResult.Cancel; modalDialog.Id = "RevitPrecastCNCOverwriteFile"; modalDialog.AddCommandLink(ModalDialogCommandLinkId.CommandLink1, ItCNCFileWriter._lclMsgYesToAll); ModalDialogResult modalDialogResult = modalDialog.Show(); flag2 = (modalDialogResult == ModalDialogResult.Cancel); ItCNCFileWriter.bAlwaysOverwrite = (modalDialogResult == ModalDialogResult.CommandLink1); cancel = (modalDialogResult == ModalDialogResult.Cancel); } } } result = flag2; } return(result); }
public override void FinalizeParameters(double thresholdStepValue) { try { Output = scriptObject.ExecuteFunction <string>("CalculateOutput", context, thresholdStepValue); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"CalculateOutput\" failed with error: {excp.Message}."); Output = ""; ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"CalculateOutput\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"CalculateOutput\" failed with error: {excp.Message}."); Output = ""; ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"CalculateOutput\" failed with error: {excp.Message}."); } }
/// <summary> /// Shows short rest dialog /// </summary> public List <LevelModel> ShowShortRestDialog(List <LevelModel> levels, int conMod) { ModalDialog modalDialog = new ModalDialog(); if (_parentWindow != null) { modalDialog.Owner = _parentWindow; } List <LevelModel> levelsCopy = new List <LevelModel>(); foreach (LevelModel level in levels) { levelsCopy.Add(new LevelModel(level)); } ShortRestViewModel shortRestViewModel = new ShortRestViewModel(levelsCopy, conMod); ShortRestView shortRestView = new ShortRestView(shortRestViewModel); modalDialog.WindowTitle = "Short Rest"; modalDialog.Body = shortRestView; modalDialog.Confirmation = shortRestView.ViewModel; bool?result = ShowDialog(modalDialog); return(result == true ? levelsCopy : null); }
protected void LockPressed() { if (PlayerData.GlobalData.IsLocked) { ModalDialog.ShowInputModal( mode: ModalDialog.Mode.InputConfirmCancel, headerText: "Enter Code", bodyText: "Enter the unlock code.\n\n" + "Note: This enables experimental features.\n" + "The Code is 3141", inputCallback: LockSubmit); } else { PlayerData.GlobalData.IsLocked = true; switch (currentMode) { case SettingPanelMode.General: generalSettingsMenu.LockStateChanged(); break; case SettingPanelMode.UserSelect: userIDMenu.LockStateChanged(); break; default: Debug.LogError($"Unexpected mode: {currentMode}"); break; } UpdateUIForMode(currentMode); } }
public override void PopulateScriptContext(GlobalRuntimeContext scriptContext) { double stepValue = 0.0; try { stepValue = scriptObject.ExecuteFunction <double>("CalculateThreshold", context); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"CalculateThreshold\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"CalculateThreshold\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"CalculateThreshold\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"CalculateThreshold\" failed with error: {excp.Message}."); } foreach (ControlledParameterTemplate template in controlledParameters) { template.FinalizeParameters(stepValue); template.PopulateScriptContextOutputs(scriptContext); } }
void Update() { if (Input.GetKey(KeyCode.Escape)) { ModalDialog.ShowSimpleModal(ModalDialog.Mode.ConfirmCancel, headerText: "Quit?", bodyText: "Are you sure you want to quit?", callback: (ModalDialog.Response response) => { switch (response) { case ModalDialog.Response.Confirm: Application.Quit(); break; case ModalDialog.Response.Cancel: //Do Nothing break; case ModalDialog.Response.Accept: default: Debug.LogError($"Unexpected ModalDialog.Response: {response}"); break; } }); } }
double ISimpleDoubleStepTemplate.GetPartialValue(double stepNumber) { try { return(scriptObject.ExecuteFunction <double>("CalculateThreshold", context, stepNumber)); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"CalculateThreshold\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"CalculateThreshold\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"CalculateThreshold\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"CalculateThreshold\" failed with error: {excp.Message}."); } return(0.0); }
public override TagBuilder BuildHtmlMenuDialog(string ID, string ParentControllerAndAction) { AddRowDialog = new ModalDialog(ID + "-AddRowModal", "", "Titulek"); AddRowDialog.ParentControllerAndAction = ParentControllerAndAction; AddRowDialog.OnOk = "ReloadDataGridAndScrollToBottom()"; return(AddRowDialog.BuildDialogContent()); }
private void Display() { if (WorkQueues != null && WorkQueues.Count > 0) { Model.WorkQueue workqueue = WorkQueues[0]; WorkQueueSettingsPanel.SelectedPriority = workqueue.WorkQueuePriorityEnum; WorkQueueSettingsPanel.NewScheduledDateTime = workqueue.ScheduledTime; } SelectedWorkQueueItemList.Refresh(); if (WorkQueues == null) { return; } if (SelectedWorkQueueItemList.WorkQueueItems.Count != WorkQueueKeys.Count) { MessageDialog.Message = HttpContext.GetGlobalResourceObject("SR", "WorkQueueNoLongerAvailable") as string; MessageDialog.MessageType = MessageBox.MessageTypeEnum.INFORMATION; MessageDialog.Show(); } ModalDialog.Show(); }
public override void PopulateScriptContext(GlobalRuntimeContext scriptContext) { List <double> stepValues = null; try { stepValues = scriptObject.ExecuteFunction <List <double> >("CalculateThreshold", context); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"CalculateThreshold\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"CalculateThreshold\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"CalculateThreshold\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"CalculateThreshold\" failed with error: {excp.Message}."); } foreach (ControlledParameterTemplate template in controlledParameters) { double stepValue; if (stepValues is null || stepValues.Count <= template.ControllerParameter) { stepValue = 0.0; }
/// <summary> /// Displays the add device dialog box. /// </summary> public void Show(bool updateUI) { if (EditMode) { ModalDialog.Title = SR.DialogEditPartitionTitle; OKButton.Visible = false; UpdateButton.Visible = true; } else { ModalDialog.Title = SR.DialogAddPartitionTitle; OKButton.Visible = true; UpdateButton.Visible = false; } if (updateUI) { UpdateUI(); } if (Page.IsValid) { ServerPartitionTabContainer.ActiveTabIndex = 0; } ModalDialog.Show(); }
/// <summary> /// Displays the add device dialog box. /// </summary> public void Show(bool updateUI) { if (updateUI) { UpdateUI(); } else { if (EditMode) { ModalDialog.Title = Titles.EditPartitionArchiveTitle; } else { ModalDialog.Title = Titles.AddPartitionArchiveTitle; } } if (Page.IsValid) { // ServerPartitionTabContainer.ActiveTabIndex = 0; } ModalDialog.Show(); }
public void SubmitTrialResult(bool correct) { List <int> newSteps = null; try { newSteps = scriptObject.ExecuteFunction <List <int> >("Step", context, correct); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"Step\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"Step\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"Step\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"Step\" failed with error: {excp.Message}."); } for (int i = 0; i < ParameterCount; i++) { if (newSteps is null || newSteps.Count >= i) { continue; } int newStep; switch (stepScheme) { case StepScheme.Relative: newStep = currentSteps[i] + newSteps[i]; break; case StepScheme.Absolute: newStep = newSteps[i]; break; default: UnityEngine.Debug.LogError($"Unexpected StepScheme: {stepScheme}"); goto case StepScheme.Relative; } if (currentSteps[i] != newStep) { //Only call SetStepValue on change if (SetStepValue(i, newStep) == StepStatus.Success) { currentSteps[i] = newStep; } } } }
public ChangeLotTypeDialogEx(LotType currentLotType, CommercialLotSubType currentCommercialSubType, ResidentialLotSubType currentResidentialSubType, Vector2 position, ModalDialog.PauseMode pauseMode, bool isHouseboatLot) : base(currentLotType, currentCommercialSubType, currentResidentialSubType, position, pauseMode, isHouseboatLot) { PopulateComboBox(currentLotType == LotType.Residential, isHouseboatLot); Button childByID = mModalDialogWindow.GetChildByID(3, true) as Button; childByID.Click -= OnLotTypeClick; childByID.Click += OnLotTypeClickEx; childByID = mModalDialogWindow.GetChildByID(2, true) as Button; childByID.Click -= OnLotTypeClick; childByID.Click += OnLotTypeClickEx; }
protected void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); gameObject.SetActive(false); }
public static new bool Show(ref LotType currentType, ref CommercialLotSubType currentCommercialSubType, ref ResidentialLotSubType currentResidentialSubType, ref string lotTypeName, Vector2 position, ModalDialog.PauseMode pauseMode, bool isHouseboatLot) { if (ModalDialog.EnableModalDialogs) { using (ChangeLotTypeDialogEx dialog = new ChangeLotTypeDialogEx(currentType, currentCommercialSubType, currentResidentialSubType, position, pauseMode, isHouseboatLot)) { dialog.StartModal(); currentType = dialog.mCurrentLotType; currentCommercialSubType = dialog.mCurrentCommercialSubType; currentResidentialSubType = dialog.mCurrentResidentialSubType; lotTypeName = dialog.mLotTypeName; return dialog.Result; } } return false; }
public BigObjectPickerDialog(bool modal, ModalDialog.PauseMode pauseMode, string title, string buttonTrue, string buttonFalse, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List<ObjectPicker.RowInfo> preSelectedRows, bool showHeadersAndToggle) : base("cmo_BigObjectPicker", 1, modal, pauseMode, null) { if (this.mModalDialogWindow != null) { Text text = this.mModalDialogWindow.GetChildByID(99576787u, false) as Text; text.Caption = title; this.mTable = (this.mModalDialogWindow.GetChildByID(99576784u, false) as ObjectPicker); this.mTable.ObjectTable.TableChanged += new TableContainer.TableChangedEventHandler(this.OnTableChanged); this.mTable.SelectionChanged += new ObjectPicker.ObjectPickerSelectionChanged(this.OnSelectionChanged); this.mTable.RowSelected += new ObjectPicker.ObjectPickerSelectionChanged(this.OnSelectionChanged); this.mOkayButton = (this.mModalDialogWindow.GetChildByID(99576785u, false) as Button); this.mOkayButton.TooltipText = buttonTrue; this.mOkayButton.Enabled = false; //this.mOkayButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOkayButtonClick); UIManager.RegisterEvent<UIButtonClickEventArgs>(this.mOkayButton, 678582774u, new UIEventHandler<UIButtonClickEventArgs>(this.OnOkayButtonClick)); base.OkayID = this.mOkayButton.ID; base.SelectedID = this.mOkayButton.ID; this.mCloseButton = (this.mModalDialogWindow.GetChildByID(99576786u, false) as Button); this.mCloseButton.TooltipText = buttonFalse; //this.mCloseButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnCloseButtonClick); UIManager.RegisterEvent<UIButtonClickEventArgs>(this.mCloseButton, 678582774u, new UIEventHandler<UIButtonClickEventArgs>(this.OnCloseButtonClick)); base.CancelID = this.mCloseButton.ID; this.mTableOffset = this.mModalDialogWindow.Area.BottomRight - this.mModalDialogWindow.Area.TopLeft - (this.mTable.Area.BottomRight - this.mTable.Area.TopLeft); this.mTable.ShowHeaders = showHeadersAndToggle; this.mTable.ShowToggle = showHeadersAndToggle; this.mTable.ObjectTable.NoAutoSizeGridResize = true; this.mTable.Populate(listObjs, headers, numSelectableRows); this.mTable.ViewTypeToggle = viewTypeToggle; this.mPreSelectedRows = preSelectedRows; this.mTable.TablePopulationComplete += new VoidEventHandler(this.OnPopulationCompleted); if (!this.mTable.ShowToggle) { Window window = this.mModalDialogWindow.GetChildByID(99576788u, false) as Window; Window window2 = this.mModalDialogWindow.GetChildByID(99576789u, false) as Window; this.mTable.Area = new Rect(this.mTable.Area.TopLeft.x, this.mTable.Area.TopLeft.y - 64f, this.mTable.Area.BottomRight.x, this.mTable.Area.BottomRight.y); window2.Area = new Rect(window2.Area.TopLeft.x, window2.Area.TopLeft.y - 64f, window2.Area.BottomRight.x, window2.Area.BottomRight.y); window.Area = new Rect(window.Area.TopLeft.x, window.Area.TopLeft.y - 64f, window.Area.BottomRight.x, window.Area.BottomRight.y); } this.mModalDialogWindow.Area = new Rect(this.mModalDialogWindow.Area.TopLeft, this.mModalDialogWindow.Area.TopLeft + this.mTable.TableArea.BottomRight + this.mTableOffset); Rect area = this.mModalDialogWindow.Area; float num = area.BottomRight.x - area.TopLeft.x; float num2 = area.BottomRight.y - area.TopLeft.y; if (!this.mTable.ShowToggle) { num2 -= 50f; } float num3 = position.x; float num4 = position.y; if (num3 < 0f && num4 < 0f) { Rect area2 = this.mModalDialogWindow.Parent.Area; float num5 = area2.BottomRight.x - area2.TopLeft.x; float num6 = area2.BottomRight.y - area2.TopLeft.y; num3 = (float)Math.Round((double)((num5 - num) / 2f)); num4 = (float)Math.Round((double)((num6 - num2) / 2f)); } area.Set(num3, num4, num3 + num, num4 + num2); this.mModalDialogWindow.Area = area; this.mModalDialogWindow.Visible = true; } }
public static List<ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List<ObjectPicker.RowInfo> preSelectedRows, bool showHeadersAndToggle) { List<ObjectPicker.RowInfo> result; using (BigObjectPickerDialog bigObjectPickerDialog = new BigObjectPickerDialog(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, position, viewTypeToggle, preSelectedRows, showHeadersAndToggle)) { bigObjectPickerDialog.StartModal(); if (bigObjectPickerDialog.Result == null || bigObjectPickerDialog.Result.Count == 0) { result = null; } else { result = bigObjectPickerDialog.Result; } } return result; }
public static List<ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List<ObjectPicker.RowInfo> preSelectedRows) { return BigObjectPickerDialog.Show(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, position, viewTypeToggle, preSelectedRows, true); }
public static List<ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, int numSelectableRows) { return BigObjectPickerDialog.Show(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, new Vector2(-1f, -1f), false); }