Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
        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();
        }