コード例 #1
0
ファイル: CommandInfoProvider.cs プロジェクト: uotools/PlayUO
        public override void UpdateGump(Gump g)
        {
            GHtmlLabel label = (GHtmlLabel)g;

            label.Children.Clear();
            label.Update(this.GetText(), Engine.GetUniFont(1), GumpColors.WindowText);
        }
コード例 #2
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 toAdd = new GServerBackground(this, x, y, width, height, 0xbbc, true);
                    GHtmlLabel        label = new GHtmlLabel(text, uniFont, color, toAdd.OffsetX - 2, toAdd.OffsetY - 1, toAdd.UseWidth);
                    label.Scissor(0, 0, label.Width, toAdd.UseHeight);
                    toAdd.Children.Add(label);
                    this.Pages(thisPage).Add(toAdd);
                }
                else
                {
                    GHtmlLabel label2 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
                    label2.Scissor(0, 0, label2.Width, height);
                    this.Pages(thisPage).Add(label2);
                }
            }
            else
            {
                GHtmlLabel label3;
                int        num;
                width -= 15;
                if (hasBack)
                {
                    GServerBackground background2 = new GServerBackground(this, x, y, width, height, 0xbbc, true);
                    label3 = new GHtmlLabel(text, uniFont, color, background2.OffsetX - 2, background2.OffsetY - 1, background2.UseWidth);
                    label3.Scissor(0, 0, label3.Width, num = background2.UseHeight);
                    background2.Children.Add(label3);
                    this.Pages(thisPage).Add(background2);
                }
                else
                {
                    label3 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
                    label3.Scissor(0, 0, label3.Width, num = height);
                    this.Pages(thisPage).Add(label3);
                }
                if ((height >= 0x1b) && (label3.Height > num))
                {
                    this.Pages(thisPage).Add(new GImage(0x101, x + width, y));
                    this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20));
                    for (int i = y + 30; (i + 0x20) < (y + height); i += 30)
                    {
                        this.Pages(thisPage).Add(new GImage(0x100, x + width, i));
                    }
                    GVSlider slider = new GVSlider(0xfe, (x + width) + 1, (y + 1) + 12, 13, (height - 2) - 0x18, 0.0, 0.0, (double)(label3.Height - num), 1.0);
                    slider.SetTag("yBase", label3.Y);
                    slider.SetTag("toScroll", label3);
                    slider.SetTag("viewHeight", num);
                    slider.OnValueChange = new OnValueChange(this.OnScroll);
                    this.Pages(thisPage).Add(slider);
                    this.Pages(thisPage).Add(new GHotspot(x + width, y, 15, height, slider));
                }
                else
                {
                    this.Pages(thisPage).Add(new GImage(0x101, x + width, y));
                    this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20));
                    for (int j = y + 30; (j + 0x20) < (y + height); j += 30)
                    {
                        this.Pages(thisPage).Add(new GImage(0x100, x + width, j));
                    }
                    this.Pages(thisPage).Add(new GImage(0xfe, Hues.Grayscale, (x + width) + 1, y + 1));
                }
            }
        }
コード例 #3
0
ファイル: GServerGump.cs プロジェクト: Skinny1001/PlayUO
 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 toAdd = new GServerBackground(this, x, y, width, height, 0xbbc, true);
             GHtmlLabel label = new GHtmlLabel(text, uniFont, color, toAdd.OffsetX - 2, toAdd.OffsetY - 1, toAdd.UseWidth);
             label.Scissor(0, 0, label.Width, toAdd.UseHeight);
             toAdd.Children.Add(label);
             this.Pages(thisPage).Add(toAdd);
         }
         else
         {
             GHtmlLabel label2 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
             label2.Scissor(0, 0, label2.Width, height);
             this.Pages(thisPage).Add(label2);
         }
     }
     else
     {
         GHtmlLabel label3;
         int num;
         width -= 15;
         if (hasBack)
         {
             GServerBackground background2 = new GServerBackground(this, x, y, width, height, 0xbbc, true);
             label3 = new GHtmlLabel(text, uniFont, color, background2.OffsetX - 2, background2.OffsetY - 1, background2.UseWidth);
             label3.Scissor(0, 0, label3.Width, num = background2.UseHeight);
             background2.Children.Add(label3);
             this.Pages(thisPage).Add(background2);
         }
         else
         {
             label3 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
             label3.Scissor(0, 0, label3.Width, num = height);
             this.Pages(thisPage).Add(label3);
         }
         if ((height >= 0x1b) && (label3.Height > num))
         {
             this.Pages(thisPage).Add(new GImage(0x101, x + width, y));
             this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20));
             for (int i = y + 30; (i + 0x20) < (y + height); i += 30)
             {
                 this.Pages(thisPage).Add(new GImage(0x100, x + width, i));
             }
             GVSlider slider = new GVSlider(0xfe, (x + width) + 1, (y + 1) + 12, 13, (height - 2) - 0x18, 0.0, 0.0, (double) (label3.Height - num), 1.0);
             slider.SetTag("yBase", label3.Y);
             slider.SetTag("toScroll", label3);
             slider.SetTag("viewHeight", num);
             slider.OnValueChange = new OnValueChange(this.OnScroll);
             this.Pages(thisPage).Add(slider);
             this.Pages(thisPage).Add(new GHotspot(x + width, y, 15, height, slider));
         }
         else
         {
             this.Pages(thisPage).Add(new GImage(0x101, x + width, y));
             this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20));
             for (int j = y + 30; (j + 0x20) < (y + height); j += 30)
             {
                 this.Pages(thisPage).Add(new GImage(0x100, x + width, j));
             }
             this.Pages(thisPage).Add(new GImage(0xfe, Hues.Grayscale, (x + width) + 1, y + 1));
         }
     }
 }