Exemplo n.º 1
0
        public XG_PlusMinus(Rectangle rect, string text, XG_ClickedEvent clickedHandler, float step = 1f, bool Repeat = false, bool selfdisplay = false, float min = 0f, float max = 0f,float startAt =0f,string StringValueFormat = "F0",bool loop =false)
            : base(rect, true)
        {
            this.stringValueFormat = StringValueFormat;

            this._Value = startAt;
            this.Loop = loop;
            this.Selfdisplay = selfdisplay;
            this.Max = max;
            this.Min = min;

            this.Step = step;
            this.repeat = Repeat;

                if (this.Max == 0 && this.Min == 0)
                {

                // this.Loop= false;
                }

            ClickedHandler = clickedHandler;

            Rectangle partRect = rect;
            partRect.X = partRect.Y = 0; // reset and relative to  relative

            Rectangle minusSq = new Rectangle(partRect.X, partRect.Top + 25, 16, 16);
            this.ButtonMinus = new XG_Button(minusSq, "-", this.Minus_Clicked);
            Children.Add(ButtonMinus);

            Rectangle plusSq = new Rectangle(minusSq.Right + 16, minusSq.Y, 16, 16);
            this.ButtonPlus = new XG_Button(plusSq, "+", this.Plus_Clicked);
            Children.Add(ButtonPlus);

            this.Valuetext = new XG_Label(new Rectangle(plusSq.Right + 1, plusSq.Center.Y, 0, 0), ": ");
            Children.Add(Valuetext);
            LabelText = new XG_Label(new Rectangle(minusSq.X, minusSq.Y - 7, 0, 0), text);
            Children.Add(LabelText);
        }
Exemplo n.º 2
0
        public XG_LabeledSlider(Rectangle rect, int labelWidth, string text, int valueLabelWidth, float value, float min, float max, XG_ClickedEvent clickedHandler = null)
            : base(rect, true)
        {
            ClickedHandler = clickedHandler;
            ValueLabelFormat = "F3";

            Rectangle partRect = rect;
            partRect.X = partRect.Y = 0; // parent relative

            partRect.Width = labelWidth;
            Label = new XG_Label(partRect, text, GUIAlignment.Right | GUIAlignment.VCenter);
            Children.Add(Label);

            partRect.X += partRect.Width + 1;
            partRect.Width = rect.Width - (labelWidth + valueLabelWidth + 2);
            Slider = new XG_HSlider(partRect, 0.0f);
            Slider.SetRange(value, min, max);
            Children.Add(Slider);

            partRect.X = Slider.Rectangle.X + Slider.Rectangle.Width + 1;
            partRect.Width = valueLabelWidth;
            ValueLabel = new XG_Label(partRect, "0.000");
            Children.Add(ValueLabel);
        }
Exemplo n.º 3
0
        public Server(Mod game, Rectangle rect)
            : base(rect, "Tshock")
        {
            Game = game;

            Rectangle pageRect = this.Rectangle; // tab pages are the size of the tab control
            pageRect.X = pageRect.Y = 0;
            pageRect.Height = 148;
            label = new XG_Label(new Rectangle(0, this.Rectangle.Height - 30, 200, 20), "Player name");
            Children.Add(label ); // leave default Left/VCenter alignment

            XGTabControl tab = new XGTabControl(pageRect);
            Children.Add(tab); // add the tab control to our child control list

            serverCommand1 = new ServerCommand1(game, pageRect);
            tab.Children.Add(serverCommand1);
            serverCommand2 = new ServerCommand2(game, pageRect);
            tab.Children.Add(serverCommand2);
            serverCommand3 = new ServerCommand3(game, pageRect);
            tab.Children.Add(serverCommand3);
            serverCommand4 = new ServerCommand4(game, pageRect);
            tab.Children.Add(serverCommand4);

            give = new Give(game, pageRect);
            tab.Children.Add(give);
        }
Exemplo n.º 4
0
        public InV(Mod game, Rectangle rect)
            : base(rect, "Inv")
        {
            Game = game;
            Children.Add(new XG_Label(new Rectangle(10, 0, 200, 20), "change inventory"));

            string text = "";
            text = "Cathegory";
            Cathegory = new XG_PlusMinus(new Rectangle(10, 10, 100, 60), text, this.Cathegory_Clicked, 1f, false, true, 0, 10, 1, "F0", true);
            Children.Add(Cathegory);

            text = "Inventory";
            Inventor = new XG_PlusMinus(new Rectangle(10, 60, 100, 60), text, this.Inventory_Clicked, 1f, false, true, 0, 10, 1, "F0", true);
            Children.Add(Inventor);
            LAbel = new XG_Label(new Rectangle(100, 85, 200, 20), "Max Inventories: 0");
            Children.Add(LAbel);

            Children.Add(new XG_Button(new Rectangle(210, 40, 100, 20), "Restore", this.Restore_Clicked));
        }