Beispiel #1
0
        public GDragAmount(Client.Item item) : base(0x85c, 0, 0)
        {
            GTextBox box;

            this.m_First = true;
            this.m_Item  = item;
            int amount = (ushort)this.m_Item.Amount;

            this.m_Amount        = amount;
            this.m_Okay          = new GButtonNew(0x81a, 0x81c, 0x81b, 0x66, 0x25);
            this.m_Okay.CanEnter = true;
            this.m_Okay.Clicked += new EventHandler(this.Okay_Clicked);
            base.m_Children.Add(this.m_Okay);
            GSlider toAdd = new GSlider(0x845, 0x23, 0x10, 0x5f, 15, (double)amount, 0.0, (double)amount, 1.0)
            {
                OnValueChange = new OnValueChange(this.Slider_OnValueChange)
            };

            base.m_Children.Add(toAdd);
            this.m_Slider = toAdd;
            GHotspot hotspot = new GHotspot(0x1c, 0x10, 0x6d, 15, toAdd);

            base.m_Children.Add(hotspot);
            box = new GTextBox(0, false, 0x1a, 0x2b, 0x42, 15, amount.ToString(), Engine.GetFont(1), Hues.Load(0x455), Hues.Load(0x455), Hues.Load(0x455))
            {
                OnTextChange       = (OnTextChange)Delegate.Combine(box.OnTextChange, new OnTextChange(this.TextBox_OnTextChange)),
                OnBeforeTextChange = (OnBeforeTextChange)Delegate.Combine(box.OnBeforeTextChange, new OnBeforeTextChange(this.TextBox_OnBeforeTextChange)),
                EnterButton        = this.m_Okay
            };
            base.m_Children.Add(box);
            this.m_TextBox = box;
            box.Focus();
            base.m_IsDragging = true;
            base.m_OffsetX    = this.Width / 2;
            base.m_OffsetY    = this.Height / 2;
            Gumps.LastOver    = this;
            Gumps.Drag        = this;
            Gumps.Focus       = this;
            base.m_X          = Engine.m_xMouse - base.m_OffsetX;
            base.m_Y          = Engine.m_yMouse - base.m_OffsetY;
        }
Beispiel #2
0
 public GDragAmount(Client.Item item)
     : base(0x85c, 0, 0)
 {
     GTextBox box;
     this.m_First = true;
     this.m_Item = item;
     int amount = (ushort) this.m_Item.Amount;
     this.m_Amount = amount;
     this.m_Okay = new GButtonNew(0x81a, 0x81c, 0x81b, 0x66, 0x25);
     this.m_Okay.CanEnter = true;
     this.m_Okay.Clicked += new EventHandler(this.Okay_Clicked);
     base.m_Children.Add(this.m_Okay);
     GSlider toAdd = new GSlider(0x845, 0x23, 0x10, 0x5f, 15, (double) amount, 0.0, (double) amount, 1.0) {
         OnValueChange = new OnValueChange(this.Slider_OnValueChange)
     };
     base.m_Children.Add(toAdd);
     this.m_Slider = toAdd;
     GHotspot hotspot = new GHotspot(0x1c, 0x10, 0x6d, 15, toAdd);
     base.m_Children.Add(hotspot);
     box = new GTextBox(0, false, 0x1a, 0x2b, 0x42, 15, amount.ToString(), Engine.GetFont(1), Hues.Load(0x455), Hues.Load(0x455), Hues.Load(0x455)) {
         OnTextChange = (OnTextChange) Delegate.Combine(box.OnTextChange, new OnTextChange(this.TextBox_OnTextChange)),
         OnBeforeTextChange = (OnBeforeTextChange) Delegate.Combine(box.OnBeforeTextChange, new OnBeforeTextChange(this.TextBox_OnBeforeTextChange)),
         EnterButton = this.m_Okay
     };
     base.m_Children.Add(box);
     this.m_TextBox = box;
     box.Focus();
     base.m_IsDragging = true;
     base.m_OffsetX = this.Width / 2;
     base.m_OffsetY = this.Height / 2;
     Gumps.LastOver = this;
     Gumps.Drag = this;
     Gumps.Focus = this;
     base.m_X = Engine.m_xMouse - base.m_OffsetX;
     base.m_Y = Engine.m_yMouse - base.m_OffsetY;
 }
