Inheritance: MonoBehaviour
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("ButtonText", false, out subEle))
            {
                if (ButtonText == null)
                {
                    ButtonText = new SimpleSubrecord <String>();
                }

                ButtonText.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Conditions", false, out subEle))
            {
                if (Conditions == null)
                {
                    Conditions = new List <Condition>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    Condition temp = new Condition();
                    temp.ReadXML(e, master);
                    Conditions.Add(temp);
                }
            }
        }
Example #2
0
        public bool Close()
        {
            bool flag = false;

            foreach (IViewContent viewContent in this.viewContentCollection)
            {
                if (viewContent.IsDirty)
                {
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                this.Present();
                ButtonText btnText = new ButtonText(LanguageInfo.Dialog_ButtonYes, LanguageInfo.Dialog_ButtonNo, LanguageInfo.Dialog_ButtonCancel);
                switch (MessageBox.Show(LanguageInfo.MessageBox_Content57, btnText, (Gtk.Window)null, (string)null, MessageBoxImage.Info))
                {
                case MessageBoxResult.Cancel:
                    return(false);

                case MessageBoxResult.No:
                    break;

                default:
                    Services.Workbench.SaveAll();
                    goto case MessageBoxResult.No;
                }
            }
            Services.Workspace.CloseWorkspaceItem((WorkspaceItem)Services.ProjectOperations.CurrentSelectedSolution, true);
            this.CloseAllViews();
            this.OnClosed((EventArgs)null);
            return(true);
        }
Example #3
0
        public RenderD2Scene()
        {
            ButtonText bt1 = new ButtonText(40, 20);
            ButtonText bt2 = new ButtonText(20, 20);
            ButtonText bt3 = new ButtonText(20, 20);

            Portal p1 = new Portal(new LayoutVertical());

            p1.Add(bt1);
            p1.Add(bt2);
            p1.Add(bt3);

            ButtonText bt4 = new ButtonText(45, 30);
            ButtonText bt5 = new ButtonText(25, 30);
            ButtonText bt6 = new ButtonText(35, 30);

            Portal p2 = new Portal(new LayoutHortizontal());

            p2.Add(bt4);
            p2.Add(bt5);
            p2.Add(bt6);

            Portal p3 = new Portal(new LayoutVertical());

            p3.Add(p1);
            p3.Add(p2);

            p1.Calculate();

            entity = p1;
            //entity = new Sprite();
        }
        /// <summary>
        /// </summary>
        private void CreateSelectMapButton()
        {
            SelectMap = new ButtonText(FontsBitmap.GothamRegular, "select map", 14, (o, e) =>
            {
                if (OnlineManager.CurrentGame.InProgress)
                {
                    NotificationManager.Show(NotificationLevel.Error, "Please wait until the match finishes before selecting another map.");
                    return;
                }

                if (OnlineManager.CurrentGame.Host != OnlineManager.Self.OnlineUser)
                {
                    NotificationManager.Show(NotificationLevel.Error, "You cannot select the map if you aren't host!");
                    return;
                }

                var game   = (QuaverGame)GameBase.Game;
                var screen = game.CurrentScreen as MultiplayerScreen;
                screen?.Exit(() => new SelectScreen(screen), 0, QuaverScreenChangeType.AddToStack);
            })
            {
                DestroyIfParentIsNull = false
            };

            if (OnlineManager.CurrentGame.Host == OnlineManager.Self.OnlineUser)
            {
                RightAligned.Add(SelectMap);
            }
        }
Example #5
0
 void Start()
 {
     img        = Picture.GetComponent <Image>();
     button     = Button.GetComponent <Image>();
     txt        = Text.GetComponent <Text>();
     buttonText = ButtonText.GetComponent <Text>();
 }
Example #6
0
 public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     base.Draw(gameTime, spriteBatch);
     if (ButtonText != null)
     {
         ButtonText.Draw(spriteBatch, ForeColor);
     }
 }
