Interaction logic for DialogControl
Esempio n. 1
0
    void Awake()
    {
        dialog       = GameObject.Find("Canvas");
        continueBtn  = dialoguePanel.transform.Find("Continue").GetComponent <Button>();
        dialogueText = dialoguePanel.transform.Find("Text").GetComponent <Text>();
        nameText     = dialoguePanel.transform.Find("Name").GetChild(0).GetComponent <Text>();
        fightBtn     = dialoguePanel.transform.Find("Options").GetChild(0).GetComponent <Button>();
        friendBtn    = dialoguePanel.transform.Find("Options").GetChild(1).GetComponent <Button>();

        /*if(Input.GetKeyDown(KeyCode.Escape)){
         *  dialoguePanel.SetActive(false);
         * }*/
        continueBtn.onClick.AddListener(delegate { ContinueDialogue(); });

        dialoguePanel.SetActive(false);

        /*fightBtn.interactable = false;
         * fightBtn.GetComponent<Renderer>().enabled = false;
         * friendBtn.interactable = false;
         * fightBtn.GetComponent<Renderer>().enabled = false;*/

        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            Instance = this;
        }
    }
Esempio n. 2
0
        public static DialogReturn ShowDialog(DialogControl childControl)
        {
            var dialog = new Dialog();

            dialog.OpenControl(childControl);
            return(DialogResultToDialogReturn(dialog.ShowDialog()));
        }
Esempio n. 3
0
 void GlassoftLogo_Click(object sender, EventArgs e)
 {
     if (DialogControl.ShowQuery(Resources.AboutView_Button_Support, DialogButtons.YesNo) == DialogResult.Yes)
     {
         Process.Start(SystemConfiguration.SupportSiteURL, null);
     }
 }
