Exemplo n.º 1
0
        public GQuestionMenu(int serial, int menuID, string question, AnswerEntry[] answers) : base(0x23f4, Engine.ScreenWidth / 2, 100, 50, 50, true)
        {
            base.m_CanDrag   = true;
            base.m_QuickDrag = true;
            this.m_Serial    = serial;
            this.m_MenuID    = menuID;
            GWrappedLabel toAdd = new GWrappedLabel(question, Engine.GetFont(1), Hues.Load(0x455), base.OffsetX + 4, base.OffsetY + 4, base.UseWidth - 8);

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

            background.SetMouseOverride(this);
            int offsetX  = background.OffsetX;
            int offsetY  = background.OffsetY;
            int useWidth = background.UseWidth;

            for (int i = 0; i < answers.Length; i++)
            {
                GQuestionMenuEntry entry = new GQuestionMenuEntry(offsetX, offsetY, useWidth, answers[i]);
                background.Children.Add(entry);
                entry.Radio.ParentOverride = background;
                this.m_Entries[i]          = entry;
                offsetY += entry.Height + 4;
            }
            background.Height = ((offsetY - 4) - background.OffsetY) + (background.Height - background.UseHeight);
            this.Height       = (((((this.Height - base.UseHeight) + 4) + toAdd.Height) + 4) + background.Height) + 4;
            int num5 = (int)(Engine.ScreenHeight * 0.75);

            if (this.Height > num5)
            {
                this.Height       = num5;
                background.Height = ((base.UseHeight - 8) - toAdd.Height) - 4;
            }
            offsetY -= 4;
            offsetY -= background.OffsetY;
            if (offsetY > background.UseHeight)
            {
                int num6 = offsetY;
                background.Width += 0x13;
                this.Width       += 0x13;
                offsetX           = (background.OffsetX + background.UseWidth) - 15;
                offsetY           = background.OffsetY;
                background.Children.Add(new GImage(0x101, offsetX, offsetY));
                background.Children.Add(new GImage(0xff, offsetX, (offsetY + background.UseHeight) - 0x20));
                for (int j = offsetY + 30; (j + 0x20) < background.UseHeight; j += 30)
                {
                    background.Children.Add(new GImage(0x100, offsetX, j));
                }
                this.m_Slider = new GVSlider(0xfe, offsetX + 1, (offsetY + 1) + 12, 13, (background.UseHeight - 2) - 0x18, 0.0, 0.0, (double)(num6 - background.UseHeight), 1.0);
                this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll);
                this.m_Slider.ScrollOffset  = 20.0;
                background.Children.Add(this.m_Slider);
                background.Children.Add(new GHotspot(offsetX, offsetY, 15, background.UseHeight, this.m_Slider));
            }
            GButtonNew new2 = new GButtonNew(0xf3, 0xf2, 0xf1, 0, (background.Y + background.Height) + 4);
            GButtonNew new3 = new GButtonNew(0xf9, 0xf7, 0xf8, 0, new2.Y);

            new2.Clicked += new EventHandler(this.Cancel_Clicked);
            new3.Clicked += new EventHandler(this.Okay_Clicked);
            new2.X        = ((base.OffsetX + base.UseWidth) - 4) - new2.Width;
            new3.X        = (new2.X - 4) - new3.Width;
            base.m_Children.Add(new2);
            base.m_Children.Add(new3);
            this.Height += 4 + new2.Height;
            base.m_Children.Add(background);
            this.Center();
        }
Exemplo n.º 2
0
 public GQuestionMenu(int serial, int menuID, string question, AnswerEntry[] answers)
     : base(0x23f4, Engine.ScreenWidth / 2, 100, 50, 50, true)
 {
     base.m_CanDrag = true;
     base.m_QuickDrag = true;
     this.m_Serial = serial;
     this.m_MenuID = menuID;
     GWrappedLabel toAdd = new GWrappedLabel(question, Engine.GetFont(1), Hues.Load(0x455), base.OffsetX + 4, base.OffsetY + 4, base.UseWidth - 8);
     base.m_Children.Add(toAdd);
     this.m_Entries = new GQuestionMenuEntry[answers.Length];
     GBackground background = new GQuestionBackground(this.m_Entries, base.UseWidth - 8, ((base.UseHeight - 8) - toAdd.Height) - 4, base.OffsetX + 4, (toAdd.Y + toAdd.Height) + 4);
     background.SetMouseOverride(this);
     int offsetX = background.OffsetX;
     int offsetY = background.OffsetY;
     int useWidth = background.UseWidth;
     for (int i = 0; i < answers.Length; i++)
     {
         GQuestionMenuEntry entry = new GQuestionMenuEntry(offsetX, offsetY, useWidth, answers[i]);
         background.Children.Add(entry);
         entry.Radio.ParentOverride = background;
         this.m_Entries[i] = entry;
         offsetY += entry.Height + 4;
     }
     background.Height = ((offsetY - 4) - background.OffsetY) + (background.Height - background.UseHeight);
     this.Height = (((((this.Height - base.UseHeight) + 4) + toAdd.Height) + 4) + background.Height) + 4;
     int num5 = (int) (Engine.ScreenHeight * 0.75);
     if (this.Height > num5)
     {
         this.Height = num5;
         background.Height = ((base.UseHeight - 8) - toAdd.Height) - 4;
     }
     offsetY -= 4;
     offsetY -= background.OffsetY;
     if (offsetY > background.UseHeight)
     {
         int num6 = offsetY;
         background.Width += 0x13;
         this.Width += 0x13;
         offsetX = (background.OffsetX + background.UseWidth) - 15;
         offsetY = background.OffsetY;
         background.Children.Add(new GImage(0x101, offsetX, offsetY));
         background.Children.Add(new GImage(0xff, offsetX, (offsetY + background.UseHeight) - 0x20));
         for (int j = offsetY + 30; (j + 0x20) < background.UseHeight; j += 30)
         {
             background.Children.Add(new GImage(0x100, offsetX, j));
         }
         this.m_Slider = new GVSlider(0xfe, offsetX + 1, (offsetY + 1) + 12, 13, (background.UseHeight - 2) - 0x18, 0.0, 0.0, (double) (num6 - background.UseHeight), 1.0);
         this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll);
         this.m_Slider.ScrollOffset = 20.0;
         background.Children.Add(this.m_Slider);
         background.Children.Add(new GHotspot(offsetX, offsetY, 15, background.UseHeight, this.m_Slider));
     }
     GButtonNew new2 = new GButtonNew(0xf3, 0xf2, 0xf1, 0, (background.Y + background.Height) + 4);
     GButtonNew new3 = new GButtonNew(0xf9, 0xf7, 0xf8, 0, new2.Y);
     new2.Clicked += new EventHandler(this.Cancel_Clicked);
     new3.Clicked += new EventHandler(this.Okay_Clicked);
     new2.X = ((base.OffsetX + base.UseWidth) - 4) - new2.Width;
     new3.X = (new2.X - 4) - new3.Width;
     base.m_Children.Add(new2);
     base.m_Children.Add(new3);
     this.Height += 4 + new2.Height;
     base.m_Children.Add(background);
     this.Center();
 }