Beispiel #3
0
 public static void UpdateStaticSlider_OnValueChange(double Value, double Old, Gump Sender)
 {
     if ((((Sender.HasTag("Static") && Sender.HasTag("Font")) && (Sender.HasTag("Hue") && Sender.HasTag("Slider1"))) && (Sender.HasTag("Slider2") && Sender.HasTag("Slider3"))) && Sender.HasTag("Max"))
     {
         GLabel tag = (GLabel) Sender.GetTag("Static");
         IFont font = (IFont) Sender.GetTag("Font");
         IHue hue = (IHue) Sender.GetTag("Hue");
         GSlider[] sliderArray = new GSlider[3];
         for (int i = 0; i < 3; i++)
         {
             sliderArray[i] = (GSlider) Sender.GetTag(string.Format("Slider{0}", i + 1));
         }
         double num2 = (double) Sender.GetTag("Max");
         if (((tag != null) && (font != null)) && (hue != null))
         {
             GSlider slider = null;
             GSlider slider2 = null;
             GSlider slider3 = null;
             double num3 = -1000.0;
             double num4 = 1000.0;
             for (int j = 0; j < 3; j++)
             {
                 if ((sliderArray[j] != Sender) && (sliderArray[j].GetValue() < num4))
                 {
                     num4 = sliderArray[j].GetValue();
                     slider2 = sliderArray[j];
                 }
                 else if (sliderArray[j] == Sender)
                 {
                     slider3 = sliderArray[j];
                 }
             }
             for (int k = 0; k < 3; k++)
             {
                 if (((sliderArray[k] != Sender) && (sliderArray[k] != slider2)) && (sliderArray[k].GetValue() > num3))
                 {
                     num3 = sliderArray[k].GetValue();
                     slider = sliderArray[k];
                 }
             }
             if (((slider3 == null) || (slider == null)) || (slider2 == null))
             {
                 tag.Text = Value.ToString();
             }
             else
             {
                 slider2.SetValue(num2 - (Value + slider.GetValue()), false);
                 slider.SetValue(num2 - (Value + slider2.GetValue()), false);
                 slider3.SetValue(num2 - (slider2.GetValue() + slider.GetValue()), false);
                 Value = slider3.GetValue();
                 slider2.SetValue(num2 - (Value + slider.GetValue()), false);
                 slider.SetValue(num2 - (Value + slider2.GetValue()), false);
                 slider3.SetValue(num2 - (slider2.GetValue() + slider.GetValue()), false);
                 Value = slider3.GetValue();
                 tag.Text = slider3.GetValue().ToString();
                 if (((slider2.GetValue() + slider.GetValue()) + slider3.GetValue()) != num2)
                 {
                     tag.Hue = Hues.Load(0x66d);
                 }
                 else
                 {
                     tag.Hue = hue;
                 }
                 ((GLabel) slider2.GetTag("Static")).Text = slider2.GetValue().ToString();
                 ((GLabel) slider.GetTag("Static")).Text = slider.GetValue().ToString();
             }
         }
     }
 }