Example #7
0
 // Start is called before the first frame update
 // comment
 void Start()
 {
     VirtualButton.GetComponent <VirtualButtonBehaviour>().RegisterEventHandler(this);
     DisplayText = GameObject.Find("DisplayText");
     ButtonText  = GameObject.Find("ButtonText");
     myText      = DisplayText.GetComponent <TextMesh>();
     buttonText  = ButtonText.GetComponent <TextMesh>();
 }
 public bool IsEmpty()
 {
     if (Id == ServiceEmpty || Id.Trim() == "" || ButtonText.Trim() == "")
     {
         return(true);
     }
     return(false);
 }
        public void AsSerializableObject_TodayPropertyNotSet_ObjectDoesNotHaveTodayProperty()
        {
            ButtonText buttonText = new ButtonText();
            object     target     = buttonText.AsSerializableObject();

            PropertyInfo[] properties = target.GetType().GetProperties();
            properties.Should().NotContain(x => x.Name == "today");
        }
Example #10
0
 public override void Dispose()
 {
     if (ButtonText != null)
     {
         ButtonText.Dispose();
         ButtonText = null;
     }
     base.Dispose();
 }
        /// <summary>
        /// </summary>
        private void CreateReadyUpButton()
        {
            ReadyUp = new ButtonText(FontsBitmap.GothamRegular,
                                     OnlineManager.CurrentGame.Host == OnlineManager.Self.OnlineUser ? "start match" : "ready up", 14, (o, e) =>
            {
                if (OnlineManager.CurrentGame.InProgress)
                {
                    NotificationManager.Show(NotificationLevel.Error, "Please wait until the match finishes before performing this action.");
                    return;
                }

                // We're host, so start/stop the match countdown
                if (OnlineManager.CurrentGame.Host == OnlineManager.Self.OnlineUser)
                {
                    if (OnlineManager.CurrentGame.CountdownStartTime == -1)
                    {
                        OnlineManager.Client?.MultiplayerGameStartCountdown();
                        OnlineManager.Client?.MultiplayerGameIsReady();
                    }
                    else
                    {
                        OnlineManager.Client?.MultiplayerGameStopCountdown();
                        OnlineManager.Client?.MultiplayerGameIsNotReady();
                    }
                }
                // Not host, so the button should be a ready toggle.
                else if (!OnlineManager.CurrentGame.PlayersReady.Contains(OnlineManager.Self.OnlineUser.Id))
                {
                    if (OnlineManager.CurrentGame.InProgress)
                    {
                        NotificationManager.Show(NotificationLevel.Error, "Please wait until the match finishes before readying up.");
                        return;
                    }

                    if (OnlineManager.CurrentGame.PlayersWithoutMap.Contains(OnlineManager.Self.OnlineUser.Id))
                    {
                        NotificationManager.Show(NotificationLevel.Error, "You cannot ready up if you do not have the map!");
                    }
                    else
                    {
                        OnlineManager.Client?.MultiplayerGameIsReady();
                    }
                }
                else
                {
                    OnlineManager.Client?.MultiplayerGameIsNotReady();
                }
            })
            {
                DestroyIfParentIsNull = false
            };

            RightAligned.Add(ReadyUp);
        }
 public void InitializerButton(string text, TGCVector2 scale, TGCVector2 position)
 {
     Scale    = scale;
     Position = position;
     MarkedButton.SetImage("marked.png");
     MarkedButton.SetInitialScallingAndPosition(scale, position);
     UnmarkedButton.SetImage("unmarked.png");
     UnmarkedButton.SetInitialScallingAndPosition(scale, position);
     Size     = MarkedButton.Size;
     SizeText = new TGCVector2(335 * scale.X * 0.6f, 66 * scale.Y * 0.5f);
     ButtonText.SetTextAndPosition(text, position: Position + SizeText);
 }
 private void SetColumnControls()
 {
     if (ImageAtRight)
     {
         ButtonText.SetValue(Grid.ColumnProperty, 0);
         ImageInButton.SetValue(Grid.ColumnProperty, 1);
     }
     else if (!ImageAtRight)
     {
         ButtonText.SetValue(Grid.ColumnProperty, 1);
         ImageInButton.SetValue(Grid.ColumnProperty, 0);
     }
 }
 public override void WriteBinary(ESPWriter writer)
 {
     if (ButtonText != null)
     {
         ButtonText.WriteBinary(writer);
     }
     if (Conditions != null)
     {
         foreach (var item in Conditions)
         {
             item.WriteBinary(writer);
         }
     }
 }
 public override HashSet <IRenderComponent> GetRenderComponents()
 {
     if (Focused)
     {
         BlinkTimer++;
         if (BlinkTimer % 64 > 32)
         {
             ButtonText.SetText("");
         }
         else
         {
             ButtonText.SetText("Press new key");
         }
     }
     return(base.GetRenderComponents());
 }