Esempio n. 4
0
        public virtual ResponseType Run()
        {
            try {
                DialogControl.Shown       -= OnShown;
                DialogControl.Shown       += OnShown;
                DialogControl.Hidden      -= DialogControl_Hidden;
                DialogControl.Hidden      += DialogControl_Hidden;
                DialogControl.DeleteEvent += DialogControl_DeleteEvent;
                if (hidden)
                {
                    PushModalDialog();
                }

                ResponseType ret = (ResponseType)DialogControl.Run();
                Hide();

                return(ret);

#if !DEBUG
            } catch {
                ComponentHelper.PopModal(DialogControl);
                Hide();
                throw;
#endif
            } finally {
                DialogControl.DeleteEvent -= DialogControl_DeleteEvent;
                DialogControl.Hidden      -= DialogControl_Hidden;
                DialogControl.Shown       -= OnShown;
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Überprüft, ob die Angaben im Dialog korrekt sind und beendet anschließend (ggf.) den DIalog
 /// </summary>
 /// <param name="element"></param>
 /// <param name="points"></param>
 private void ConnectCallback(UIElement element, TouchGroup points)
 {
     this.Invoke(new Action(() =>
     {
         try
         {
             IPAddress ip = IPAddress.Parse(_ipaddress.Text);
             int port     = int.Parse(_port.Text);
             if (port > 0 && port <= 9999)
             {
                 OnDialogFinished(new Events.DialogEventArgs(this, CONNECT, port, ip));
             }
             else
             {
                 DialogControl <MessageDialog> .ShowDialog(DialogParent.Surface,
                                                           DialogInfo.CreateMessageInfo("The port must be between 0 and 9999!", true));
             }
         }
         catch
         {
             DialogControl <MessageDialog> .ShowDialog(DialogParent.Surface,
                                                       DialogInfo.CreateMessageInfo(this._ipaddress.Text + " is not a valid ip adress", true));
         }
     }));
 }
Esempio n. 6
0
 private static List <Message> InitMessages(DialogControl dialog, User adminUser, User simpleUser)
 {
     return(new List <Message>()
     {
         new Message()
         {
             Id = 1,
             DialogControlId = dialog.Id,
             Text = "Hi! You are beautiful.",
             HasRead = true,
             UserSenderEmail = adminUser.Email,
             UserSenderId = adminUser.Id,
             UserReceiverEmail = simpleUser.Email,
             UserReceiverId = simpleUser.Id
         },
         new Message()
         {
             Id = 2,
             DialogControlId = dialog.Id,
             Text = "Hello! Yes, I know. Thank you!",
             HasRead = true,
             UserSenderEmail = simpleUser.Email,
             UserSenderId = simpleUser.Id,
             UserReceiverEmail = adminUser.Email,
             UserReceiverId = adminUser.Id
         }
     });
 }
Esempio n. 7
0
        protected override void OnUpdateView(string key)
        {
            #region LoadListResponse

            if (key == "LoadListResponse")
            {
                klvFriendsOnlineList.Clear();

                klvFriendsOnlineList.DataSource = Model;

                klvFriendsOnlineList.Reload();
            }

            #endregion

            #region ReloadListResponse

            if (key == "ReloadListResponse")
            {
                klvFriendsOnlineList.Reload();
            }

            #endregion

            #region LoadListResponseNegative

            if (key == "LoadListResponseNegative")
            {
                DialogControl.ShowQuery((string)ViewData["LoadListResponseMessage"], DialogButtons.OK);
                //MessageBox.Show((string)ViewData["LoadListResponseMessage"]);
            }

            #endregion
        }
        public GameProcessControl(SubjectType type)
        {
            _type = type;
            InitializeComponent();
            var dialogControl = new DialogControl(new DialogViewModel(type));

            dialogControl.DialogEnd += OnDialogEnd;
            Layout.Children.Add(dialogControl);


            switch (type)
            {
            case SubjectType.Subject1:
                Npc.Source = new BitmapImage(new Uri(@"../Resources/c3609ba5-2733-46be-b1da-84cde7a9c275.png", UriKind.Relative));
                break;

            case SubjectType.Subject2:
                Npc.Source = new BitmapImage(new Uri(@"../Resources/a5b20250-03dc-4372-8ffe-574433310769.png", UriKind.Relative));
                break;

            case SubjectType.Subject3:
                Npc.Source = new BitmapImage(new Uri(@"../Resources/3a091c7b-9dcc-4494-b7db-a709903689e8.png", UriKind.Relative));
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Esempio n. 9
0
        protected override void OnUpdateView(string key)
        {
            #region LoadListRespons

            if (key == "LoadListResponse")
            {
                klvStatusUpdatesList.Clear();
                klvImagesList.Clear();

                klvStatusUpdatesList.DataSource = Model.Statuses;
                klvImagesList.DataSource        = Model.Photos;

                klvStatusUpdatesList.Reload();
                klvImagesList.Reload();
            }

            #endregion

            #region ReloadListResponse

            if (key == "ReloadListResponse")
            {
                klvStatusUpdatesList.Reload();
                klvImagesList.Reload();
            }

            #endregion

            #region RefreshListResponse

            if (key == "RefreshListResponse")
            {
                klvStatusUpdatesList.Refresh();
                klvImagesList.Refresh();
            }

            #endregion

            #region LoadListResponseNegative

            if (key == "GetViewDataResponseNegative")
            {
                DialogControl.ShowQuery((string)ViewData["GetViewDataResponseMessage"], DialogButtons.OK);

                //if (!((string)ViewData["IsFirstStart"]).Equals("1"))
                //{
                //    DialogControl.ShowQuery((string)ViewData["GetViewDataResponseMessage"], DialogButtons.OK);
                //}
            }

            #endregion

            if (key == "GoToLogin")
            {
                OnViewStateChanged("GoGoToLogin");
            }

            //RenewMessageImage();
        }
Esempio n. 10
0
        protected override void OnUpdateView(string key)
        {
            #region ActivateResponse

            if (key == "ActivateResponse")
            {
                headerText.Text = headerShadowText.Text = (string)ViewData["UserName"];

                tbxMessageData.Text = (string)ViewData["MessageDraftInput"];

                if (!string.IsNullOrEmpty((string)ViewData["MsgForChangedReceiver"]))
                {
                    tbxMessageData.Text = (string)ViewData["MsgForChangedReceiver"];
                }

                if ((bool)ViewData["AFRHideButton"])
                {
                    if (this.Canvas.Children.Contains(friendsLogo))
                    {
                        this.friendsLogo.Location = new Point(0, 0);

                        this.Canvas.Children.Remove(friendsLogo);
                    }
                }
                else
                {
                    if (!this.Canvas.Children.Contains(friendsLogo))
                    {
                        this.friendsLogo.Location = new Point(UISettings.CalcPix(210), UISettings.CalcPix(4));

                        this.Canvas.Children.Add(friendsLogo);
                    }
                }
            }

            #endregion

            #region SentMessageResponse

            if (key == "SentMessageResponse")
            {
                DialogControl.ShowQuery((string)ViewData["SentMessageResponseMessage"], DialogButtons.OK);

                ViewData["SentMessageResponseMessage"] = string.Empty;

                if (Convert.ToBoolean((string)ViewData["MessageIsSent"]))
                {
                    //NavigationService.GoBack();
                    OnViewStateChanged("SendComplete");
                }
            }

            #endregion

            if (key == "GoToLogin")
            {
                OnViewStateChanged("GoGoToLogin");
            }
        }
Esempio n. 11
0
        private string GetEvent(string eventName, DialogControl control, string func, string data = null)
        {
            data = string.IsNullOrEmpty(data) ? "'" : $"&data=' + {data}";

            string HandlerURL = $"'&dialog={CurrentForm}&control={control.Name}&event={eventName}{data}";

            return($"fr{WebReport.ID}.{func}({HandlerURL})");
        }
Esempio n. 12
0
 private string GetControlPosition(DialogControl control)
 {
     return(string.Format("position:absolute;left:{0}px;top:{1}px;width:{2}px;height:{3}px;padding:0px;margin:0px;",
                          Zoom(control.Left),
                          Zoom(control.Top),
                          Zoom(control.Width),
                          Zoom(control.Height)));
 }
Esempio n. 13
0
        protected override void OnUpdateView(string key)
        {
            if (key == "LoginFail")
            {
                var loginError = (string)ViewData["LoginError"];

                DialogControl.ShowQuery(loginError, DialogButtons.OK);
            }
        }
Esempio n. 14
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (ViewData["GetError"] != null && (string)ViewData["IsFirstStart"] == "1")
            {
                DialogControl.ShowQuery((string)ViewData["GetError"], DialogButtons.OK);
            }
        }
Esempio n. 15
0
        /// <summary>
        /// This method indicates that something has been changed in the view.
        /// </summary>
        /// <param name="key">The string key to identify what has been changed.</param>
        protected override void OnViewStateChanged(string key)
        {
            #region LoadUserData
            if (key == "LoadUserData")
            {
                string login = Globals.BaseLogic.IDataLogic.GetSavedLogin();
                ViewData["UserLogin"] = login;
                view.UpdateView("UserDataLoaded");
            }
            #endregion

            #region GoBack
            if (key == "GoBack")
            {
                NavigationService.GoBack();
            }
            #endregion

            #region ClearPass
            if (key == "ClearPass")
            {
                DialogResult dlgRes = DialogControl.ShowQuery(Resources.UserData_ClearPass, DialogButtons.YesNo);
                switch (dlgRes)
                {
                case DialogResult.Yes:
                    using (new WaitWrapper(false))
                    {
                        Globals.BaseLogic.IDataLogic.ClearPass();
                        Globals.BaseLogic.IDataLogic.ClearCache();
                        //надо еще и нотификатор остановить
                        //Interprocess.StopService();
                        MasterForm.Navigate <LoginController>();
                    }
                    break;
                }
                view.UpdateView("DeselectButton");
            }
            #endregion

            #region ClearCache
            if (key == "ClearCache")
            {
                DialogResult dlgRes = DialogControl.ShowQuery(Resources.UserData_ClearCache, DialogButtons.YesNo);
                switch (dlgRes)
                {
                case DialogResult.Yes:
                    using (new WaitWrapper(false))
                    {
                        Globals.BaseLogic.IDataLogic.ClearCache();
                    }
                    break;
                }
                view.UpdateView("DeselectButton");
            }
            #endregion
        }
Esempio n. 16
0
        protected override void OnUpdateView(string key)
        {
            if (key == "ResetState")
            {
                klvFriendsList.Clear();

                klvFriendsList.DataSource = (List <FriendListViewItem>)ViewData["OriginalModel"];

                klvFriendsList.Reload();
            }

            #region LoadListResponse

            if (key == "LoadListResponse")
            {
                klvFriendsList.Clear();

                klvFriendsList.DataSource = Model;

                klvFriendsList.Reload();
            }

            #endregion

            #region ReloadListResponse

            if (key == "ReloadListResponse")
            {
                klvFriendsList.Reload();
            }

            #endregion

            #region RefreshListResponse

            if (key == "RefreshListResponse")
            {
                klvFriendsList.Refresh();
            }

            #endregion

            #region LoadListResponseNegative

            if (key == "LoadListResponseNegative")
            {
                DialogControl.ShowQuery((string)ViewData["LoadListResponseMessage"], DialogButtons.OK);
            }

            #endregion

            if (key == "GoToLogin")
            {
                OnViewStateChanged("GoGoToLogin");
            }
        }
Esempio n. 17
0
        public Conversation(TcpClient c, ChatClient _chatClient)
        {
            UICreated = false;
//            tcpClient = c;
//            stream = c.GetStream();
            userItem   = null;
            chatClient = _chatClient;
            dialog     = null;
            toggle     = null;
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // load configuration
            this.config = Configuration.GetConfiguration();

            // load language
            if (!String.IsNullOrEmpty(Request.QueryString["lang"]))
            {
                this.lang = Language.GetLanguage(Request.QueryString["lang"]);
                dialogBody.Attributes["dir"] = this.lang.Direction;
            }
            dialogBody.Attributes["onload"] = "SpawDialog.dialogInit();";

            // load theme
            if (!String.IsNullOrEmpty(Request.QueryString["theme"]))
            {
                this.theme = Solmetra.Spaw2.Theme.GetTheme(Request.QueryString["theme"]);
            }

            // set output charset
            if (!String.IsNullOrEmpty(Request.QueryString["charset"]))
            {
                Response.ContentEncoding = System.Text.Encoding.GetEncoding(Request.QueryString["charset"]);
            }



            if (this.config != null && this.theme != null && this.lang != null)
            {
                // load control
                string module = Request.QueryString["module"];
                string dialog = Request.QueryString["dialog"];
                if (!String.IsNullOrEmpty(module) && module.IndexOfAny(new char[2] {
                    '/', '\\'
                }) == -1 &&
                    !String.IsNullOrEmpty(dialog) && dialog.IndexOfAny(new char[2] {
                    '/', '\\'
                }) == -1)
                {
                    Page.Title = "SPAW Editor v.2: " + this.lang.GetMessage(module, dialog, "title");
                    DialogControl dialog_control = (DialogControl)LoadControl(Configuration.PluginDirectory + module + "/dialogs/" + dialog + ".ascx");
                    dialog_control.Configuration = this.config;
                    dialog_control.Theme         = this.theme;
                    dialog_control.Language      = this.lang;

                    header_template = this.theme.TemplateDialogHeader.Replace("{SPAW DIALOG TITLE}", this.lang.GetMessage(module, dialog, "title")).Replace("{SPAW DIR}", Configuration.SpawDirectory);
                    footer_template = this.theme.TemplateDialogFooter.Replace("{SPAW DIR}", Configuration.SpawDirectory);

                    DialogHeader.Controls.Add(new LiteralControl(header_template));
                    DialogFooter.Controls.Add(new LiteralControl(footer_template));

                    DialogContent.Controls.Add(dialog_control);
                }
            }
        }
Esempio n. 19
0
        public Conversation(TcpClient c, string _remoteName, ushort _remotePort, ChatClient _chatClient)
        {
            UICreated = false;
//            tcpClient = c;
            remoteName = _remoteName;
            remotePort = _remotePort;
            userItem   = null;
            chatClient = _chatClient;
            dialog     = null;
            toggle     = null;
        }
Esempio n. 20
0
 //против часовой
 private void btnRotareImageCounterclockwise_Click(object sender, EventArgs e)
 {
     if (Globals.BaseLogic.IDataLogic.GetUplPhtViewHasMdfPht())
     {
         OnViewStateChanged("RotareImageCounterclockwise");
     }
     else
     {
         DialogControl.ShowQuery(Resources.UploadPhoto_Controller_UploadPhotoResponseMessage_ImageIsNotPicked, DialogButtons.OK);
     }
 }
Esempio n. 21
0
 //изменить комментарий
 private void cmcPhotoDescription_Click(object sender, EventArgs e)
 {
     if (Globals.BaseLogic.IDataLogic.GetUplPhtViewHasMdfPht())
     {
         OnViewStateChanged("ChangePhotoComment");
     }
     else
     {
         DialogControl.ShowQuery(Resources.UploadPhoto_Controller_UploadPhotoResponseMessage_ImageIsNotPicked, DialogButtons.OK);
     }
 }
        public override void ApplyControlPropertyChange(string propertyName, DialogControl control)
        {
            base.ApplyControlPropertyChange(propertyName, control);

            var combo = control as CustomCommonFileDialogComboBox;

            if (combo != null && propertyName == "Items")
            {
                combo.Update(customize);
            }
        }
Esempio n. 23
0
        private void DialogControl_WidgetEvent(object o, EnterNotifyEventArgs args)
        {
            int x;
            int y;

            DialogControl.GetPosition(out x, out y);
            Gdk.Window drawable       = DialogControl.GdkWindow;
            int        titleBarHeight = drawable.FrameExtents.Height - drawable.ClipRegion.Clipbox.Height;

            DialogControl.Move(x, y + titleBarHeight);
        }
Esempio n. 24
0
 void MenuItemSelectClick(object sender, EventArgs e)
 {
     if (klvFriendsList.SelectedIndex == -1)
     {
         DialogControl.ShowQuery(Resources.FriendSearchView_DontChoice, DialogButtons.OK);
     }
     else
     {
         OnViewStateChanged("UserChoise");
     }
 }
Esempio n. 25
0
 public virtual void Show()
 {
     DialogControl.Shown       -= OnShown;
     DialogControl.Shown       += OnShown;
     DialogControl.DeleteEvent += DialogControl_DeleteEvent;
     if (hidden)
     {
         PushModalDialog();
     }
     DialogControl.Show();
 }
Esempio n. 26
0
        protected override void OnUpdateView(string key)
        {
            // Что то пришло от контроллера
            if (key == "UpdateResponse")
            {
                var updateMessage = (string)ViewData["UpdateMessage"];
                DialogControl.ShowQuery(updateMessage, DialogButtons.OK);
                //MessageBox.Show(updateMessage);
            }

            //RenewMessageImage();
        }
Esempio n. 27
0
        public void SetDependency(FrameworkElement element)
        {
            // extract grid
            var dialogContainer = (Grid)element;

            // create dialog control
            _dialogControl         = new DialogControl();
            _dialogControl.Closed += _DialogClosedCallback;

            // inject dialog control to container
            dialogContainer.Children.Add(_dialogControl);
        }
Esempio n. 28
0
 /// <summary>
 /// Bietet den Dialog zum erstellen einer Verbindung an
 /// oder beendet eine aktive Verbindung
 /// (Verbindungsaufbau Schritt 1 von 3)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ConnectionButton_Tap(object sender, EventArgs e)
 {
     if (IsConnected)
     {
         CloseConnection();
         Surface.Buttons.Buttons[CONNECTION_BUTTON].SetValue(Images.connect);
         MessageDialog.ShowMessage(this.Surface, "Connection closed!", false);
     }
     else
     {
         DialogControl <ChooseEndPointType> .ShowDialog(this.Surface).DialogFinished += ChooseConnection_DialogFinished;
     }
 }
Esempio n. 29
0
        protected override void OnUpdateView(string key)
        {
            #region LoadListResponse

            if (key == "LoadListResponse")
            {
                klvMessagesChainsList.Clear();

                klvMessagesChainsList.DataSource = Model;

                klvMessagesChainsList.Reload();
            }

            #endregion

            #region ReloadListResponse

            if (key == "ReloadListResponse")
            {
                klvMessagesChainsList.Reload();
            }

            #endregion

            #region RefreshListResponse

            if (key == "RefreshListResponse")
            {
                klvMessagesChainsList.Refresh();
            }

            #endregion



            #region LoadListResponseNegative

            if (key == "LoadListResponseNegative")
            {
                DialogControl.ShowQuery((string)ViewData["LoadListResponseMessage"], DialogButtons.OK);
            }

            #endregion

            if (key == "GoToLogin")
            {
                OnViewStateChanged("GoGoToLogin");
            }

            //RenewMessageImage();
        }
Esempio n. 30
0
 private void ButtonSendClick(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(tbxMessageData.Text.Trim()))
     {
         tbxMessageData.Visible         = false;
         ViewData["MessageDraftOutput"] = ParsingHelper.GetActualString(tbxMessageData.Text.Trim());
         OnViewStateChanged("SentMessage");
         tbxMessageData.Visible = true;
     }
     else
     {
         DialogControl.ShowQuery(Resources.MessagesList_View_MessageIsEmpty, DialogButtons.OK);
         (new InputPanel()).Enabled = true;
     }
 }
Esempio n. 31
0
 public void OpenMessageBox(string text, float delay, float scale, DialogControl.DialogDelegate result)
 {
     if (!dialogBox) CreateDialog();
     dialogBox.OpenMessageBox(text, delay, scale, result);
 }
Esempio n. 32
0
		// Called when a control currently in the collection 
		// has a property changing - this is 
		// basically to screen out property changes that 
		// cannot occur while the dialog is showing
		// because the Win32 API has no way for us to 
		// propagate the changes until we re-invoke the Win32 call.
		bool IDialogControlHost.IsControlPropertyChangeAllowed(string propertyName, DialogControl control) {
			Debug.Assert(control is TaskDialogControl,
				"Property changing for a control that is not a TaskDialogControl-derived type");
			Debug.Assert(propertyName != "Name",
				"Name changes at any time are not supported - public API should have blocked this");

			bool canChange = false;

			if (!NativeDialogShowing) {
				// Certain properties can't be changed if the dialog is not showing
				// we need a handle created before we can set these...
				switch (propertyName) {
					case "Enabled":
						canChange = false;
						break;
					default:
						canChange = true;
						break;
				}
			} else {
				// If the dialog is showing, we can only 
				// allow some properties to change.
				switch (propertyName) {
					// Properties that CAN'T be changed while dialog is showing.
					case "Text":
					case "Default":
						canChange = false;
						break;

					// Properties that CAN be changed while dialog is showing.
					case "ShowElevationIcon":
					case "Enabled":
						canChange = true;
						break;
					default:
						Debug.Assert(true, "Unknown property name coming through property changing handler");
						break;
				}
			}
			return canChange;
		}
Esempio n. 33
0
		// Called when a control currently in the collection 
		// has a property changed - this handles propagating
		// the new property values to the Win32 API. 
		// If there isn't a way to change the Win32 value, then we
		// should have already screened out the property set 
		// in NotifyControlPropertyChanging.        
		void IDialogControlHost.ApplyControlPropertyChange(string propertyName, DialogControl control) {
			// We only need to apply changes to the 
			// native dialog when it actually exists.
			if (NativeDialogShowing) {
				TaskDialogButton button;
				TaskDialogRadioButton radioButton;
				if (control is TaskDialogProgressBar) {
					if (!progressBar.HasValidValues) {
						throw new ArgumentException(LocalizedMessages.TaskDialogProgressBarValueInRange);
					}

					switch (propertyName) {
						case "State":
							nativeDialog.UpdateProgressBarState(progressBar.State);
							break;
						case "Value":
							nativeDialog.UpdateProgressBarValue(progressBar.Value);
							break;
						case "Minimum":
						case "Maximum":
							nativeDialog.UpdateProgressBarRange();
							break;
						default:
							Debug.Assert(true, "Unknown property being set");
							break;
					}
				} else if ((button = control as TaskDialogButton) != null) {
					switch (propertyName) {
						case "ShowElevationIcon":
							nativeDialog.UpdateElevationIcon(button.Id, button.UseElevationIcon);
							break;
						case "Enabled":
							nativeDialog.UpdateButtonEnabled(button.Id, button.Enabled);
							break;
						default:
							Debug.Assert(true, "Unknown property being set");
							break;
					}
				} else if ((radioButton = control as TaskDialogRadioButton) != null) {
					switch (propertyName) {
						case "Enabled":
							nativeDialog.UpdateRadioButtonEnabled(radioButton.Id, radioButton.Enabled);
							break;
						default:
							Debug.Assert(true, "Unknown property being set");
							break;
					}
				} else {
					// Do nothing with property change - 
					// note that this shouldn't ever happen, we should have
					// either thrown on the changing event, or we handle above.
					Debug.Assert(true, "Control property changed notification not handled properly - being ignored");
				}
			}
		}
Esempio n. 34
0
		/// <summary>
		/// Determines if changes to a specific property are allowed.
		/// </summary>
		/// <param name="propertyName">The name of the property.</param>
		/// <param name="control">The control propertyName applies to.</param>
		/// <returns>true if the property change is allowed.</returns>
		public virtual bool IsControlPropertyChangeAllowed(string propertyName, DialogControl control) {
			CommonFileDialog.GenerateNotImplementedException();
			return false;
		}
Esempio n. 35
0
		/// <summary>
		/// Called when a control currently in the collection 
		/// has a property changed.
		/// </summary>
		/// <param name="propertyName">The name of the property changed.</param>
		/// <param name="control">The control whose property has changed.</param>
		public virtual void ApplyControlPropertyChange(string propertyName, DialogControl control) {
			if (control == null) {
				throw new ArgumentNullException("control");
			}

			CommonFileDialogControl dialogControl = null;
			if (propertyName == "Text") {
				CommonFileDialogTextBox textBox = control as CommonFileDialogTextBox;

				if (textBox != null) {
					customize.SetEditBoxText(control.Id, textBox.Text);
				} else {
					customize.SetControlLabel(control.Id, textBox.Text);
				}
			} else if (propertyName == "Visible" && (dialogControl = control as CommonFileDialogControl) != null) {
				ShellNativeMethods.ControlState state;
				customize.GetControlState(control.Id, out state);

				if (dialogControl.Visible == true) {
					state |= ShellNativeMethods.ControlState.Visible;
				} else if (dialogControl.Visible == false) {
					state &= ~ShellNativeMethods.ControlState.Visible;
				}

				customize.SetControlState(control.Id, state);
			} else if (propertyName == "Enabled" && dialogControl != null) {
				ShellNativeMethods.ControlState state;
				customize.GetControlState(control.Id, out state);

				if (dialogControl.Enabled == true) {
					state |= ShellNativeMethods.ControlState.Enable;
				} else if (dialogControl.Enabled == false) {
					state &= ~ShellNativeMethods.ControlState.Enable;
				}

				customize.SetControlState(control.Id, state);
			} else if (propertyName == "SelectedIndex") {
				CommonFileDialogRadioButtonList list;
				CommonFileDialogComboBox box;

				if ((list = control as CommonFileDialogRadioButtonList) != null) {
					customize.SetSelectedControlItem(list.Id, list.SelectedIndex);
				} else if ((box = control as CommonFileDialogComboBox) != null) {
					customize.SetSelectedControlItem(box.Id, box.SelectedIndex);
				}
			} else if (propertyName == "IsChecked") {
				CommonFileDialogCheckBox checkBox = control as CommonFileDialogCheckBox;
				if (checkBox != null) {
					customize.SetCheckButtonState(checkBox.Id, checkBox.IsChecked);
				}
			}
		}
Esempio n. 36
0
    void OnTriggerEnter2D(Collider2D other)
    {
        dialogController = dialogPanel.GetComponent<DialogControl>();
        if (gameObject.tag == "Raks1" && other.tag == "Player")
        {

            isWriting = true;
            if (player.lvl == 1)
            {
                dialogPanel.SetActive(true);
                SlowWritingText(text1stLvl);
                if (Input.GetMouseButtonDown(0))
                {
                    OnHastyWrittingText(text1stLvl);
                }
            }
            else
            {
                dialogPanel.SetActive(true);
                SlowWritingText(text2ndLvl);
                if (Input.GetMouseButtonDown(0))
                {
                    OnHastyWrittingText(text2ndLvl);
                }
                questController.AddQuest(questID);
                Raks2.SetActive(true);
                gameController.isRaks = true;
                StartCoroutine(LateCall());
            }
        }
        if (gameObject.tag == "QuestTaker" && other.tag == "Player")
        {
            if (!questController.quests[questID].isActive)
            {
                isWriting = true;
                dialogPanel.SetActive(true);
                SlowWritingText(text1stLvl);
                questController.AddQuest(questID);
            }
            if (questController.quests[questID].isComplete)
            {
                isWriting = true;
                SlowWritingText(text2ndLvl);
                StartCoroutine(LateCall());
            }
        }
        if (gameObject.tag == "Raks2" && other.tag == "Player")
        {
            if (questController.quests[questID].isComplete)
            {
                isWriting = true;
                dialogPanel.SetActive(true);
                SlowWritingText(text1stLvl);
            }
        }
        if (gameObject.tag == "DragonEgg" && other.tag == "Player")
        {
            isWriting = true;
            dialogPanel.SetActive(true);
            questController.dragonEggFlag = true;
            SlowWritingText(text1stLvl);
            player.skillButtons[1].gameObject.SetActive(true);
            player.dragon.SetActive(true);
            StartCoroutine(LateCall());
            PlayerPrefs.SetInt("DragonEgg",0);
        }
    }
Esempio n. 37
0
 private void SlowWritingText(string text)
 {
         dialogPanel.SetActive(true);
         dialogController = dialogPanel.GetComponent<DialogControl>();
         dialogController.WriteText(text);
 }
Esempio n. 38
0
 void CreateDialog()
 {
     GameObject dialogBoxObj = Instantiate(dialogBoxPrefab, Vector3.zero, Quaternion.identity) as GameObject;
     dialogBox = dialogBoxObj.GetComponent<DialogControl>();
     dialogBox.transform.parent = Camera.main.transform;
     dialogBox.Init();
 }