void Awake() { Instance = this; m_DialogFrame = GetComponent<Image>(); m_Text = GetComponentInChildren<Text>(); }
void Start() { dialog = Object.FindObjectOfType<DialogBox>(); cameraGrayscale = Object.FindObjectOfType<Grayscale>(); camera = GetComponent<Camera>(); camera.enabled = false; }
public static void ShowError(string message) { DialogBox dialogBox = new DialogBox(); dialogBox.Message = message; dialogBox.Title = AppConstants.MessageTypes.Error; dialogBox.btnCancel.Visibility = Visibility.Collapsed; dialogBox.ShowDialog(); }
void OnGUI() { currentDialog = GetActiveDialog(); if (currentDialog != null) { GameStorage.gameState = GameStorage.GameState.Paused; DialogBox dialogBox = new DialogBox(currentDialog); } }
public void Hide(bool suppressEvents) { currentDialog = null; if (!suppressEvents) { onHide.ForEach(s => s.Fire()); } state = DialogState.Hidden; }
void DoDialog() { if (!DialogBox.isReadingText) { box = DialogBox.LaunchDialogBox(gameObject); box.AddDialog(dialog); } else { box.NextDialog(); } }
/// <summary> /// Constructor. /// </summary> /// <param name="dialogBox"></param> /// <param name="owner"></param> protected internal DialogBoxView(DialogBox dialogBox, DesktopWindowView owner) { IApplicationComponentView componentView = dialogBox.ComponentView; // cache the app component - we'll need it later to get the ExitCode _component = (IApplicationComponent)dialogBox.Component; _form = CreateDialogBoxForm(dialogBox, (Control)componentView.GuiElement); _form.FormClosing += new FormClosingEventHandler(_form_FormClosing); _owner = owner.DesktopForm; }
void Start() { // Since they're taking turns, enforce this if (TolstoyDialog.Length - TeaganDialog.Length > 1) Debug.LogError("Tolstoy dialog piece needs to be at most one longer than the other."); // These are probably going to be uniqe so grab them this way cameraControl = Object.FindObjectOfType<CameraFollow>(); dialog = Object.FindObjectOfType<DialogBox>(); grayscale = Object.FindObjectOfType<Grayscale>(); StartCoroutine(StartRoomCoroutine()); }
public MenuViewModel() { NewDiagramCommand = new RelayCommand(NewDiagram); OpenDiagramCommand = new RelayCommand(OpenDiagram); SaveDiagramCommand = new RelayCommand(SaveDiagram); dialogVM = new DialogBox(); UndoCommand = new RelayCommand<int>(undoClicked, undoRedo.CanUndo); RedoCommand = new RelayCommand<int>(redoClicked,undoRedo.CanRedo); ExportCommand = new RelayCommand(SaveImage); Messenger.Default.Register<Grid>(this, initGrid); }
public void NewFile() { if (edScript.Text.Length > 0) { DialogBox dlg = new DialogBox("New file...", "Do you want to save existing file?", DialogBox.Buttons.YesNo); if (dlg.ShowDialog() == true) { SaveFile(); } edScript.Text = ""; } }
public void AddPythonCodeFormater() { try { this.edScript.SyntaxHighlighting = HighlightingLoader.Load(new XmlTextReader("Resources\\Python.xshd"), HighlightingManager.Instance); } catch (Exception e) { DialogBox msg = new DialogBox("Error!", e.Message, DialogBox.Buttons.Ok); msg.ShowDialog(); } }
public static bool Show(string message) { DialogBox dialogBox = new DialogBox(); dialogBox.Message = message; dialogBox.ShowDialog(); if (dialogBox.DialogResult == true) { return true; } else { return false; } }
public static void showInfoBox(Panel parent, string message, string title, string button, dialogResultHandler handler) { DialogBox dialog = new DialogBox(); dialog.onGotDialogResult += handler; dialog.tbMessage.Text = message; dialog.tbTitle.Text = title; new Dialog(parent, dialog, false, false, true, null, new DialogButton(button, DialogButton.Alignment.Right, DialogButton.Style.Flat, delegate () { dialog.triggerGotDialogResult(DialogResult.MainOption); return DialogButton.ReturnEvent.Close; })); }
public bool ShowMessage(string message, string caption, bool confirmation) { var dialogInitializationInfo = new DialogBoxInitializationInfo { Buttons = confirmation ? DialogBoxButtons.Ok : DialogBoxButtons.OkCancel, Content = message, Title = caption, OkButtonContent = AppResources.SinilinkDialogOkButtonText, CancelButtonContent = AppResources.SinilinkDialogCancelButtonText }; var dialogBox = new DialogBox(); dialogBox.Width = (double)App.Current.Resources["ScreenWidth"]; dialogBox.Height = (double)App.Current.Resources["ScreenHeight"]; if (dialogBox.RowSpanSize.HasValue) { Grid.SetRowSpan(dialogBox, dialogBox.RowSpanSize.Value); } dialogBox.Show(dialogInitializationInfo).ContinueWith(t => true, TaskContinuationOptions.OnlyOnRanToCompletion); return false; }
public async void LoginWithPassword() { IsBusy = true; Views.LoginView.CurrentEffectMode = Views.LoginView.EffectMode.Disabled; var result = ValidateInput(); if (result.IsOk) { if (await SignInWithPasswordAsync(UserName, Password)) { if (!IsWindowsHelloEnabled(UserName)) { await TrySetupWindowsHelloAsync(UserName); } AppSettings.Current.UserName = UserName; EnterApplication(); return; } } await DialogBox.ShowAsync(result); Views.LoginView.CurrentEffectMode = Views.LoginView.EffectMode.Foreground; IsBusy = false; }
/// <summary> /// Closes a specific file or the opened design and optionally updates the design tab control. /// </summary> /// <param name="name"></param> /// <param name="updateDesignControl"></param> /// <returns></returns> public string CloseFile(string name = null, bool updateDesignControl = true) { // Get active design Design activeDesign = DesignController.GetActiveDesign(); string designName = name ?? activeDesign.FileName; Design design = designName == null ? activeDesign : DesignController.GetDesign(designName); bool save = true; if (design.IsDirty) { DialogResult result = DialogBox.New("Confirm", $"{designName} has unsaved changes. Would you like to save these changes?", DialogType.YesNoCancel); if (result == DialogResult.No) { save = false; } else if (result == DialogResult.Cancel) { return(null); } } // Remove nav tree node of the design MainWindow.RemoveNavTreeNode(designName); // If design tab control needs to be updated if (updateDesignControl) { // Close design tab and design DisplayController.CloseDesignTab(designName); } // Close design DesignController.CloseDesign(designName, save); return(designName); }
public void CreateWindow() { // Draw text DialogBox db = new DialogBox(new Vector2(10, 0.5f), new Vector2(UIScaler.GetWidthUnits() - 20, 8), eventData.GetText()); db.AddBorder(); // Do we have a cancel button? if (eventData.qEvent.cancelable) { new TextButton(new Vector2(11, 9f), new Vector2(8f, 2), "Cancel", delegate { onCancel(); }); } // Is there a confirm button if (eventData.ConfirmPresent()) { new TextButton(new Vector2(UIScaler.GetWidthUnits() - 19, 9f), new Vector2(8f, 2), eventData.GetPass(), delegate { onConfirm(); }, eventData.GetPassColor()); // Is there a fail button if (eventData.FailPresent()) { new TextButton(new Vector2(UIScaler.GetWidthUnits() - 19, 11.5f), new Vector2(8f, 2), eventData.GetFail(), delegate { onFail(); }, eventData.GetFailColor()); } } }
override public void Update() { base.Update(); if (eventComponent.locationSpecified) { CameraController.SetCamera(eventComponent.location); } Game game = Game.Get(); string type = QuestData.Event.type; if (eventComponent is QuestData.Door) { type = QuestData.Door.type; } if (eventComponent is QuestData.Spawn) { type = QuestData.Spawn.type; } if (eventComponent is QuestData.Token) { type = QuestData.Token.type; } TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), new StringKey(null, type, false), delegate { QuestEditorData.TypeSelect(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight; tb.ApplyTag("editor"); tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1), new StringKey(null, name.Substring(type.Length), false), delegate { QuestEditorData.ListEvent(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft; tb.ApplyTag("editor"); tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); string randomButton = "Ordered"; if (eventComponent.randomEvents) { randomButton = "Random"; } tb = new TextButton(new Vector2(0, 1), new Vector2(3, 1), new StringKey("val", randomButton), delegate { ToggleRandom(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); DialogBox db = new DialogBox(new Vector2(3, 1), new Vector2(3, 1), new StringKey("val", "X_COLON", QUOTA)); db.ApplyTag("editor"); // Quota dont need translation quotaDBE = new DialogBoxEditable( new Vector2(6, 1), new Vector2(2, 1), eventComponent.quota.ToString(), delegate { SetQuota(); }); quotaDBE.ApplyTag("editor"); quotaDBE.AddBorder(); db = new DialogBox(new Vector2(8, 1), new Vector2(11, 1), new StringKey("val", "X_COLON", BUTTONS)); db.ApplyTag("editor"); tb = new TextButton(new Vector2(19, 1), new Vector2(1, 1), CommonStringKeys.PLUS, delegate { AddButton(); }, Color.green); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); int offset = 2; int button = 1; int index = 0; int lastButtonOffset = 0; buttonDBE = new List <DialogBoxEditable>(); foreach (List <string> l in eventComponent.nextEvent) { lastButtonOffset = offset; int buttonTmp = button++; StringKey buttonLabel = eventComponent.buttons[buttonTmp - 1]; string colorRGB = ColorUtil.FromName(eventComponent.buttonColors[buttonTmp - 1]); Color c = Color.white; c[0] = (float)System.Convert.ToInt32(colorRGB.Substring(1, 2), 16) / 255f; c[1] = (float)System.Convert.ToInt32(colorRGB.Substring(3, 2), 16) / 255f; c[2] = (float)System.Convert.ToInt32(colorRGB.Substring(5, 2), 16) / 255f; tb = new TextButton(new Vector2(0, offset), new Vector2(3, 1), new StringKey("val", "COLOR"), delegate { SetButtonColor(buttonTmp); }, c); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); DialogBoxEditable buttonEdit = new DialogBoxEditable( new Vector2(3, offset++), new Vector2(16, 1), buttonLabel.Translate(), delegate { UpdateButtonLabel(buttonTmp); }); buttonEdit.ApplyTag("editor"); buttonEdit.AddBorder(); buttonDBE.Add(buttonEdit); index = 0; foreach (string s in l) { int i = index++; tb = new TextButton(new Vector2(0, offset), new Vector2(1, 1), CommonStringKeys.PLUS, delegate { AddEvent(i, buttonTmp); }, Color.green); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); db = new DialogBox(new Vector2(1, offset), new Vector2(18, 1), new StringKey(null, s, false)); db.AddBorder(); db.ApplyTag("editor"); tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), CommonStringKeys.MINUS, delegate { RemoveEvent(i, buttonTmp); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } int tmp = index; tb = new TextButton(new Vector2(0, offset), new Vector2(1, 1), CommonStringKeys.PLUS, delegate { AddEvent(tmp, buttonTmp); }, Color.green); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); offset++; } if (lastButtonOffset != 0) { tb = new TextButton(new Vector2(19, lastButtonOffset), new Vector2(1, 1), CommonStringKeys.MINUS, delegate { RemoveButton(); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } if (eventComponent.locationSpecified) { game.tokenBoard.AddHighlight(eventComponent.location, "EventLoc", "editor"); } }
private static void Main() { Class283.Class284 @class = new Class283.Class284(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @class.mutex_0 = null; @class.memoryMappedFile_0 = null; @class.mutex_1 = null; Thread.CurrentThread.CurrentCulture = (Thread.CurrentThread.CurrentUICulture = Class217.cultureInfo_0); Class368 class2 = new Class368(Class291.string_17); Class373.Logger = class2; Class367 class3 = class2; if (Class283.eventHandler_0 == null) { Class283.eventHandler_0 = new EventHandler <EventArgs25>(Class283.smethod_1); } class3.LogFileCompressed += Class283.eventHandler_0; @class.bool_0 = false; @class.action_0 = new Action(@class.method_0); @class.bool_1 = false; @class.action_1 = new Action(@class.method_1); @class.action_2 = new Action(@class.method_2); @class.action_3 = new Action <Exception, string>(@class.method_3); UnhandledExceptionEventHandler value = new UnhandledExceptionEventHandler(@class.method_4); AppDomain.CurrentDomain.UnhandledException += value; ThreadExceptionEventHandler value2 = new ThreadExceptionEventHandler(@class.method_5); Application.ThreadException += value2; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Enum29 @enum = Environment.OSVersion.smethod_0(); if (@enum > Enum29.const_0 && @enum < Enum29.const_10) { DialogBox.smethod_3(Class283.string_2, Class283.string_3); Application.Exit(); return; } try { try { @class.mutex_1 = new Mutex(false, Class283.string_16); if (!(@class.bool_0 = @class.mutex_1.WaitOne())) { Environment.ExitCode = 1; Application.Exit(); } else if (Class265.smethod_1(Class283.string_15)) { Class283.smethod_0(); Environment.ExitCode = 1; Application.Exit(); } else if (Class409.Current.Flags.Contains(Class283.string_17)) { Environment.ExitCode = 0; Application.Exit(); } else if (Class409.Current.Flags.Contains(Class283.string_18)) { if (DialogBox.smethod_6(Class283.string_6, Class283.string_7, new Enum39[] { Enum39.const_5, Enum39.const_6 }) == DialogResult.Yes) { using (UninstallationCleanUp uninstallationCleanUp = new UninstallationCleanUp()) { Application.Run(uninstallationCleanUp); } } Application.Exit(); } else { try { @class.mutex_0 = new Mutex(false, Class283.string_15); } catch (Exception ex) { @class.action_1(); ex.smethod_0(); DialogBox.smethod_4(Class283.string_8, Class283.string_9); Application.Exit(); return; } if (!(@class.bool_1 = @class.mutex_0.WaitOne(TimeSpan.Zero, false))) { Class283.smethod_0(); Environment.ExitCode = 1; Application.Exit(); } else { try { @class.memoryMappedFile_0 = MemoryMappedFile.CreateNew(Class283.string_13, 4L, MemoryMappedFileAccess.ReadWrite); } catch (IOException ex2) { ex2.smethod_0(); @class.action_2(); if (Marshal.GetHRForException(ex2) == (int)Class265.uint_0) { Class283.smethod_0(); Environment.ExitCode = 1; Application.Exit(); return; } } using (Class283.icon_0 = Icon.ExtractAssociatedIcon(Application.ExecutablePath)) { Class176 instance = Class176.Instance; DateTime now = DateTime.Now; if (instance.UpdateStepOn == Enum111.const_6 || (Class110.Instance.ApplicationSettings.UpdateType != Enum78.const_3 && (now - instance.LastCheckedForUpdate).TotalDays >= 14.0)) { bool flag = false; try { using (Updater updater = new Updater(true)) { Application.Run(updater); switch (updater.UpdateResult) { case Enum43.const_4: case Enum43.const_6: flag = true; break; case Enum43.const_5: instance.UpdateStepOn = Enum111.const_0; flag = true; Application.Exit(); return; } } } finally { if (flag) { instance.LastCheckedForUpdate = now; instance.method_0(); } } } try { using (Class435 class4 = new Class435()) { EventHandler <EventArgs11> eventHandler = null; Class283.Class285 class5 = new Class283.Class285(); class5.class284_0 = @class; class5.class330_0 = new Class330(); try { Class435 class6 = class4; if (eventHandler == null) { eventHandler = new EventHandler <EventArgs11>(class5.method_0); } class6.DataReceived += eventHandler; if (@class.memoryMappedFile_0 != null) { using (MemoryMappedViewStream memoryMappedViewStream = @class.memoryMappedFile_0.CreateViewStream(0L, (long)Class283.int_0, MemoryMappedFileAccess.ReadWrite)) { using (BinaryWriter binaryWriter = new BinaryWriter(memoryMappedViewStream, Class217.encoding_0)) { binaryWriter.Write(Process.GetCurrentProcess().Id); binaryWriter.Write(class4.Handle.ToInt64()); } } } @class.action_0(); bool flag2 = Class409.Current.Flags.Contains("DEBUG"); try { if (flag2) { Class335.smethod_0(Class291.DebugLogDirectory); Class110.Instance.CreatedFileArchive.method_4(Class335.LogFile); Class335.smethod_2(Class283.string_5, false); Class335.smethod_2(Class283.string_4, false); } Application.Run(class5.class330_0); } finally { if (flag2) { Class335.smethod_2(Class283.string_5, false); Class335.smethod_1(); } } } finally { if (class5.class330_0 != null) { ((IDisposable)class5.class330_0).Dispose(); } } } } finally { Class110.smethod_1(); } } } } } finally { @class.action_0(); } } finally { @class.action_1(); @class.action_2(); Application.ThreadException -= value2; } }
void Awake() { dialogBox = DialogBox.Instance(); }
/// <summary> /// Initializes all necessary data objects. /// </summary> public DownloadSurveysStatus() { ProgressBar = new ProcessingBar(); Message = new DialogBox(); CanCancel = true; }
private void CreateAudioElements() { DialogBox db = new DialogBox(new Vector2(((0.75f * UIScaler.GetWidthUnits()) - 5), 8), new Vector2(10, 2), MUSIC); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); db.SetFont(game.gameType.GetHeaderFont()); float mVolume; string vSet = game.config.data.Get("UserConfig", "music"); float.TryParse(vSet, out mVolume); if (vSet.Length == 0) { mVolume = 1; } GameObject musicSlideObj = new GameObject("musicSlide"); musicSlideObj.tag = "dialog"; musicSlideObj.transform.parent = game.uICanvas.transform; musicSlide = musicSlideObj.AddComponent <UnityEngine.UI.Slider>(); RectTransform musicSlideRect = musicSlideObj.GetComponent <RectTransform>(); musicSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 11 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit()); musicSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit()); musicSlide.onValueChanged.AddListener(delegate { UpdateMusic(); }); new RectangleBorder(musicSlideObj.transform, Color.white, new Vector2(musicSlideRect.rect.width / UIScaler.GetPixelsPerUnit(), musicSlideRect.rect.height / UIScaler.GetPixelsPerUnit())); GameObject musicFill = new GameObject("musicfill"); musicFill.tag = "dialog"; musicFill.transform.parent = musicSlideObj.transform; musicFill.AddComponent <UnityEngine.UI.Image>(); musicFill.GetComponent <UnityEngine.UI.Image>().color = Color.white; musicSlide.fillRect = musicFill.GetComponent <RectTransform>(); musicSlide.fillRect.offsetMin = Vector2.zero; musicSlide.fillRect.offsetMax = Vector2.zero; // Double slide is a hack because I can't get a click in the space to work otherwise GameObject musicSlideObjRev = new GameObject("musicSlideRev"); musicSlideObjRev.tag = "dialog"; musicSlideObjRev.transform.parent = game.uICanvas.transform; musicSlideRev = musicSlideObjRev.AddComponent <UnityEngine.UI.Slider>(); RectTransform musicSlideRectRev = musicSlideObjRev.GetComponent <RectTransform>(); musicSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 11 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit()); musicSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit()); musicSlideRev.onValueChanged.AddListener(delegate { UpdateMusicRev(); }); musicSlideRev.direction = UnityEngine.UI.Slider.Direction.RightToLeft; GameObject musicFillRev = new GameObject("musicfillrev"); musicFillRev.tag = "dialog"; musicFillRev.transform.parent = musicSlideObjRev.transform; musicFillRev.AddComponent <UnityEngine.UI.Image>(); musicFillRev.GetComponent <UnityEngine.UI.Image>().color = Color.clear; musicSlideRev.fillRect = musicFillRev.GetComponent <RectTransform>(); musicSlideRev.fillRect.offsetMin = Vector2.zero; musicSlideRev.fillRect.offsetMax = Vector2.zero; musicSlide.value = mVolume; musicSlideRev.value = 1 - mVolume; db = new DialogBox(new Vector2(((0.75f * UIScaler.GetWidthUnits()) - 5), 14), new Vector2(10, 2), EFFECTS); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); db.SetFont(game.gameType.GetHeaderFont()); float eVolume; vSet = game.config.data.Get("UserConfig", "effects"); float.TryParse(vSet, out eVolume); if (vSet.Length == 0) { eVolume = 1; } GameObject effectSlideObj = new GameObject("effectSlide"); effectSlideObj.tag = "dialog"; effectSlideObj.transform.parent = game.uICanvas.transform; effectSlide = effectSlideObj.AddComponent <UnityEngine.UI.Slider>(); RectTransform effectSlideRect = effectSlideObj.GetComponent <RectTransform>(); effectSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 17 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit()); effectSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit()); effectSlide.onValueChanged.AddListener(delegate { UpdateEffects(); }); EventTrigger.Entry entry = new EventTrigger.Entry(); entry.eventID = EventTriggerType.PointerUp; entry.callback.AddListener(delegate { PlayTestSound(); }); effectSlideObj.AddComponent <EventTrigger>().triggers.Add(entry); new RectangleBorder(effectSlideObj.transform, Color.white, new Vector2(effectSlideRect.rect.width / UIScaler.GetPixelsPerUnit(), effectSlideRect.rect.height / UIScaler.GetPixelsPerUnit())); GameObject effectFill = new GameObject("effectFill"); effectFill.tag = "dialog"; effectFill.transform.parent = effectSlideObj.transform; effectFill.AddComponent <UnityEngine.UI.Image>(); effectFill.GetComponent <UnityEngine.UI.Image>().color = Color.white; effectSlide.fillRect = effectFill.GetComponent <RectTransform>(); effectSlide.fillRect.offsetMin = Vector2.zero; effectSlide.fillRect.offsetMax = Vector2.zero; // Double slide is a hack because I can't get a click in the space to work otherwise GameObject effectSlideObjRev = new GameObject("effectSlideRev"); effectSlideObjRev.tag = "dialog"; effectSlideObjRev.transform.parent = game.uICanvas.transform; effectSlideRev = effectSlideObjRev.AddComponent <UnityEngine.UI.Slider>(); RectTransform effectSlideRectRev = effectSlideObjRev.GetComponent <RectTransform>(); effectSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 17 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit()); effectSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit()); effectSlideRev.onValueChanged.AddListener(delegate { UpdateEffectsRev(); }); effectSlideRev.direction = UnityEngine.UI.Slider.Direction.RightToLeft; effectSlideObjRev.AddComponent <EventTrigger>().triggers.Add(entry); GameObject effectFillRev = new GameObject("effectFillRev"); effectFillRev.tag = "dialog"; effectFillRev.transform.parent = effectSlideObjRev.transform; effectFillRev.AddComponent <UnityEngine.UI.Image>(); effectFillRev.GetComponent <UnityEngine.UI.Image>().color = Color.clear; effectSlideRev.fillRect = effectFillRev.GetComponent <RectTransform>(); effectSlideRev.fillRect.offsetMin = Vector2.zero; effectSlideRev.fillRect.offsetMax = Vector2.zero; effectSlide.value = eVolume; effectSlideRev.value = 1 - eVolume; }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event. /// </summary> /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param> protected override void OnLoad(EventArgs e) { // context is ready to be loaded, call the before page load event... if (this.BeforeForumPageLoad != null) { this.BeforeForumPageLoad(this, new YafBeforeForumPageLoad()); } // "forum load" should be done by now, load the user and page... var userId = YafContext.Current.PageUserID; // add the forum header control... this._topControl = new PlaceHolder(); this.Controls.AddAt(0, this._topControl); // get the current page... string src = this.GetPageSource(); try { this._currentForumPage = (ForumPage)this.LoadControl(src); this._header = this.LoadControl("{0}controls/{1}.ascx".FormatWith(YafForumInfo.ForumServerFileRoot, "YafHeader")); this._footer = new Footer(); } catch (FileNotFoundException) { throw new ApplicationException("Failed to load {0}.".FormatWith(src)); } this._currentForumPage.ForumTopControl = this._topControl; this._currentForumPage.ForumFooter = this._footer; this._currentForumPage.ForumHeader = this._header; // only show header if showtoolbar is enabled this._currentForumPage.ForumHeader.Visible = this._currentForumPage.ShowToolBar; // don't allow as a popup if it's not allowed by the page... if (!this._currentForumPage.AllowAsPopup && this.Popup) { this.Popup = false; } // set the YafContext ForumPage... YafContext.Current.CurrentForumPage = this._currentForumPage; // add the header control before the page rendering... if (!this.Popup && YafContext.Current.Settings.LockedForum == 0) { this.Controls.AddAt(1, this._header); } // Add the LoginBox to Control, if used and User is Guest if (this.Get <YafBoardSettings>().UseLoginBox&& YafContext.Current.IsGuest && !Config.IsAnyPortal && Config.AllowLoginAndLogoff) { this.Controls.Add( this.LoadControl("{0}controls/{1}.ascx".FormatWith(YafForumInfo.ForumServerFileRoot, "LoginBox"))); } this._notificationBox = (DialogBox) this.LoadControl("{0}controls/{1}.ascx".FormatWith(YafForumInfo.ForumServerFileRoot, "DialogBox")); this._currentForumPage.Notification = this._notificationBox; this.Controls.Add(this._notificationBox); this.Controls.Add(this._currentForumPage); // add the footer control after the page... if (!this.Popup && YafContext.Current.Settings.LockedForum == 0) { this.Controls.Add(this._footer); } // Add cookie consent var cookieName = "YAF-AcceptCookies"; if (YafContext.Current.Get <HttpRequestBase>().Cookies[cookieName] == null && this.Get <YafBoardSettings>().ShowCookieConsent) { // Add cookie consent this.Controls.Add( this.LoadControl("{0}controls/CookieConsent.ascx".FormatWith(YafForumInfo.ForumServerFileRoot))); } // load plugins/functionality modules if (this.AfterForumPageLoad != null) { this.AfterForumPageLoad(this, new YafAfterForumPageLoad()); } base.OnLoad(e); }
/// <summary> /// Constructor /// </summary> /// <param name="dialogBox"></param> /// <param name="content"></param> public DialogBoxForm(DialogBox dialogBox, Control content) : this(dialogBox.Title, content, dialogBox.Size, dialogBox.SizeHint, dialogBox.AllowUserResize) { }
public TextBox(DialogBox dialogOwner) : base(dialogOwner) { }
void Start () { conversationTarget = Instantiate<GameObject>(conversationTargetPrefab.gameObject).GetComponent<CameraTarget>(); camera = FindObjectOfType<CameraFollow>(); dialog = FindObjectOfType<DialogBox>(); }
public void Hide(bool suppressEvents) { currentDialog = null; if (!suppressEvents) { onHide.ForEach(s => s.Fire()); } state = DialogState.Hidden; if (CharacterPortrait != null) CharacterPortrait.enabled = false; }
void Awake() { gameManager = GameObject.Find("GameManager").GetComponent<GameManager>(); dialogBox = GameObject.Find("DialogBoxText").GetComponent<DialogBox>(); }
public static DialogBox LaunchDialogBox(GameObject speakerObj, DialogBoxSize size = DialogBoxSize.Medium) { if (staticBox == null) { DialogBox dialogbox = Resources.Load<DialogBox>("ChatBox"); staticBox = Instantiate<DialogBox>(dialogbox); } staticBox.SetSpeaker(speakerObj); staticBox.SetSize(size); staticBox.Hide(false); staticBox.ClearText(); return staticBox; }
private void gameLost() { DialogBox dialog = new DialogBox(this, "Dėja Jūs pralaimėjote.\nNorite žaisti dar kartą?", DialogBox.Type.QUESTION_DIALOG); dialog.Owner = this; bool? result = dialog.ShowDialog(); if (result.HasValue && result.Value) { this.restart(); } else { this.Close(); this.parent.Show(); } }
private async void OnValidateConnection() { var result = await ValidateAsync(); await DialogBox.ShowAsync(result); }
public void Show(bool suppressEvents) { //textObject.fontSize = (int)(Screen.width / fontToScreenWidthRatio); if (currentDialog) { currentDialog.Hide(true); } currentDialog = this; if (!suppressEvents) { onShow.ForEach(s => s.Fire()); } fullText = prefix + dialogText; visibleText = prefix; delayTimer = 0.0f; letterTimer = 0.0f; letterIndex = prefix.Length; state = DialogState.Unhiding; }
private void showNewLevelDialog() { DialogBox dialog = new DialogBox(this, "Sveikiname! Jūs pereinate į aukštensnį lygi.", DialogBox.Type.INFO_DIALOG); dialog.Owner = this; dialog.ShowDialog(); }
private void btnWait_Click(object sender, EventArgs e) { DialogBox.ShowWait("بابا جان صبر کن دیگه ..."); }
private void Start() { LayoutGroup = GetComponentInChildren<HorizontalLayoutGroup>(); UiScripts = GameObject.FindObjectOfType<IngameFunctions>(); //Achievements = GameObject.FindObjectOfType<AchievementsRecord>(); Ads = GameObject.FindObjectOfType<FullScreenAds>(); Dialogs = GameObject.FindObjectOfType<DialogBox>(); scrollBar = gameObject.GetComponentInChildren<Scrollbar>(); TotalSize = BasicPalette.Count + 1; //1 for rainbow PaletteList = new List<Image>(TotalSize); WasColorUsed = new List<bool>(BasicPalette.Count); AddColors(); OnSelectNewColor(1); }
private void btnCloseWait_Click(object sender, EventArgs e) { DialogBox.CloseWait(); }
private void TriggerDialogBox(DialogBoxResponse response) { server.DialogBoxResponse(CurrentDialogBox.DialogId, CurrentDialogBox.MenuId, response.Index, response.Type, response.Color); CurrentDialogBox = null; }
private void Cancel_OnClick(object sender, RoutedEventArgs e) { DialogBox.CloseDialog(); }
/// <summary> /// Save /// </summary> internal void Save() { if (Viewer.txtPatName.Tag == null) { DialogBox.Msg("请先调出患者信息。"); return; } EntityPatientInfo patVo = Viewer.txtPatName.Tag as EntityPatientInfo; try { uiHelper.BeginLoading(Viewer); string fieldName = string.Empty; DateTime dtmNow = Utils.ServerTime(); EntityRptZrbbg vo = new EntityRptZrbbg(); vo.xmlData = Viewer.showPanelForm.XmlData(); if (Viewer.showPanelForm.IsAllowSave == false) { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + Viewer.showPanelForm.HintInfo); return; } vo.rptId = Function.Dec(this.ZrbbgDisplayVo.rptId); vo.reportId = this.ZrbbgDisplayVo.reportId; vo.reportDate = this.ZrbbgDisplayVo.reportDate; vo.bcDate = this.ZrbbgDisplayVo.bcDate; vo.skDate = this.ZrbbgDisplayVo.skDate; //vo.contactAddr = this.ZrbbgDisplayVo.contactAddr; // 报告时间 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "reportDate")) { string reportDate = string.Empty; fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "reportDate").keyValue; reportDate = Viewer.showPanelForm.GetItemInfo(fieldName); if (string.IsNullOrEmpty(reportDate) && string.IsNullOrEmpty(vo.reportDate)) { vo.reportDate = dtmNow.ToString("yyyy-MM-dd HH:mm"); } else if (!string.IsNullOrEmpty(reportDate)) { vo.reportDate = reportDate; } } else { vo.reportDate = dtmNow.ToString("yyyy-MM-dd HH:mm"); } // 编号 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "registerCode")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "registerCode").keyValue; vo.registerCode = Viewer.showPanelForm.GetItemInfo(fieldName); } else { vo.registerCode = Function.Datetime(vo.reportDate).ToString("MMdd") + patVo.pid; } // 报告人 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "reportOperCode")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "reportOperCode").keyValue; vo.reportOperName = Viewer.showPanelForm.GetItemInfo(fieldName); if (GlobalDic.DataSourceEmployee.Any(t => t.operName == vo.reportOperName)) { vo.reportOperCode = GlobalDic.DataSourceEmployee.FirstOrDefault(t => t.operName == vo.reportOperName).operCode; } } else { vo.reportOperCode = GlobalLogin.objLogin.EmpNo; vo.reportOperName = GlobalLogin.objLogin.EmpName; } // 上报科室 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "reportDept")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "reportDept").keyValue; string reportDeptName = Viewer.showPanelForm.GetItemInfo(fieldName); using (ProxyAdverseEvent proxy = new ProxyAdverseEvent()) { vo.reportDeptCode = proxy.Service.GetDeptCode(reportDeptName); } } else { vo.reportDeptCode = patVo.deptCode; } // 户籍地址 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "fimalyAddr")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "fimalyAddr"); // 计算类 if (parm.flag == 3) { string addr = string.Empty; string[] fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { addr += Viewer.showPanelForm.GetItemInfo(fieldSub); if (fieldSub == "ADDR1" && !string.IsNullOrEmpty(addr)) { vo.familyAddr += addr + "省"; } if (fieldSub == "ADDR2" && !string.IsNullOrEmpty(addr)) { vo.familyAddr += addr + "市"; } if (fieldSub == "ADDR3" && !string.IsNullOrEmpty(addr)) { vo.familyAddr += addr + "县"; } if (fieldSub == "ADDR4" && !string.IsNullOrEmpty(addr)) { vo.familyAddr += addr + "镇"; } if (fieldSub == "ADDR5" && !string.IsNullOrEmpty(addr)) { vo.familyAddr += addr + "村"; } if (fieldSub == "ADDR6" && !string.IsNullOrEmpty(addr)) { vo.familyAddr += addr; } addr = string.Empty; } } else if (parm.flag == 1) { string[] fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { vo.familyAddr += Viewer.showPanelForm.GetItemInfo(fieldSub); } } else { fieldName = parm.keyValue; vo.familyAddr = Viewer.showPanelForm.GetItemInfo(fieldName); } } // 现地址 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "contactAddr")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "contactAddr"); // 计算类 if (parm.flag == 3) { string addr = string.Empty; string[] fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { addr += Viewer.showPanelForm.GetItemInfo(fieldSub); if (fieldSub == "ADDR1" && !string.IsNullOrEmpty(addr)) { vo.contactAddr += addr + "省"; } if (fieldSub == "ADDR2" && !string.IsNullOrEmpty(addr)) { vo.contactAddr += addr + "市"; } if (fieldSub == "ADDR3" && !string.IsNullOrEmpty(addr)) { vo.contactAddr += addr + "县"; } if (fieldSub == "ADDR4" && !string.IsNullOrEmpty(addr)) { vo.contactAddr += addr + "镇"; } if (fieldSub == "ADDR5" && !string.IsNullOrEmpty(addr)) { vo.contactAddr += addr + "村"; } if (fieldSub == "ADDR6" && !string.IsNullOrEmpty(addr)) { vo.contactAddr += addr; } addr = string.Empty; } } else if (parm.flag == 1) { string[] fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { vo.contactAddr += Viewer.showPanelForm.GetItemInfo(fieldSub); } } else { fieldName = parm.keyValue; vo.contactAddr = Viewer.showPanelForm.GetItemInfo(fieldName); } } // 诊断病名 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "diagnoseName")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "diagnoseName"); // 计算类 if (parm.flag == 2) { string[] fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { if (fieldSub.Contains("|")) { string[] str = fieldSub.Split('|'); string flg = Viewer.showPanelForm.GetItemInfo(str[0]); if (flg == "1") { vo.diagnoseName += str[1] + "、"; } } else { vo.diagnoseName += Viewer.showPanelForm.GetItemInfo(fieldSub); } } if (!string.IsNullOrEmpty(vo.diagnoseName)) { vo.diagnoseName = vo.diagnoseName.TrimEnd('、'); } else { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + "诊断病名必须勾选或填写"); return; } } else { fieldName = parm.keyValue; vo.diagnoseName = Viewer.showPanelForm.GetItemInfo(fieldName); } } // 诊断日期 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "diagnoseDate")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "diagnoseDate").keyValue; vo.diagnoseDate = Viewer.showPanelForm.GetItemInfo(fieldName); if (vo.diagnoseDate.IndexOf("00:00") > 0) { DialogBox.Msg("诊断日期时间不能为 00:00,请检查。项目:\r\n"); return; } } // 发病日期 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "infectiveDate")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "infectiveDate").keyValue; vo.infectiveDate = Viewer.showPanelForm.GetItemInfo(fieldName); } // 收卡日期 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "skDate")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "skDate").keyValue; vo.skDate = Viewer.showPanelForm.GetItemInfo(fieldName); } // 网报日期 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "bcDate")) { string bcDate = string.Empty; fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "bcDate").keyValue; bcDate = Viewer.showPanelForm.GetItemInfo(fieldName); if (string.IsNullOrEmpty(bcDate) && string.IsNullOrEmpty(vo.bcDate)) { vo.bcDate = dtmNow.ToString("yyyy-MM-dd HH:mm"); } else if (!string.IsNullOrEmpty(bcDate)) { vo.bcDate = bcDate; } } else { vo.bcDate = dtmNow.ToString("yyyy-MM-dd HH:mm"); } // 收卡日期 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "skDate")) { string skDate = string.Empty; fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "skDate").keyValue; skDate = Viewer.showPanelForm.GetItemInfo(fieldName); if (string.IsNullOrEmpty(skDate) && string.IsNullOrEmpty(vo.skDate)) { vo.skDate = dtmNow.ToString("yyyy-MM-dd HH:mm"); } else if (!string.IsNullOrEmpty(skDate)) { vo.skDate = skDate; } } else { vo.bcDate = dtmNow.ToString("yyyy-MM-dd HH:mm"); } // 家长姓名 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "parentName")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "parentName").keyValue; vo.parentName = Viewer.showPanelForm.GetItemInfo(fieldName); } // 有效证件号 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "idCard")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "idCard").keyValue; vo.idCard = Viewer.showPanelForm.GetItemInfo(fieldName); } // 备注 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "bz")) { fieldName = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "bz").keyValue; vo.BZ = Viewer.showPanelForm.GetItemInfo(fieldName); } // 人群分类 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "rqfl")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "rqfl"); // 计算类 if (parm.flag == 2) { string[] fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { string[] str = fieldSub.Split('|'); string flg = Viewer.showPanelForm.GetItemInfo(str[0]); if (flg == "1") { vo.RQFL += str[1] + "、"; } } if (!string.IsNullOrEmpty(vo.RQFL)) { vo.RQFL = vo.RQFL.TrimEnd('、'); } } else { fieldName = parm.keyValue; vo.RQFL = Viewer.showPanelForm.GetItemInfo(fieldName); } if (string.IsNullOrEmpty(vo.RQFL)) { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + "人群分类或职业不能为空"); return; } } // 必填项目 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "required")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "required"); string required = string.Empty; bool flg = false; string[] fieldNames; // 计算类 if (parm.flag != 0) { fieldNames = parm.keyValue.Split('+'); for (int i = 0; i < parm.flag; i++) { required = Viewer.showPanelForm.GetItemInfo(fieldNames[i]); if (required == "1") { flg = true; break; } } if (flg) { string str = string.Empty; string strRequer = string.Empty; for (int i = Function.Int(parm.flag); i < fieldNames.Length; i++) { string[] strNames = fieldNames[i].Split('|'); str = Viewer.showPanelForm.GetItemInfo(strNames[0]); if (string.IsNullOrEmpty(str)) { strRequer += strNames[1] + Environment.NewLine; } } if (!string.IsNullOrEmpty(strRequer)) { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + strRequer); return; } } } } //肿瘤诊断依据必填 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "zdyj")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "zdyj"); string required = string.Empty; bool flg = false; string[] fieldNames; if (parm.flag != 0) { fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { required = Viewer.showPanelForm.GetItemInfo(fieldSub); if (required == "1") { flg = true; break; } } } if (!flg) { DialogBox.Msg("存在必填项目没有处理,诊断依据必选。"); return; } } // 提示 string lbTips = string.Empty; string mdTips = string.Empty; if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "lbTips")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "lbTips"); string lbFlg = string.Empty; string[] fieldNames = parm.keyValue.Split('+'); if (parm.flag == 1) { foreach (string fieldSub in fieldNames) { lbFlg = Viewer.showPanelForm.GetItemInfo(fieldSub); if (lbFlg == "1") { break; } } } else { fieldName = parm.keyValue; lbFlg = Viewer.showPanelForm.GetItemInfo(fieldName); } if (lbFlg == "1") { lbTips = "请填写\r\n传染病报告卡艾滋病性病附卡。 \r\n"; } } if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "mdTips")) { EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "mdTips"); string mdFlg = string.Empty; string[] fieldNames = parm.keyValue.Split('+'); if (parm.flag == 1) { foreach (string fieldSub in fieldNames) { mdFlg = Viewer.showPanelForm.GetItemInfo(fieldSub); if (mdFlg == "1") { break; } } } else { fieldName = parm.keyValue; mdFlg = Viewer.showPanelForm.GetItemInfo(fieldName); } if (mdFlg == "1") { mdTips = "传染病报告卡(梅毒)附卡。 \r\n"; } } if (!string.IsNullOrEmpty(lbTips) || !string.IsNullOrEmpty(mdTips)) { DialogBox.Msg(lbTips + mdTips); } //性别 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "sex")) { string[] fieldNames; string sex = string.Empty; EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "sex"); if (parm.flag != 0) { fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { sex = Viewer.showPanelForm.GetItemInfo(fieldSub); if (sex != "0") { break; } } if (sex == "0") { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + "性别"); return; } } } //TRUST/RPR if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "TRUST/RPR")) { string[] fieldNames; string tFlg = string.Empty; EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "TRUST/RPR"); if (parm.flag != 0) { fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { tFlg = Viewer.showPanelForm.GetItemInfo(fieldSub); if (tFlg != "0") { break; } } if (tFlg == "0") { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + "TRUST/RPR"); return; } } } //TPPA/TPHA if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "TPPA/TPHA")) { string[] fieldNames; string tFlg = string.Empty; EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "TPPA/TPHA"); if (parm.flag != 0) { fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { tFlg = Viewer.showPanelForm.GetItemInfo(fieldSub); if (tFlg != "0") { break; } } if (tFlg == "0") { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + "TPPA/TPHA"); return; } } } //传染来源 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "zrly")) { string[] fieldNames; string zrly = string.Empty; EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "zrly"); if (parm.flag != 0) { fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { zrly = Viewer.showPanelForm.GetItemInfo(fieldSub); if (zrly != "0") { break; } } if (zrly == "0") { DialogBox.Msg("存在必填项目没有处理,请检查。项目:\r\n" + "传染来源"); return; } } } if (!string.IsNullOrEmpty(patVo.ipNo) && patVo.ipTimes > 0) { vo.patNo = patVo.ipNo; } else { vo.patNo = patVo.cardNo; } vo.patName = patVo.name; vo.patSex = patVo.sex; if (!string.IsNullOrEmpty(patVo.birth)) { vo.birthday = Function.Datetime(patVo.birth); } vo.contactTel = patVo.contTel; //vo.deptCode = patVo.deptCode; vo.xmlData = Viewer.showPanelForm.XmlData(); vo.formId = this.formId; vo.operCode = GlobalLogin.objLogin.EmpNo; vo.recordDate = dtmNow; vo.status = 1; vo.patType = Viewer.rdoFlag.SelectedIndex + 1; string reqNo = patVo.clNo; using (ProxyAdverseEvent proxy = new ProxyAdverseEvent()) { decimal rptId = 0; if (proxy.Service.SaveZrbbg(vo, out rptId) > 0) { Viewer.IsSave = true; if (this.ZrbbgDisplayVo.isNew) { this.ZrbbgDisplayVo.rptId = rptId; } Viewer.txtCardNo.Properties.ReadOnly = true; //病毒性肝炎 if (ZrbbgParmData.Any(t => t.reportId == vo.reportId && t.keyId == "ygfk")) { string[] fieldNames; EntityRptZrbbgParm parm = ZrbbgParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "ygfk"); string ygfk = string.Empty; if (parm.flag != 0) { fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { ygfk = Viewer.showPanelForm.GetItemInfo(fieldSub); if (ygfk != "0") { frmZrbygfk frm = new frmZrbygfk(vo.rptId); frm.ShowDialog(); break; } } if (ygfk == "0") { proxy.Service.RegisterZrbygfk(vo.rptId, null); } } } DialogBox.Msg("数据保存成功!"); } else { DialogBox.Msg("数据保存失败。"); } } } finally { uiHelper.CloseLoading(Viewer); } }
override public void Update() { base.Update(); Game game = Game.Get(); TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(6, 1), "UniqueMonster", delegate { QuestEditorData.TypeSelect(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight; tb.ApplyTag("editor"); tb = new TextButton(new Vector2(6, 0), new Vector2(13, 1), name.Substring("UniqueMonster".Length), delegate { QuestEditorData.ListUniqueMonster(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft; tb.ApplyTag("editor"); tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(3, 1), "Base:"); db.ApplyTag("editor"); tb = new TextButton(new Vector2(3, 2), new Vector2(18, 1), monsterComponent.baseMonster, delegate { SetBase(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); db = new DialogBox(new Vector2(0, 4), new Vector2(3, 1), "Name:"); db.ApplyTag("editor"); if (monsterComponent.baseMonster.Length == 0 || monsterComponent.monsterName.Length > 0) { nameDBE = new DialogBoxEditable(new Vector2(3, 4), new Vector2(14, 1), monsterComponent.monsterName, delegate { UpdateName(); }); nameDBE.ApplyTag("editor"); nameDBE.AddBorder(); if (monsterComponent.baseMonster.Length > 0) { tb = new TextButton(new Vector2(17, 4), new Vector2(3, 1), "Reset", delegate { ClearName(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } } else { tb = new TextButton(new Vector2(17, 4), new Vector2(3, 1), "Set", delegate { SetName(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } //string imagePath //string imagePlace db = new DialogBox(new Vector2(0, 6), new Vector2(17, 1), "Info:"); db.ApplyTag("editor"); if (monsterComponent.baseMonster.Length == 0 || monsterComponent.info.key.Length > 0) { infoDBE = new DialogBoxEditable(new Vector2(0, 7), new Vector2(20, 8), monsterComponent.info.Translate(), delegate { UpdateInfo(); }); infoDBE.ApplyTag("editor"); infoDBE.AddBorder(); if (monsterComponent.baseMonster.Length > 0) { tb = new TextButton(new Vector2(17, 6), new Vector2(3, 1), "Reset", delegate { ClearInfo(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } } else { tb = new TextButton(new Vector2(17, 6), new Vector2(3, 1), "Set", delegate { SetInfo(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } //string[] activations //string[] traits db = new DialogBox(new Vector2(0, 15), new Vector2(3, 1), "Health:"); db.ApplyTag("editor"); if (monsterComponent.baseMonster.Length == 0 || monsterComponent.healthDefined) { healthDBE = new DialogBoxEditable(new Vector2(3, 15), new Vector2(14, 1), monsterComponent.health.ToString(), delegate { UpdateHealth(); }); healthDBE.ApplyTag("editor"); healthDBE.AddBorder(); if (monsterComponent.baseMonster.Length > 0) { tb = new TextButton(new Vector2(17, 15), new Vector2(3, 1), "Reset", delegate { ClearHealth(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } } else { tb = new TextButton(new Vector2(17, 15), new Vector2(3, 1), "Set", delegate { SetHealth(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb.ApplyTag("editor"); } }
void Awake() { dialogBox = GameObject.Find("DialogBox").GetComponent <DialogBox>(); }
/*---------------------------------------------------- INITIALISATION ----------------------------------------------------*/ public void Initialisation() { consoleCameraControl = transform.FindChild("ConsoleCamera").GetComponent<ConsoleCameraControl>(); gameManager = GameObject.Find("GameManager").GetComponent<GameManager>(); powerManager = gameManager.gameObject.GetComponent<PowerManager>(); rooms = GameObject.FindGameObjectsWithTag("Room"); unpowerAllButton = GameObject.Find("Unpower All Button"); button_UnpowerAll = unpowerAllButton.GetComponent<Button>(); button_UnpowerAll.onClick.AddListener(UnpowerAllSwitchables); unpowerAllButton.GetComponent<Button>().onClick.AddListener(UnpowerAllSwitchables); switchableLayerMask = LayerMask.GetMask("ConsoleInteraction"); roomLayerMask = LayerMask.GetMask("Room"); powerOffAll = KeyCode.C; playerControl = gameManager.myPlayer.GetComponent<PlayerControl>(); dialogBox = GameObject.Find("DialogBoxText").GetComponent<DialogBox>(); }
// Open component selection top level // Menu for selection of all component types, includes delete options public static void TypeSelect() { Game game = Game.Get(); if (GameObject.FindGameObjectWithTag("dialog") != null) { return; } // Border DialogBox db = new DialogBox(new Vector2(21, 0), new Vector2(18, 26), ""); db.AddBorder(); // Heading db = new DialogBox(new Vector2(21, 0), new Vector2(17, 1), "Select Type"); // Buttons for each component type (and delete buttons) TextButton tb = new TextButton(new Vector2(22, 2), new Vector2(9, 1), "Quest", delegate { SelectQuest(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 4), new Vector2(9, 1), "Tile", delegate { ListTile(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 4), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Tile"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 6), new Vector2(9, 1), "Door", delegate { ListDoor(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 6), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Door"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 8), new Vector2(9, 1), "Token", delegate { ListToken(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 8), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Token"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 10), new Vector2(9, 1), "Monster", delegate { ListMonster(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 10), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Monster"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 12), new Vector2(9, 1), "MPlace", delegate { ListMPlace(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 12), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("MPlace"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 14), new Vector2(9, 1), "Event", delegate { ListEvent(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 14), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Event"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 16), new Vector2(9, 1), "Puzzle", delegate { ListPuzzle(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 16), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Puzzle"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 18), new Vector2(9, 1), "Item", delegate { ListItem(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 18), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Item"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 20), new Vector2(9, 1), "UniqueMonster", delegate { ListUniqueMonster(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 20), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("UniqueMonster"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(22, 22), new Vector2(9, 1), "Activation", delegate { ListActivation(); }); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(32, 22), new Vector2(6, 1), "Delete", delegate { game.qed.DeleteComponent("Activation"); }, Color.red); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); tb = new TextButton(new Vector2(25.5f, 24), new Vector2(9, 1), "Cancel", delegate { Cancel(); }); tb.background.GetComponent <UnityEngine.UI.Image>().color = new Color(0.03f, 0.0f, 0f); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont(); }
// Destroy list, call on cancel public void SelectItem(UnityEngine.Events.UnityAction call) { Destroyer.Dialog(); cancelCall = call; float windowSize = 22; if (traits.Count > 10) { windowSize = 36; } float windowEdge = UIScaler.GetHCenter(windowSize / -2); // Border UIElement ui = new UIElement(); ui.SetLocation(windowEdge, 0, windowSize, 30); new UIElementBorder(ui); // Title ui = new UIElement(); ui.SetLocation(UIScaler.GetHCenter(-10), 0, 20, 1); ui.SetText(title); // Create a list of traits of all items in the list List <SelectionListEntry> filtered = items; if (filter.Count > 0) { filtered = new List <SelectionListEntry>(); foreach (SelectionListEntry e in items) { bool valid = true; foreach (string s in filter) { if (!e.filter.Contains(s)) { valid = false; break; } } if (valid) { filtered.Add(e); } } } float offset = 2f; float hOffset = windowEdge + 1; // Create filter traits buttons foreach (string trait in traits) { // Traits are in val dictionary float width = UIElement.GetStringWidth(new StringKey(VAL, trait)); if (hOffset + width > windowEdge + windowSize - 1) { hOffset = windowEdge + 1; offset++; } string tmp = trait; ui = new UIElement(); ui.SetLocation(hOffset, offset, width, 1); Color c = Color.white; if (filter.Count == 0) { ui.SetButton(delegate { SetFilter(trait); }); } else if (filter.Contains(trait)) { ui.SetButton(delegate { ClearFilter(trait); }); } else { bool valid = false; foreach (SelectionListEntry e in filtered) { if (e.filter.Contains(tmp)) { valid = true; break; } } if (valid) { ui.SetButton(delegate { SetFilter(trait); }); c = Color.gray; } else { c = new Color(0.5f, 0, 0); } } ui.SetText(new StringKey(VAL, tmp), c); new UIElementBorder(ui); hOffset += width; } if (traits.Count > 0) { offset += 2; } // Scroll BG float scrollStart = offset; DialogBox db = new DialogBox(new Vector2(UIScaler.GetHCenter(-10.5f), offset), new Vector2(21, 27 - offset), StringKey.NULL); db.AddBorder(); db.background.AddComponent <UnityEngine.UI.Mask>(); UnityEngine.UI.ScrollRect scrollRect = db.background.AddComponent <UnityEngine.UI.ScrollRect>(); GameObject scrollArea = new GameObject("scroll"); RectTransform scrollInnerRect = scrollArea.AddComponent <RectTransform>(); scrollArea.transform.SetParent(db.background.transform); scrollInnerRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, 0, 20 * UIScaler.GetPixelsPerUnit()); scrollInnerRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 0, 1); GameObject scrollBarObj = new GameObject("scrollbar"); scrollBarObj.transform.SetParent(db.background.transform); RectTransform scrollBarRect = scrollBarObj.AddComponent <RectTransform>(); scrollBarRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 0, (27 - offset) * UIScaler.GetPixelsPerUnit()); scrollBarRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, 20 * UIScaler.GetPixelsPerUnit(), 1 * UIScaler.GetPixelsPerUnit()); UnityEngine.UI.Scrollbar scrollBar = scrollBarObj.AddComponent <UnityEngine.UI.Scrollbar>(); scrollBar.direction = UnityEngine.UI.Scrollbar.Direction.BottomToTop; scrollRect.verticalScrollbar = scrollBar; GameObject scrollBarHandle = new GameObject("scrollbarhandle"); scrollBarHandle.transform.SetParent(scrollBarObj.transform); scrollBarHandle.AddComponent <UnityEngine.UI.Image>(); scrollBarHandle.GetComponent <UnityEngine.UI.Image>().color = new Color(0.7f, 0.7f, 0.7f); scrollBar.handleRect = scrollBarHandle.GetComponent <RectTransform>(); scrollBar.handleRect.offsetMin = Vector2.zero; scrollBar.handleRect.offsetMax = Vector2.zero; scrollRect.content = scrollInnerRect; scrollRect.horizontal = false; scrollRect.scrollSensitivity = 27f; for (int i = 0; i < filtered.Count; i++) { // Print the name but select the key string key = filtered[i].key; ui = new UIElement(scrollArea.transform); ui.SetLocation(0, (i * 1.05f), 20, 1); if (key != null) { ui.SetButton(delegate { SelectComponent(key); }); } ui.SetBGColor(Color.white); ui.SetText(filtered[i].name, Color.black); } float scrollsize = filtered.Count * 1.05f; if (scrollsize < 28) { scrollsize = 28; } scrollInnerRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 0, scrollsize * UIScaler.GetPixelsPerUnit()); // Cancel button ui = new UIElement(); ui.SetLocation(UIScaler.GetHCenter(-4.5f), 28, 9, 1); ui.SetBGColor(new Color(0.03f, 0.0f, 0f)); ui.SetText(CommonStringKeys.CANCEL); ui.SetButton(cancelCall); new UIElementBorder(ui); }
// Create a menu which will take up the whole screen and have options. All items are dialog for destruction. public GameSelection() { // This will destroy all Destroyer.Destroy(); Game game = Game.Get(); game.gameType = new NoGameType(); fcD2E = new FetchContent("D2E"); fcMoM = new FetchContent("MoM"); // Name. We should replace this with a banner DialogBox db = new DialogBox(new Vector2(2, 1), new Vector2(UIScaler.GetWidthUnits() - 4, 3), "Valkyrie"); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetLargeFont(); Color startColor = Color.white; if (fcD2E.NeedImport()) { startColor = Color.gray; } TextButton tb = new TextButton(new Vector2((UIScaler.GetWidthUnits() - 30) / 2, 10), new Vector2(30, 4f), "Descent: Journeys in the Dark Second Edition", delegate { D2E(); }, startColor); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); tb.background.GetComponent <UnityEngine.UI.Image>().color = new Color(0, 0.03f, 0f); if (fcD2E.importAvailable) { if (fcD2E.NeedImport()) { tb = new TextButton(new Vector2((UIScaler.GetWidthUnits() - 10) / 2, 14.2f), new Vector2(10, 2f), "Import Content", delegate { Import("D2E"); }); tb.background.GetComponent <UnityEngine.UI.Image>().color = new Color(0, 0.03f, 0f); } else { tb = new TextButton(new Vector2((UIScaler.GetWidthUnits() - 10) / 2, 14.2f), new Vector2(10, 2f), "Reimport Content", delegate { Import("D2E"); }); tb.background.GetComponent <UnityEngine.UI.Image>().color = new Color(0, 0.03f, 0f); } } else { db = new DialogBox(new Vector2((UIScaler.GetWidthUnits() - 10) / 2, 14.2f), new Vector2(10, 2f), "Import Unavailable", Color.red); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); db.AddBorder(); } startColor = Color.white; if (fcMoM.NeedImport()) { startColor = Color.gray; } tb = new TextButton(new Vector2((UIScaler.GetWidthUnits() - 30) / 2, 19), new Vector2(30, 4f), "Mansions of Madness Second Edition", delegate { MoM(); }, startColor); tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); tb.background.GetComponent <UnityEngine.UI.Image>().color = new Color(0, 0.03f, 0f); if (fcMoM.importAvailable) { if (fcMoM.NeedImport()) { tb = new TextButton(new Vector2((UIScaler.GetWidthUnits() - 10) / 2, 23.2f), new Vector2(10, 2f), "Import Content", delegate { Import("MoM"); }); tb.background.GetComponent <UnityEngine.UI.Image>().color = new Color(0, 0.03f, 0f); } else { tb = new TextButton(new Vector2((UIScaler.GetWidthUnits() - 10) / 2, 23.2f), new Vector2(10, 2f), "Reimport Content", delegate { Import("MoM"); }); tb.background.GetComponent <UnityEngine.UI.Image>().color = new Color(0, 0.03f, 0f); } } else { db = new DialogBox(new Vector2((UIScaler.GetWidthUnits() - 10) / 2, 23.2f), new Vector2(10, 2f), "Import Unavailable", Color.red); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); db.AddBorder(); } new TextButton(new Vector2(1, UIScaler.GetBottom(-3)), new Vector2(8, 2), "Exit", delegate { Exit(); }, Color.red); }
void Awake() { dialog = FindObjectOfType<DialogBox>(); grayscale = FindObjectOfType<Grayscale>(); gameMenu = FindObjectOfType<GameMenu>(); }
private void buttonRemplir_Click_1(object sender, EventArgs e) { if (!tourActif) { DialogBox.Show("Non didju, c'est pas ton tour petit con !"); return; } Point caseCourante = new Point(0, Map.CasesY - 1); // position de la pièce à placer List <Point> listeCases = new List <Point>(40); // liste les coordonnées des cases disponibles Random positionAleatoire = new Random(); int positionChoisie; // id du point de la liste sélectionné aléatoirement if (buttonRemplir.Text.Contains("rouges")) { caseCourante.Y = 3; } // création de la liste for (int i = 0; i < 40; i++) { if (partieActuelle.Jeu.Map.GetPiece(caseCourante) == null) { listeCases.Add(caseCourante); } caseCourante.X++; if (caseCourante.X == 10) { caseCourante.X = 0; caseCourante.Y--; } } // génère une pièce pour chaque Point de la liste foreach (KeyValuePair <string, int> piece in partieActuelle.MenuContextuel.PiecesRestantes()) { for (int repetitionPiece = 0; repetitionPiece < piece.Value; repetitionPiece++) { positionChoisie = positionAleatoire.Next(listeCases.Count); partieActuelle.Jeu.GenereUnePiece(piece.Key, listeCases[positionChoisie]); listeCases.RemoveAt(positionChoisie); } } partieActuelle.MenuContextuel.GenereMenu(); // si le bouton s'applique aux rouges if (buttonRemplir.Text.Contains("rouges")) { buttonRemplir.Enabled = false; buttonRemplir.Visible = false; partieActuelle.MenuContextuel.DesactiveMenuContextuel(); } else // sinon aux bleus { buttonRemplir.Text = buttonRemplir.Text.Replace("bleus", "rouges"); } if (Personnage.GetNombrePieces() % 40 == 0) { partieActuelle.Jeu.ChangeTour(); } pictureBox1.Invalidate(); }
// Token: 0x06001615 RID: 5653 RVA: 0x00035214 File Offset: 0x00033414 public static ToonTownParentForm smethod_2(Form parent) { ToonTownParentForm.Class115 @class = new ToonTownParentForm.Class115(); @class.form_0 = parent; @class.class141_0 = new Class141(); if (ToonTownParentForm.smethod_1(@class.class141_0, @class.form_0)) { Func <bool> func = null; ToonTownParentForm.Class116 class2 = new ToonTownParentForm.Class116(); class2.class115_0 = @class; class2.intptr_0 = @class.class141_0.MainWindowHandle; Enum79 @enum = (Enum79)Class265.smethod_2(class2.intptr_0, Enum55.const_3); if (@enum.HasFlag(Enum79.flag_19) && @enum.HasFlag(Enum79.flag_14) && @enum.HasFlag(Enum79.flag_9)) { ToonTownParentForm.Class117 class3 = new ToonTownParentForm.Class117(); class3.class116_0 = class2; class3.class115_0 = @class; class3.int_0 = @class.class141_0.Process.Id; ToonTownParentForm.hashSet_0.Add(class3.int_0); Rectangle bounds; FormWindowState formWindowState = Class410.smethod_22(new HandleRef(@class.form_0, class2.intptr_0), out bounds); @enum &= ~(Enum79.flag_9 | Enum79.flag_10); @enum &= ~Enum79.flag_14; @enum |= Enum79.flag_2; @enum &= ~Enum79.flag_1; @enum &= ~Enum79.flag_9; Class265.smethod_4(class2.intptr_0, Enum55.const_3, (int)@enum); IntPtr handle = Class265.smethod_3(new HandleRef(@class.form_0, class2.intptr_0), Enum104.const_5); Icon icon = Icon.FromHandle(handle); class3.toonTownParentForm_0 = new ToonTownParentForm(); class3.toonTownParentForm_0.Icon = icon; ToonTownParentForm.Class117 class4 = class3; if (func == null) { func = new Func <bool>(class2.method_0); } class4.func_0 = func; class3.func_1 = new Func <bool>(class3.method_0); class3.action_0 = new Action(class3.method_1); class3.action_1 = new Action <Action>(class3.method_2); class3.action_2 = new Action(class3.method_3); class3.action_3 = new Action(class3.method_4); class3.action_4 = new Action(class3.method_5); class3.action_5 = new Action(class3.method_6); class3.action_6 = new Action(class3.method_7); class3.action_7 = new Action(class3.method_8); class3.action_8 = new Action <IntPtr?, Rectangle>(class3.method_9); class3.action_9 = new Action <IntPtr?, Rectangle>(class3.method_10); class3.toonTownParentForm_0.OnResizeStarted += class3.method_11; class3.toonTownParentForm_0.OnResizeEnded += class3.method_12; class3.toonTownParentForm_0.GotFocus += class3.method_13; class3.toonTownParentForm_0.WindowStateChanged += class3.method_14; @class.class141_0.ProcessExited += class3.method_15; if (formWindowState.HasFlag(FormWindowState.Maximized)) { if (formWindowState.HasFlag(FormWindowState.Minimized)) { Class410.smethod_23(new HandleRef(@class.form_0, class2.intptr_0), FormWindowState.Minimized, null); } else { Class410.smethod_23(new HandleRef(@class.form_0, class2.intptr_0), FormWindowState.Normal, null); } } class3.intptr_0 = Class265.SetParent(class2.intptr_0, class3.toonTownParentForm_0.Handle); class3.toonTownParentForm_0.StartPosition = FormStartPosition.Manual; class3.toonTownParentForm_0.Bounds = bounds; class3.action_9(new IntPtr?(class3.toonTownParentForm_0.Handle), class3.toonTownParentForm_0.ClientRectangle); Class410.smethod_23(new HandleRef(@class.form_0, class3.toonTownParentForm_0.Handle), formWindowState, null); class3.toonTownParentForm_0.FormClosing += class3.method_16; class3.toonTownParentForm_0.OnCloseClicked += class3.method_17; class3.toonTownParentForm_0.timer_0.Tick += class3.method_18; class3.toonTownParentForm_0.Shown += class3.method_19; class3.toonTownParentForm_0.Show(); return(class3.toonTownParentForm_0); } DialogBox.smethod_3("The ToonTown window appears to be full screen and cannot be used. Please change ToonTown to window mode and try again.", "Invalid ToonTown Window"); } else { @class.class141_0.Dispose(); } return(null); }
/// <summary> /// Creates a new view for the specified <see cref="DialogBox"/>. /// </summary> /// <remarks> /// Override this method if you want to return a custom implementation of <see cref="IDialogBoxView"/>. /// In practice, it is preferable to subclass <see cref="DialogBoxView"/> rather than implement <see cref="IDialogBoxView"/> /// directly. /// </remarks> /// <param name="dialogBox"></param> /// <returns></returns> public virtual IDialogBoxView CreateDialogBoxView(DialogBox dialogBox) { return new DialogBoxView(dialogBox, this); }
private bool ShowRemovePinDialog() { DialogBox dialogBox = new DialogBox("Remove Pin", "Are you sure you want to remove this pin?", "Yes", "No"); dialogBox.Owner = m_currentWindow; bool? result = dialogBox.ShowDialog(); if (result == null) { return false; } return (bool)result; }
private void btnShowMessage_Click(object sender, EventArgs e) { /*var result =*/ DialogBox.Show("این یک خطاست. جان اصغر!", "هشدار خطا", MessageBoxIcon.Asterisk, MessageBoxButtons.AbortRetryIgnore, "اینها همگی جزئیات خطا هستند."); }
private void OnClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { DialogBox dialogBox = new DialogBox(m_popupTitle, m_popupBody, "Find Out More", "Later"); dialogBox.Owner = m_currentWindow; bool? result = dialogBox.ShowDialog(); WatermarkCLI.OnSelected(m_nativeCallerPointer); if (result != null && result == true) { Process.Start(new ProcessStartInfo(m_webUrl)); } }
private void btnShowWait2_Click(object sender, EventArgs e) { DialogBox.ShowWait2(closeOnClick: true); }
// Use this for initialization void Start() { if (MainCanvas.enabled == false) MainCanvas.enabled = true; CalculateMaxElementHorizontal(); CalculateMaxElementVertical(); DialogBox.SetActive(false); MainCanvas.enabled = false; DialogBoxScript = DialogBox.GetComponent<DialogBox>(); AddToBackpack(); }
private void Cancel_OnClick(object sender, RoutedEventArgs e) { DialogBox.Show(new UserControl_Login()); }
public void CreateWindow() { // If a dialog window is open we force it closed (this shouldn't happen) foreach (GameObject go in GameObject.FindGameObjectsWithTag("dialog")) { Object.Destroy(go); } // ability box - name header DialogBox db = new DialogBox(new Vector2(15, 0.5f), new Vector2(UIScaler.GetWidthUnits() - 30, 2), monster.monsterData.name); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); db.AddBorder(); float offset = 2.5f; if (monster.currentActivation.effect.Length > 0) { // ability text db = new DialogBox(new Vector2(10, offset), new Vector2(UIScaler.GetWidthUnits() - 20, 4), monster.currentActivation.effect.Replace("\\n", "\n")); db.AddBorder(); offset += 4.5f; } // Activation box string activationText = ""; // Create header if (master) { db = new DialogBox(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), "Master", Color.red); activationText = monster.currentActivation.ad.masterActions.Replace("\\n", "\n"); } else { db = new DialogBox(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), "Minion"); activationText = monster.currentActivation.ad.minionActions.Replace("\\n", "\n"); } db.AddBorder(); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); offset += 2; // Create ability text box db = new DialogBox(new Vector2(10, offset), new Vector2(UIScaler.GetWidthUnits() - 20, 7), activationText); if (master) { db.AddBorder(Color.red); } else { db.AddBorder(); } offset += 7.5f; // Create finished button if (master) { new TextButton(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), "Masters Activated", delegate { activated(); }, Color.red); } else { new TextButton(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), "Minions Activated", delegate { activated(); }); } }
void Start() { grayscale = FindObjectOfType<Grayscale>(); dialog = FindObjectOfType<DialogBox>(); gameObject.SetActive(false); }
/// <summary> /// Save /// </summary> internal void Save() { if (Viewer.txtPatName.Tag == null) { DialogBox.Msg("请先调出患者信息。"); return; } EntityPatientInfo patVo = Viewer.txtPatName.Tag as EntityPatientInfo; try { uiHelper.BeginLoading(Viewer); string fieldName = string.Empty; DateTime dtmNow = Utils.ServerTime(); EntityRptContagion vo = new EntityRptContagion(); vo.xmlData = Viewer.showPanelForm.XmlData(); if (Viewer.showPanelForm.IsAllowSave == false) { DialogBox.Msg("存在必填项目没有处理,请检查。项目:" + Viewer.showPanelForm.HintInfo); return; } vo.rptId = Function.Dec(this.ContagionDisplayVo.rptId); vo.reportId = this.ContagionDisplayVo.reportId; // 报告时间 if (ContagionParmData.Any(t => t.reportId == vo.reportId && t.keyId == "reportTime")) { fieldName = ContagionParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "reportTime").keyValue; vo.reportTime = Viewer.showPanelForm.GetItemInfo(fieldName); if (vo.reportTime.Trim() == string.Empty) { vo.reportTime = dtmNow.ToString("yyyy-MM-dd HH:mm:ss"); } } else { vo.reportTime = dtmNow.ToString("yyyy-MM-dd HH:mm:ss"); } // 上报科室 if (ContagionParmData.Any(t => t.reportId == vo.reportId && t.keyId == "deptCode")) { fieldName = ContagionParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "deptCode").keyValue; string deptName = Viewer.showPanelForm.GetItemInfo(fieldName); } else { string deptName = GlobalLogin.objLogin.DeptName; } // 报告人 if (ContagionParmData.Any(t => t.reportId == vo.reportId && t.keyId == "operCode")) { fieldName = ContagionParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "operCode").keyValue; vo.reportOperName = Viewer.showPanelForm.GetItemInfo(fieldName); if (GlobalDic.DataSourceEmployee.Any(t => t.operName == vo.reportOperName)) { vo.reportOperCode = GlobalDic.DataSourceEmployee.FirstOrDefault(t => t.operName == vo.reportOperName).operCode; } } else { vo.reportOperCode = GlobalLogin.objLogin.EmpNo; vo.reportOperName = GlobalLogin.objLogin.EmpName; } // 报告编号 if (ContagionParmData.Any(t => t.reportId == vo.reportId && t.keyId == "regCode")) { EntityRptContagionParm parm = ContagionParmData.FirstOrDefault(t => t.reportId == vo.reportId && t.keyId == "regCode"); // 计算类 if (parm.flag == 1) { string[] fieldNames = parm.keyValue.Split('+'); foreach (string fieldSub in fieldNames) { vo.registerCode += Viewer.showPanelForm.GetItemInfo(fieldSub); } } else { fieldName = parm.keyValue; vo.registerCode = Viewer.showPanelForm.GetItemInfo(fieldName); } } if (!string.IsNullOrEmpty(patVo.ipNo) && patVo.ipTimes > 0) { vo.patNo = patVo.ipNo; } else { vo.patNo = patVo.cardNo; } vo.patName = patVo.name; vo.patSex = patVo.sex; if (!string.IsNullOrEmpty(patVo.birth)) { vo.birthday = Function.Datetime(patVo.birth); } vo.contactTel = patVo.contTel; vo.deptCode = patVo.deptCode; vo.xmlData = Viewer.showPanelForm.XmlData(); vo.formId = this.formId; vo.operCode = GlobalLogin.objLogin.EmpNo; vo.recordDate = dtmNow; vo.status = 1; vo.patType = Viewer.rdoFlag.SelectedIndex + 1; string reqNo = patVo.clNo; using (ProxyContagion proxy = new ProxyContagion()) { decimal rptId = 0; if (proxy.Service.SaveContagion(vo, reqNo, out rptId) > 0) { Viewer.IsSave = true; if (this.ContagionDisplayVo.isNew) { this.ContagionDisplayVo.rptId = rptId.ToString(); } Viewer.txtCardNo.Properties.ReadOnly = true; DialogBox.Msg("数据保存成功!"); } else { DialogBox.Msg("数据保存失败。"); } } } finally { uiHelper.CloseLoading(Viewer); } }
internal DialogBoxOpenedEvent(DialogBox dialogBox) { DialogBox = dialogBox; }
// Token: 0x0600172D RID: 5933 RVA: 0x0003824C File Offset: 0x0003644C protected bool method_10(string message, string question, Struct46 ratio, out Class125 bmp, out Struct46 resulting_ratio) { bmp = null; resulting_ratio = default(Struct46); if (!this.class141_0.ProcessOpen && !this.class141_0.smethod_1(this)) { return(false); } using (Class499 @class = new Class499(this, true)) { using (DialogBox dialogBox = new DialogBox(question, "Are you ready?", Enum90.const_0, null, false, Enum121.const_1, new Enum39[] { Enum39.const_0, Enum39.const_1 })) { @class.method_1(dialogBox, DialogResult.OK); DialogResult dialogResult = dialogBox.ShowDialog(); if (dialogResult != DialogResult.OK) { return(false); } @class.method_4(); @class.method_6(); } if (this.class141_0.ProcessOpen) { Class410.smethod_8(this, this.class141_0.MainWindowHandle); using (CountDown countDown = new CountDown()) { @class.method_1(countDown, DialogResult.OK); if (countDown.ShowDialog() == DialogResult.OK) { @class.method_6(); @class.method_4(); if (this.class141_0.ProcessOpen) { Class410.smethod_8(this, this.class141_0.MainWindowHandle); EventHandler eventHandler = null; CaptureSetupForm.Class159 class2 = new CaptureSetupForm.Class159(); class2.regionSelector_0 = new RegionSelector(this.class141_0.MainWindowHandle); try { @class.method_0(class2.regionSelector_0); Rectangle rectangle = Class410.smethod_16(this.class141_0.MainWindowHandle); class2.regionSelector_0.SelectionBounds = Rectangle.Empty; class2.regionSelector_0.SelectedRegion = ratio.method_0(rectangle.Size); class2.regionSelector_0.RegionSelectorType = Enum124.const_0; class2.regionSelector_0.FullSelect = false; class2.regionSelector_0.FullSize = true; class2.regionSelector_0.FullScreenCapture = true; class2.regionSelector_0.MovableResizeMessage = message + " Press any key to accept or escape to cancel."; Form regionSelector_ = class2.regionSelector_0; if (eventHandler == null) { eventHandler = new EventHandler(class2.method_0); } regionSelector_.Shown += eventHandler; if (class2.regionSelector_0.ShowDialog() == DialogResult.OK && class2.regionSelector_0.SelectedRegion.smethod_2()) { bmp = class2.regionSelector_0.SelectedBitmap; resulting_ratio = Struct46.smethod_3(class2.regionSelector_0.SelectedRegion, new Rectangle(Point.Empty, rectangle.Size)); return(true); } } finally { if (class2.regionSelector_0 != null) { ((IDisposable)class2.regionSelector_0).Dispose(); } } } } } } } return(false); }