Exemplo n.º 1
0
        public GSellGump_OfferMenu(GSellGump owner)
            : base(2163, 170, 214)
        {
            this.m_Owner = owner;
            Mobile player = World.Player;
            string name;
            string Text;

            if (player != null && (name = player.Name) != null && (Text = name.Trim()).Length > 0)
            {
                this.m_Signature         = new GLabel(Text, (IFont)Engine.GetFont(5), Hues.Load(1109), 72, 194);
                this.m_Signature.Visible = false;
                this.m_Children.Add((Gump)this.m_Signature);
            }
            this.m_Total  = new GLabel("0", (IFont)Engine.GetFont(6), Hues.Default, 188, 167);
            this.m_Accept = new GSellAccept(owner);
            this.m_Clear  = new GSellClear(owner);
            this.m_Children.Add((Gump)this.m_Total);
            this.m_Children.Add((Gump)this.m_Accept);
            this.m_Children.Add((Gump)this.m_Clear);
            this.m_CanDrag   = true;
            this.m_QuickDrag = true;
            GVSlider gvSlider = new GVSlider(2088, 237, 81, 34, 58, 0.0, 0.0, 50.0, 1.0);

            this.m_Slider = gvSlider;
            this.m_Children.Add((Gump)gvSlider);
            this.m_Children.Add((Gump) new GHotspot(237, 66, 34, 84, (Gump)gvSlider));
        }
Exemplo n.º 2
0
        public GSellGump(int serial, SellInfo[] info)
            : base(2162, 15, 15)
        {
            this.m_GUID   = string.Format("GSellGump-{0}", (object)serial);
            this.m_Serial = serial;
            this.m_Info   = info;
            Engine.GetUniFont(3);
            Hues.Load(648);
            Array.Sort <SellInfo>(info);
            int y = 66;

            for (int index = 0; index < info.Length; ++index)
            {
                bool     seperate = index != info.Length - 1;
                SellInfo si       = info[index];
                GSellGump_InventoryItem gumpInventoryItem = new GSellGump_InventoryItem(this, si, y, seperate);
                this.m_Children.Add((Gump)gumpInventoryItem);
                si.InventoryGump = gumpInventoryItem;
                y += gumpInventoryItem.Height;
                if (seperate)
                {
                    y += 16;
                }
            }
            if (y > 230)
            {
                GVSlider gvSlider = new GVSlider(2088, 237, 81, 34, 92, 0.0, 0.0, (double)(y - 230), 1.0);
                gvSlider.OnValueChange = new OnValueChange(this.Slider_OnValueChange);
                this.m_Children.Add((Gump)gvSlider);
                this.m_Children.Add((Gump) new GHotspot(237, 66, 34, 122, (Gump)gvSlider));
            }
            this.m_NonRestrictivePicking = true;
            this.m_OfferMenu             = new GSellGump_OfferMenu(this);
            this.m_Children.Add((Gump)this.m_OfferMenu);
            this.m_X = (Engine.ScreenWidth - (this.m_OfferMenu.X + this.m_OfferMenu.Width)) / 2;
            this.m_Y = (Engine.ScreenHeight - (this.m_OfferMenu.Y + this.m_OfferMenu.Height)) / 2;
        }
Exemplo n.º 3
0
        private void ProcessHtmlGump(int thisPage, int x, int y, int width, int height, string text, bool hasBack, bool hasScroll, int color)
        {
            UnicodeFont uniFont = Engine.GetUniFont(1);

            if (!hasScroll)
            {
                if (hasBack)
                {
                    GServerBackground gserverBackground = new GServerBackground(this, x, y, width, height, 3004, true);
                    GHtmlLabel        ghtmlLabel        = new GHtmlLabel(text, uniFont, color, gserverBackground.OffsetX - 2, gserverBackground.OffsetY - 1, gserverBackground.UseWidth);
                    ghtmlLabel.Scissor(0, 0, ghtmlLabel.Width, gserverBackground.UseHeight);
                    gserverBackground.Children.Add((Gump)ghtmlLabel);
                    this.Pages(thisPage).Add((Gump)gserverBackground);
                }
                else
                {
                    GHtmlLabel ghtmlLabel = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
                    ghtmlLabel.Scissor(0, 0, ghtmlLabel.Width, height);
                    this.Pages(thisPage).Add((Gump)ghtmlLabel);
                }
            }
            else
            {
                width -= 15;
                GHtmlLabel ghtmlLabel;
                int        num;
                if (hasBack)
                {
                    GServerBackground gserverBackground = new GServerBackground(this, x, y, width, height, 3004, true);
                    ghtmlLabel = new GHtmlLabel(text, uniFont, color, gserverBackground.OffsetX - 2, gserverBackground.OffsetY - 1, gserverBackground.UseWidth);
                    ghtmlLabel.Scissor(0, 0, ghtmlLabel.Width, num = gserverBackground.UseHeight);
                    gserverBackground.Children.Add((Gump)ghtmlLabel);
                    this.Pages(thisPage).Add((Gump)gserverBackground);
                }
                else
                {
                    ghtmlLabel = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
                    ghtmlLabel.Scissor(0, 0, ghtmlLabel.Width, num = height);
                    this.Pages(thisPage).Add((Gump)ghtmlLabel);
                }
                if (height >= 27 && ghtmlLabel.Height > num)
                {
                    this.Pages(thisPage).Add((Gump) new GImage(257, x + width, y));
                    this.Pages(thisPage).Add((Gump) new GImage((int)byte.MaxValue, x + width, y + height - 32));
                    int y1 = y + 30;
                    while (y1 + 32 < y + height)
                    {
                        this.Pages(thisPage).Add((Gump) new GImage(256, x + width, y1));
                        y1 += 30;
                    }
                    GVSlider gvSlider = new GVSlider(254, x + width + 1, y + 1 + 12, 13, height - 2 - 24, 0.0, 0.0, (double)(ghtmlLabel.Height - num), 1.0);
                    gvSlider.SetTag("yBase", (object)ghtmlLabel.Y);
                    gvSlider.SetTag("toScroll", (object)ghtmlLabel);
                    gvSlider.SetTag("viewHeight", (object)num);
                    gvSlider.OnValueChange = new OnValueChange(this.OnScroll);
                    this.Pages(thisPage).Add((Gump)gvSlider);
                    this.Pages(thisPage).Add((Gump) new GHotspot(x + width, y, 15, height, (Gump)gvSlider));
                }
                else
                {
                    this.Pages(thisPage).Add((Gump) new GImage(257, x + width, y));
                    this.Pages(thisPage).Add((Gump) new GImage((int)byte.MaxValue, x + width, y + height - 32));
                    int y1 = y + 30;
                    while (y1 + 32 < y + height)
                    {
                        this.Pages(thisPage).Add((Gump) new GImage(256, x + width, y1));
                        y1 += 30;
                    }
                    this.Pages(thisPage).Add((Gump) new GImage(254, Hues.Grayscale, x + width + 1, y + 1));
                }
            }
        }
Exemplo n.º 4
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();
        }