Beispiel #4
0
 public static void ShowCharCreationSkills(int Str, int Dex, int Int, int vSkill1, int vSkill2, int vSkill3, int iSkill1, int iSkill2, int iSkill3)
 {
     GButton button2;
     GVSlider slider;
     GTextButton button3;
     GTextButton button4;
     GTextButton button5;
     Cursor.Hourglass = false;
     GBackground toAdd = new GBackground(0xa2c, 0x222, 0x160, 80, 80, true);
     toAdd.Children.Add(new GImage(0x58b, 0x42, -22));
     toAdd.Children.Add(new GImage(0x589, 0x8e, -38));
     toAdd.Children.Add(new GImage(0x1580, 0x97, -30));
     toAdd.Children.Add(new GButton(0x119c, 120, 0x114, null));
     GListBox box = new GListBox(GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0xbbc, 40, 0x39, 0xcc, 0xd6, true);
     Client.Skills skills = Skills;
     for (int i = 0; i < 0x100; i++)
     {
         Skill skill = skills[i];
         if (skill == null)
         {
             break;
         }
         box.AddItem(skill.Name);
     }
     box.OnClick = new OnClick(Engine.CharSkill_OnClick);
     toAdd.Children.Add(box);
     int num2 = 0x31 - box.ItemCount;
     if (num2 < 0)
     {
         num2 = 0;
     }
     GButton button = new GButton(250, 250, 0xfb, box.X + box.Width, box.Y, new OnClick(Engine.ScrollUp_OnClick));
     toAdd.Children.Add(button);
     button2 = new GButton(0xfc, 0xfc, 0xfd, box.X + box.Width, box.Y + box.Height, new OnClick(Engine.ScrollDown_OnClick)) {
         Y = button2.Y - button2.Height
     };
     toAdd.Children.Add(button2);
     toAdd.Children.Add(new GBackground(0x100, button.Width, button2.Y - (button.Y + button.Height), button.X, button.Y + button.Height, false));
     slider = new GVSlider(0xfe, (box.X + box.Width) + 1, button.Y + button.Height, 13, button2.Y - (button.Y + button.Height), 0.0, 0.0, (double) num2, 1.0) {
         Y = slider.Y + slider.HalfHeight,
         Height = slider.Height - (slider.HalfHeight * 2),
         OnValueChange = new OnValueChange(Engine.ListView_OnValueChange)
     };
     slider.SetTag("ListBox", box);
     slider.SetValue(0.0, false);
     toAdd.Children.Add(slider);
     button.SetTag("Scroller", slider);
     button2.SetTag("Scroller", slider);
     toAdd.Children.Add(new GBackground(0xbbc, 0x69, 0x19, 270, 0xba, true));
     toAdd.Children.Add(new GBackground(0xbbc, 0x69, 0x19, 270, 0xd8, true));
     toAdd.Children.Add(new GBackground(0xbbc, 0x69, 0x19, 270, 0xf6, true));
     toAdd.Children.Add(new GLabel("Strength", GetFont(1), Hues.Load(1), 280, 0x38));
     toAdd.Children.Add(new GLabel("Dexterity", GetFont(1), Hues.Load(1), 280, 0x56));
     toAdd.Children.Add(new GLabel("Intelligence", GetFont(1), Hues.Load(1), 280, 0x74));
     int[] numArray = new int[] { 0x39, 0x57, 0x75, 0xc1, 0xdf, 0xfd };
     int[] numArray2 = new int[] { Str, Dex, Int, vSkill1, vSkill2, vSkill3 };
     double[] numArray3 = new double[] { 10.0, 10.0, 10.0, 0.0, 0.0, 0.0 };
     double[] numArray4 = new double[] { 60.0, 60.0, 60.0, 50.0, 50.0, 50.0 };
     double[] numArray5 = new double[] { 80.0, 80.0, 80.0, 100.0, 100.0, 100.0 };
     GSlider[] sliderArray = new GSlider[6];
     GLabel[] labelArray = new GLabel[6];
     for (int j = 0; j < 6; j++)
     {
         toAdd.Children.Add(new GImage(0xd5, 420, numArray[j]));
         toAdd.Children.Add(new GBackground(0xd6, 0x4b, 14, 0x1b1, numArray[j], false));
         toAdd.Children.Add(new GImage(0xd7, 0x1fc, numArray[j]));
         GLabel label = new GLabel(numArray2[j].ToString(), GetFont(1), Hues.Load(1), 380, numArray[j] - 1);
         GSlider slider2 = new GSlider(0xd8, 0x1a8, numArray[j], 0x5d, 14, (double) numArray2[j], numArray3[j], numArray4[j], 1.0) {
             OnValueChange = new OnValueChange(Engine.UpdateStaticSlider_OnValueChange)
         };
         slider2.SetTag("Static", label);
         slider2.SetTag("Font", GetFont(1));
         slider2.SetTag("Hue", Hues.Load(1));
         slider2.SetTag("Max", numArray5[j]);
         sliderArray[j] = slider2;
         labelArray[j] = label;
         toAdd.Children.Add(label);
         toAdd.Children.Add(slider2);
     }
     for (int k = 0; k < 3; k++)
     {
         string name = string.Format("Slider{0}", k + 1);
         sliderArray[0].SetTag(name, sliderArray[k]);
         sliderArray[1].SetTag(name, sliderArray[k]);
         sliderArray[2].SetTag(name, sliderArray[k]);
         sliderArray[3].SetTag(name, sliderArray[k + 3]);
         sliderArray[4].SetTag(name, sliderArray[k + 3]);
         sliderArray[5].SetTag(name, sliderArray[k + 3]);
     }
     OnClick onClick = new OnClick(Engine.CharSkillBox_OnClick);
     button3 = new GTextButton((iSkill1 == -1) ? "Click Here" : Skills[iSkill1].Name, GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0x113, 0xbf, onClick) {
         X = 0x112,
         Y = 0xd1 - button3.Height
     };
     button3.SetTag("List", box);
     button3.SetTag("Skill", iSkill1);
     toAdd.Children.Add(button3);
     button4 = new GTextButton((iSkill2 == -1) ? "Click Here" : Skills[iSkill2].Name, GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0x113, 0xbf, onClick) {
         X = 0x112,
         Y = 0xef - button4.Height
     };
     button4.SetTag("List", box);
     button4.SetTag("Skill", iSkill2);
     toAdd.Children.Add(button4);
     button5 = new GTextButton((iSkill3 == -1) ? "Click Here" : Skills[iSkill3].Name, GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0x113, 0xbf, onClick) {
         X = 0x112,
         Y = 0x10d - button5.Height
     };
     button5.SetTag("List", box);
     button5.SetTag("Skill", iSkill3);
     toAdd.Children.Add(button5);
     toAdd.Children.Add(new GHotspot(270, 0xba, 0x69, 0x19, button3));
     toAdd.Children.Add(new GHotspot(270, 0xd8, 0x69, 0x19, button4));
     toAdd.Children.Add(new GHotspot(270, 0xf6, 0x69, 0x19, button5));
     Gumps.Desktop.Children.Clear();
     Gumps.Desktop.Children.Add(new GBackground(0x588, ScreenWidth, ScreenHeight, false));
     Gumps.Desktop.Children.Add(new GImage(0x157c, 0, 0));
     Gumps.Desktop.Children.Add(new GImage(0x15a0, 0, 4));
     GButton button6 = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) {
         Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit"))
     };
     Gumps.Desktop.Children.Add(button6);
     GButton button7 = new GButton(0x15a4, 610, 0x1bd, new OnClick(Engine.CharCreationSkillsArrow_OnClick));
     button7.SetTag("Strength", labelArray[0]);
     button7.SetTag("Dexterity", labelArray[1]);
     button7.SetTag("Intelligence", labelArray[2]);
     button7.SetTag("vSkill1", labelArray[3]);
     button7.SetTag("vSkill2", labelArray[4]);
     button7.SetTag("vSkill3", labelArray[5]);
     button7.SetTag("iSkill1", button3);
     button7.SetTag("iSkill2", button4);
     button7.SetTag("iSkill3", button5);
     Gumps.Desktop.Children.Add(button7);
     Gumps.Desktop.Children.Add(toAdd);
 }