Example #16
0
        protected void DrawText(Graphics g, ButtonText txt, Brush color, Rectangle btnRect)
        {
            string       text = txt.Content;
            Font         ft   = fontDefault;
            StringFormat fm;

            try
            {
                fm = alignedFormats[txt.Alignment];
            }
            catch (KeyNotFoundException)
            {
                logger.Warn("Alignment '{0}' is not implemented in {1}!", txt.Alignment.ToString().ToLower(), GetType().Name);
                return;
            }

            g.DrawString(text, ft, color, btnRect, fm);
        }
        public void Render()
        {
            if (Invisible)
            {
                return;
            }

            if (IsMarked)
            {
                MarkedButton.Render();
            }
            else
            {
                UnmarkedButton.Render();
            }

            ButtonText.Render();
        }
        void ReleaseDesignerOutlets()
        {
            if (ButtonText != null)
            {
                ButtonText.Dispose();
                ButtonText = null;
            }

            if (LabelText != null)
            {
                LabelText.Dispose();
                LabelText = null;
            }

            if (TextField != null)
            {
                TextField.Dispose();
                TextField = null;
            }
        }
        public override void WriteXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ButtonText != null)
            {
                ele.TryPathTo("ButtonText", true, out subEle);
                ButtonText.WriteXML(subEle, master);
            }
            if (Conditions != null)
            {
                ele.TryPathTo("Conditions", true, out subEle);
                foreach (var entry in Conditions)
                {
                    XElement newEle = new XElement("Condition");
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                }
            }
        }
        public void AsSerializableObject_ButtonTextIsBuilded_ObjectIsCorrectlySerialized()
        {
            ButtonText buttonText = new ButtonText
            {
                Today = "today",
                Month = "month",
                Week  = "week",
                Day   = "day"
            };
            object target = buttonText.AsSerializableObject();

            target.ShouldBeEquivalentTo(new
            {
                today = "today",
                month = "month",
                week  = "week",
                day   = "day",
                list  = buttonText.List?.ToString()
            });
        }
        public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "ITXT":
                    if (readTags.Contains("ITXT"))
                    {
                        return;
                    }
                    if (ButtonText == null)
                    {
                        ButtonText = new SimpleSubrecord <String>();
                    }

                    ButtonText.ReadBinary(reader);
                    break;

                case "CTDA":
                    if (Conditions == null)
                    {
                        Conditions = new List <Condition>();
                    }

                    Condition tempCTDA = new Condition();
                    tempCTDA.ReadBinary(reader);
                    Conditions.Add(tempCTDA);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
        /// <summary>
        /// </summary>
        private void CreateModifiersButton()
        {
            SelectModifiers = new ButtonText(FontsBitmap.GothamRegular, "Modifiers", 14, (o, e) =>
            {
                if (OnlineManager.CurrentGame.InProgress)
                {
                    NotificationManager.Show(NotificationLevel.Error, "Please wait until the match finishes before selecting mods.");
                    return;
                }

                DialogManager.Show(new ModifiersDialog());
            })
            {
                DestroyIfParentIsNull = false
            };

            if (OnlineManager.CurrentGame.Host == OnlineManager.Self.OnlineUser || OnlineManager.CurrentGame.FreeModType != MultiplayerFreeModType.None)
            {
                RightAligned.Add(SelectModifiers);
            }
        }
