Example #1
0
 public GListItem(string Text, int Index, GListBox Owner)
     : base(Text, Owner.Font, Owner.HRegular, Owner.HOver, Owner.OffsetX, Owner.OffsetY, null)
 {
     this.m_Index = Index;
     this.m_Owner = Owner;
     this.Layout();
 }
Example #2
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);
 }
Example #3
0
 public GListItem(string Text, int Index, GListBox Owner) : base(Text, Owner.Font, Owner.HRegular, Owner.HOver, Owner.OffsetX, Owner.OffsetY, null)
 {
     this.m_Index = Index;
     this.m_Owner = Owner;
     this.Layout();
 }