Exemple #1
0
        public GDragAmount(Item item)
            : base(2140, 0, 0)
        {
            this.m_Item = item;
            int num = (int)(ushort)this.m_Item.Amount;

            this.m_Amount        = num;
            this.m_Okay          = new GButtonNew(2074, 2076, 2075, 102, 37);
            this.m_Okay.CanEnter = true;
            this.m_Okay.Clicked += new EventHandler(this.Okay_Clicked);
            this.m_Children.Add((Gump)this.m_Okay);
            GSlider gslider = new GSlider(2117, 35, 16, 95, 15, (double)num, 0.0, (double)num, 1.0);

            gslider.OnValueChange = new OnValueChange(this.Slider_OnValueChange);
            this.m_Children.Add((Gump)gslider);
            this.m_Slider = gslider;
            this.m_Children.Add((Gump) new GHotspot(28, 16, 109, 15, (Gump)gslider));
            GTextBox gtextBox = new GTextBox(0, false, 26, 43, 66, 15, num.ToString(), (IFont)Engine.GetFont(1), Hues.Load(1109), Hues.Load(1109), Hues.Load(1109));

            gtextBox.OnTextChange       += new OnTextChange(this.TextBox_OnTextChange);
            gtextBox.OnBeforeTextChange += new OnBeforeTextChange(this.TextBox_OnBeforeTextChange);
            gtextBox.EnterButton         = (IClickable)this.m_Okay;
            this.m_Children.Add((Gump)gtextBox);
            this.m_TextBox = gtextBox;
            gtextBox.Focus();
            this.m_IsDragging = true;
            this.m_OffsetX    = this.Width / 2;
            this.m_OffsetY    = this.Height / 2;
            Gumps.LastOver    = (Gump)this;
            Gumps.Drag        = (Gump)this;
            Gumps.Focus       = (Gump)this;
            this.m_X          = Engine.m_xMouse - this.m_OffsetX;
            this.m_Y          = Engine.m_yMouse - this.m_OffsetY;
        }
Exemple #2
0
        public GIdleWarning()
            : base(2604, 100, 100, 0, 0, true)
        {
            this.m_CanDrag   = true;
            this.m_QuickDrag = true;
            GWrappedLabel gwrappedLabel = new GWrappedLabel("You have been idle for too long. If you do not do anything in the next minute, you will be logged out.", (IFont)Engine.GetFont(2), Hues.Load(1109), this.OffsetX, this.OffsetY - 12, 275);

            this.m_Children.Add((Gump)gwrappedLabel);
            GButtonNew gbuttonNew = new GButtonNew(1153, 0, gwrappedLabel.Y + gwrappedLabel.Height + 4);

            gbuttonNew.Clicked += new EventHandler(this.Check_Clicked);
            this.m_Children.Add((Gump)gbuttonNew);
            this.Width   = this.Width - this.UseWidth + gwrappedLabel.Width;
            this.Height  = this.Height - this.UseHeight + gwrappedLabel.Height - 12;
            gbuttonNew.X = this.OffsetX + (this.UseWidth - gbuttonNew.Width) / 2;
            this.Center();
        }
        public GQuestionMenu(int serial, int menuID, string question, AnswerEntry[] answers)
            : base(9204, Engine.ScreenWidth / 2, 100, 50, 50, true)
        {
            this.m_CanDrag   = true;
            this.m_QuickDrag = true;
            this.m_Serial    = serial;
            this.m_MenuID    = menuID;
            GWrappedLabel gwrappedLabel = new GWrappedLabel(question, (IFont)Engine.GetFont(1), Hues.Load(1109), this.OffsetX + 4, this.OffsetY + 4, this.UseWidth - 8);

            this.m_Children.Add((Gump)gwrappedLabel);
            this.m_Entries = new GQuestionMenuEntry[answers.Length];
            GBackground gbackground = (GBackground) new GQuestionBackground(this.m_Entries, this.UseWidth - 8, this.UseHeight - 8 - gwrappedLabel.Height - 4, this.OffsetX + 4, gwrappedLabel.Y + gwrappedLabel.Height + 4);

            gbackground.SetMouseOverride((Gump)this);
            int offsetX  = gbackground.OffsetX;
            int offsetY1 = gbackground.OffsetY;
            int useWidth = gbackground.UseWidth;

            for (int index = 0; index < answers.Length; ++index)
            {
                GQuestionMenuEntry gquestionMenuEntry = new GQuestionMenuEntry(offsetX, offsetY1, useWidth, answers[index]);
                gbackground.Children.Add((Gump)gquestionMenuEntry);
                gquestionMenuEntry.Radio.ParentOverride = (Gump)gbackground;
                this.m_Entries[index] = gquestionMenuEntry;
                offsetY1 += gquestionMenuEntry.Height + 4;
            }
            gbackground.Height = offsetY1 - 4 - gbackground.OffsetY + (gbackground.Height - gbackground.UseHeight);
            this.Height        = this.Height - this.UseHeight + 4 + gwrappedLabel.Height + 4 + gbackground.Height + 4;
            int num1 = (int)((double)Engine.ScreenHeight * 0.75);

            if (this.Height > num1)
            {
                this.Height        = num1;
                gbackground.Height = this.UseHeight - 8 - gwrappedLabel.Height - 4;
            }
            int num2 = offsetY1 - 4 - gbackground.OffsetY;

            if (num2 > gbackground.UseHeight)
            {
                int num3 = num2;
                gbackground.Width += 19;
                this.Width        += 19;
                int num4     = gbackground.OffsetX + gbackground.UseWidth - 15;
                int offsetY2 = gbackground.OffsetY;
                gbackground.Children.Add((Gump) new GImage(257, num4, offsetY2));
                gbackground.Children.Add((Gump) new GImage((int)byte.MaxValue, num4, offsetY2 + gbackground.UseHeight - 32));
                int y = offsetY2 + 30;
                while (y + 32 < gbackground.UseHeight)
                {
                    gbackground.Children.Add((Gump) new GImage(256, num4, y));
                    y += 30;
                }
                this.m_Slider = new GVSlider(254, num4 + 1, offsetY2 + 1 + 12, 13, gbackground.UseHeight - 2 - 24, 0.0, 0.0, (double)(num3 - gbackground.UseHeight), 1.0);
                this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll);
                this.m_Slider.ScrollOffset  = 20.0;
                gbackground.Children.Add((Gump)this.m_Slider);
                gbackground.Children.Add((Gump) new GHotspot(num4, offsetY2, 15, gbackground.UseHeight, (Gump)this.m_Slider));
            }
            GButtonNew gbuttonNew1 = new GButtonNew(243, 242, 241, 0, gbackground.Y + gbackground.Height + 4);
            GButtonNew gbuttonNew2 = new GButtonNew(249, 247, 248, 0, gbuttonNew1.Y);

            gbuttonNew1.Clicked += new EventHandler(this.Cancel_Clicked);
            gbuttonNew2.Clicked += new EventHandler(this.Okay_Clicked);
            gbuttonNew1.X        = this.OffsetX + this.UseWidth - 4 - gbuttonNew1.Width;
            gbuttonNew2.X        = gbuttonNew1.X - 4 - gbuttonNew2.Width;
            this.m_Children.Add((Gump)gbuttonNew1);
            this.m_Children.Add((Gump)gbuttonNew2);
            this.Height += 4 + gbuttonNew1.Height;
            this.m_Children.Add((Gump)gbackground);
            this.Center();
        }