Example #23
0
        /// <summary>
        /// Altera a imagem do pictograma baseado no movimento atual
        /// </summary>
        /// <param name="nextPosition"></param>
        public void UpdateImage(MovimentosEnum nextPosition)
        {
            if (Finalizado)
            {
                return;
            }

            if (ButtonText.Equals("Iniciar"))
            {
                ButtonText = "Próxima";
            }

            if (nextPosition == MovimentosEnum.UNKNOWN)
            {
                FinalizarTreinamento();
                return;
            }

            CurrentImage = NextImage;
            NextImage    = ActivityManager.Instance.GetPositionPictogram(nextPosition);
        }
        private void CreateChangeTeamButton()
        {
            ChangeTeam = new ButtonText(FontsBitmap.GothamRegular, "Change Team", 14, (o, e) =>
            {
                if (OnlineManager.CurrentGame.PlayersReady.Contains(OnlineManager.Self.OnlineUser.Id))
                {
                    NotificationManager.Show(NotificationLevel.Error, "You must unready in order to switch teams!");
                    return;
                }

                if (OnlineManager.CurrentGame.CountdownStartTime != -1)
                {
                    NotificationManager.Show(NotificationLevel.Error, "You cannot switch teams when the countdown timer is active");
                    return;
                }

                lock (OnlineManager.CurrentGame.BlueTeamPlayers)
                    lock (OnlineManager.CurrentGame.RedTeamPlayers)
                    {
                        if (OnlineManager.CurrentGame.BlueTeamPlayers.Contains(OnlineManager.Self.OnlineUser.Id))
                        {
                            OnlineManager.Client?.ChangeGameTeam(MultiplayerTeam.Red);
                        }
                        else if (OnlineManager.CurrentGame.RedTeamPlayers.Contains(OnlineManager.Self.OnlineUser.Id))
                        {
                            OnlineManager.Client?.ChangeGameTeam(MultiplayerTeam.Blue);
                        }
                    }
            })
            {
                DestroyIfParentIsNull = false
            };

            if (OnlineManager.CurrentGame.Ruleset == MultiplayerGameRuleset.Team)
            {
                RightAligned.Add(ChangeTeam);
            }
        }
Example #25
0
 public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     base.Draw(gameTime, spriteBatch);
     ButtonText.Draw(gameTime, spriteBatch);
 }
Example #26
0
        public bool CloseAll(bool dontCloseCurrent = false)
        {
            CocoStudio.Core.Document document1 = !dontCloseCurrent ? (CocoStudio.Core.Document)null : this.ActiveDocument;
            bool flag = false;
            List <CocoStudio.Core.Document> documentList1 = new List <CocoStudio.Core.Document>();
            List <CocoStudio.Core.Document> documentList2 = new List <CocoStudio.Core.Document>();

            foreach (CocoStudio.Core.Document document2 in this.Documents)
            {
                if (document2 != document1)
                {
                    documentList1.Add(document2);
                    if (document2.IsDirty)
                    {
                        flag = true;
                        documentList2.Add(document2);
                    }
                }
            }
            if (flag)
            {
                string     info;
                ButtonText btnText;
                if (documentList2.Count == 1)
                {
                    info    = string.Format(LanguageInfo.MessageBox188_AskSaveCurFile, (object)Path.GetFileName(documentList2[0].Name));
                    btnText = new ButtonText(LanguageInfo.Command_Save, LanguageInfo.Dialog_ButtonDontSave, LanguageInfo.Dialog_ButtonCancel);
                }
                else
                {
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.Append(LanguageInfo.MessageBox189_AskSaveFiles);
                    foreach (CocoStudio.Core.Document document2 in documentList2)
                    {
                        stringBuilder.Append("\r\n    " + Path.GetFileName(document2.Name));
                    }
                    info    = stringBuilder.ToString();
                    btnText = new ButtonText(LanguageInfo.Command_SaveAll, LanguageInfo.Dialog_ButtonDontSave, LanguageInfo.Dialog_ButtonCancel);
                }
                switch (MessageBox.Show(info, btnText, (Window)null, (string)null, MessageBoxImage.Info))
                {
                case MessageBoxResult.Yes:
                    foreach (CocoStudio.Core.Document document2 in documentList2)
                    {
                        document2.Save();
                    }
                    if (document1 != null && document1.Project != null)
                    {
                        using (TaskServiceLock.Lock())
                        {
                            document1.Project.ReloadReferencedProject(Services.ProgressMonitors.Default);
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }

                case MessageBoxResult.Cancel:
                    return(false);
                }
            }
            foreach (CocoStudio.Core.Document document2 in documentList1)
            {
                document2.Close(true);
            }
            return(true);
        }
Example #27
0
 public void SetButtonText(ButtonText buttonText)
 {
     ButtonText = buttonText;
     OnPropertyChanged(nameof(ButtonText));
 }
Example #28
0
 SetValue(ButtonText, value);
 private void OnCancelInputs(object sender, EventArgs eventArgs)
 {
     Focused = false;
     ButtonText.SetText(KeyManager.Instance.GetKey(KeyActionType).ToString());
 }
Example #30
0
 public override void LoadContent()
 {
     base.LoadContent();
     ButtonText.LoadContent();
 }