Exemplo n.º 1
0
 private void Entry_OnClick(Gump g)
 {
     if ((g.HasTag("HueID") && g.HasTag("Buttons")) && g.HasTag("Index"))
     {
         int          tag     = (int)g.GetTag("HueID");
         MouseButtons buttons = (MouseButtons)g.GetTag("Buttons");
         int          index   = (int)g.GetTag("Index");
         if ((buttons & MouseButtons.Right) != MouseButtons.None)
         {
             QuickHues.Remove(index);
             Gumps.Destroy(this);
             GQuickHues toAdd = new GQuickHues(this.m_Picker, this.m_Brightness, this.m_Okay);
             if (this.m_Expanded)
             {
                 toAdd.m_Expanded = true;
                 toAdd.Height     = toAdd.m_ExpandedHeight;
             }
             base.m_Parent.Children.Add(toAdd);
         }
         else if ((tag >= 2) && (tag < 0x3ea))
         {
             tag -= 2;
             int num3 = tag % 5;
             tag /= 5;
             int num4 = tag % 20;
             tag /= 20;
             int num5 = tag;
             this.m_Picker.Brightness = num3;
             this.m_Picker.ShadeX     = num4;
             this.m_Picker.ShadeY     = num5;
             this.m_Brightness.Refresh();
             this.m_Okay.Click();
         }
     }
 }
Exemplo n.º 2
0
        private void OnScroll(double vNew, double vOld, Gump g)
        {
            int  y    = (int)vNew;
            Gump tag  = (Gump)g.GetTag("toScroll");
            int  num2 = (int)g.GetTag("yBase");
            int  h    = (int)g.GetTag("viewHeight");

            tag.Y = num2 - y;
            ((GHtmlLabel)tag).Scissor(0, y, tag.Width, h);
        }
Exemplo n.º 3
0
        private void Entry_OnClick(Gump Sender)
        {
            int tag = (int)Sender.GetTag("EntryID");

            Network.Send(new PPopupResponse(this.m_Owner, tag));
            Gumps.Destroy(this);
        }
Exemplo n.º 4
0
        private void Slider_OnValueChange(double vNew, double vOld, Gump sender)
        {
            int    num = (int)vNew;
            double tag = (int)sender.GetTag("Max");

            tag = ((double)num) / tag;
            num = (int)-((((int)sender.GetTag("Max")) - base.m_Height) * tag);
            foreach (Gump gump in base.m_Children.ToArray())
            {
                Type type = gump.GetType();
                if (type == tGLabel)
                {
                    gump.Y = num + ((int)gump.GetTag("yBase"));
                }
                else if (type == tGSkillGump)
                {
                    gump.Y = num + ((GSkillGump)gump).yBase;
                }
            }
        }
Exemplo n.º 5
0
        private void Name_OnClick(Gump sender)
        {
            AbilityInfo tag = (AbilityInfo)sender.GetTag("Ability");

            if (AbilityInfo.Active == tag)
            {
                AbilityInfo.Active = null;
            }
            else
            {
                AbilityInfo.Active = tag;
            }
        }
Exemplo n.º 6
0
        private static void ChangeCircle_OnClick(Gump sender)
        {
            Gump   parent = sender.Parent;
            Item   tag    = (Item)parent.GetTag("Container");
            object obj2   = sender.GetTag("Circle");

            if (tag != null)
            {
                int circle = (obj2 == null) ? 0 : ((int)obj2);
                int x      = parent.X;
                int y      = parent.Y;
                Gumps.Destroy(parent);
                Gump toAdd = OpenSpellbook(circle, tag.LastSpell, tag);
                toAdd.X = x;
                toAdd.Y = y;
                Gumps.Desktop.Children.Add(toAdd);
            }
        }
Exemplo n.º 7
0
 private void Entry_OnHighlight(Gump g)
 {
     if (g.HasTag("HueID"))
     {
         int tag = (int)g.GetTag("HueID");
         if ((tag >= 2) && (tag < 0x3ea))
         {
             tag -= 2;
             int num2 = tag % 5;
             tag /= 5;
             int num3 = tag % 20;
             tag /= 20;
             int num4 = tag;
             this.m_Picker.Brightness = num2;
             this.m_Picker.ShadeX     = num3;
             this.m_Picker.ShadeY     = num4;
             this.m_Brightness.Refresh();
         }
     }
 }
Exemplo n.º 8
0
 public static void AppearanceHueProperty_OnClick(Gump Sender)
 {
     string tag = (string) Sender.GetTag("Property");
     Gump gump = (Gump) Sender.GetTag("Preview");
     Gump gump2 = (Gump) Sender.GetTag("Image");
     GBackground background = new GBackground(0xe14, 0x97, 310, 0x1db, 0x7d, true);
     Gump toAdd = null;
     string str = tag;
     if (str != null)
     {
         str = string.IsInterned(str);
         if (str == "Skin Tone")
         {
             toAdd = new GSkinHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight);
             ((GSkinHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease);
             ((GSkinHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect);
             toAdd.SetTag("Back", background);
             toAdd.SetTag("Preview", gump);
             toAdd.SetTag("Image", gump2);
             toAdd.SetTag("Sender", Sender);
         }
         else if (str == "Shirt Color")
         {
             toAdd = new GHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight);
             ((GHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease);
             ((GHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect);
             toAdd.SetTag("Back", background);
             toAdd.SetTag("Preview", gump);
             toAdd.SetTag("Image", gump2);
             toAdd.SetTag("Sender", Sender);
         }
         else if (str == "Pants Color")
         {
             toAdd = new GHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight);
             ((GHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease);
             ((GHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect);
             toAdd.SetTag("Back", background);
             toAdd.SetTag("Preview", gump);
             toAdd.SetTag("Image", gump2);
             toAdd.SetTag("Sender", Sender);
         }
         else if (str == "Hair Color")
         {
             toAdd = new GHairHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight);
             ((GHairHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease);
             ((GHairHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect);
             toAdd.SetTag("Back", background);
             toAdd.SetTag("Preview", gump);
             toAdd.SetTag("Image", gump2);
             toAdd.SetTag("Sender", Sender);
         }
         else
         {
             if (str != "Facial Hair Color")
             {
                 return;
             }
             toAdd = new GHairHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight);
             ((GHairHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease);
             ((GHairHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect);
             toAdd.SetTag("Back", background);
             toAdd.SetTag("Preview", gump);
             toAdd.SetTag("Image", gump2);
             toAdd.SetTag("Sender", Sender);
         }
         toAdd.X += (background.UseWidth - toAdd.Width) / 2;
         toAdd.Y += (background.UseHeight - toAdd.Height) / 2;
         background.Children.Add(toAdd);
         Gumps.Desktop.Children.Add(background);
     }
 }
Exemplo n.º 9
0
 public static void CharSkillBox_OnClick(Gump Sender)
 {
     if (((Gump) Sender.GetTag("List")).HasTag("Box"))
     {
         ((GTextButton) ((Gump) Sender.GetTag("List")).GetTag("Box")).DefaultHue = Hues.Load(0x76b);
         ((GTextButton) ((Gump) Sender.GetTag("List")).GetTag("Box")).FocusHue = Hues.Load(0x961);
     }
     ((Gump) Sender.GetTag("List")).SetTag("Box", Sender);
     ((GTextButton) Sender).DefaultHue = ((GTextButton) Sender).FocusHue = Hues.Load(0x676);
 }
Exemplo n.º 10
0
 public static void URLButton_OnClick(Gump Sender)
 {
     if (Sender.HasTag("URL"))
     {
         OpenBrowser((string) Sender.GetTag("URL"));
     }
 }
Exemplo n.º 11
0
 public static void AppearanceHuePicker_OnHueRelease(int Hue, Gump Sender)
 {
     GImage tag = (GImage) Sender.GetTag("Image");
     GHuePreview preview = (GHuePreview) Sender.GetTag("Preview");
     if ((((int) tag.GetTag("ItemID")) == 0) || !Map.m_ItemFlags[((int) tag.GetTag("ItemID")) & 0x3fff][TileFlag.PartialHue])
     {
         Hue ^= 0x8000;
     }
     preview.Hue = Hue;
     tag.Hue = Hues.Load(Hue);
     Gumps.Destroy((Gump) Sender.GetTag("Back"));
 }
Exemplo n.º 12
0
 public static void Status_OnClick(Gump Sender)
 {
     int tag = (int) Sender.GetTag("Serial");
     Mobile mobile = World.FindMobile(tag);
     if (mobile != null)
     {
         mobile.QueryStats();
         mobile.OpenStatus(false);
     }
 }
Exemplo n.º 13
0
 public static void StringQueryOkay_OnClick(Gump Sender)
 {
     if ((Sender.HasTag("Dialog") && Sender.HasTag("Serial")) && (Sender.HasTag("Type") && Sender.HasTag("Text")))
     {
         Gumps.Destroy((Gump) Sender.GetTag("Dialog"));
         Network.Send(new PStringQueryResponse((int) Sender.GetTag("Serial"), (short) Sender.GetTag("Type"), ((GTextBox) Sender.GetTag("Text")).String));
     }
 }
Exemplo n.º 14
0
 public static void Profession_OnClick(Gump Sender)
 {
     ShowCharCreationSkills((int) Sender.GetTag("Strength"), (int) Sender.GetTag("Dexterity"), (int) Sender.GetTag("Intelligence"), (int) Sender.GetTag("vSkill1"), (int) Sender.GetTag("vSkill2"), (int) Sender.GetTag("vSkill3"), (int) Sender.GetTag("iSkill1"), (int) Sender.GetTag("iSkill2"), (int) Sender.GetTag("iSkill3"));
 }
Exemplo n.º 15
0
 public static void ScrollUp_OnClick(Gump Sender)
 {
     if (Sender.HasTag("Scroller"))
     {
         GVSlider tag = (GVSlider) Sender.GetTag("Scroller");
         if (tag != null)
         {
             tag.SetValue(tag.GetValue() - tag.Increase, true);
         }
     }
 }
Exemplo n.º 16
0
 public static void CharGender_OnClick(Gump Sender)
 {
     GImage tag = (GImage) Sender.GetTag("Image");
     int num = (((int) Sender.GetTag("Gender")) == 0) ? 1 : 0;
     GButton button = (GButton) Sender;
     button.SetGumpID(0x710 - (num * 3));
     button.SetTag("Gender", num);
     ((Gump) Sender.GetTag("Arrow")).SetTag("Gender", num);
     int[,] numArray = new int[,] { { 0x761, 0x760 }, { 0x739, 0x714 }, { 0x738, 0x764 }, { 0x753, 0x737 }, { 0x759, 0 }, { 0x762, 0x763 } };
     for (int i = 0; i < 6; i++)
     {
         ((GImage) Sender.GetTag(string.Format("Image[{0}]", i))).GumpID = numArray[i, num];
     }
     bool flag = num == 0;
     ((Gump) Sender.GetTag("HideHS")).Visible = flag;
     ((Gump) Sender.GetTag("HideTB")).Visible = flag;
     ((Gump) Sender.GetTag("HideHP")).Visible = flag;
 }
Exemplo n.º 17
0
 public static void HuePicker_OnHueSelect(int Hue, Gump Sender)
 {
     if ((Sender.HasTag("Dialog") && Sender.HasTag("Item Art")) && Sender.HasTag("ItemID"))
     {
         GItemArt art;
         Gump tag = (Gump) Sender.GetTag("Dialog");
         Gump g = (Gump) Sender.GetTag("Item Art");
         Gumps.Destroy(g);
         art = new GItemArt(0xb7, 3, (int) Sender.GetTag("ItemID"), Hues.GetItemHue((int) Sender.GetTag("ItemID"), Hue)) {
             X = art.X + (((0x3a - (art.Image.xMax - art.Image.xMin)) / 2) - art.Image.xMin),
             Y = art.Y + (((0x52 - (art.Image.yMax - art.Image.yMin)) / 2) - art.Image.yMin)
         };
         tag.Children.Add(art);
         Sender.SetTag("Item Art", art);
     }
 }
Exemplo n.º 18
0
 public static void CharCreationSkillsArrow_OnClick(Gump Sender)
 {
     int str = Convert.ToInt32(((GLabel) Sender.GetTag("Strength")).Text);
     int dex = Convert.ToInt32(((GLabel) Sender.GetTag("Dexterity")).Text);
     int @int = Convert.ToInt32(((GLabel) Sender.GetTag("Intelligence")).Text);
     int num4 = Convert.ToInt32(((GLabel) Sender.GetTag("vSkill1")).Text);
     int num5 = Convert.ToInt32(((GLabel) Sender.GetTag("vSkill2")).Text);
     int num6 = Convert.ToInt32(((GLabel) Sender.GetTag("vSkill3")).Text);
     int tag = (int) ((Gump) Sender.GetTag("iSkill1")).GetTag("Skill");
     int num8 = (int) ((Gump) Sender.GetTag("iSkill2")).GetTag("Skill");
     int num9 = (int) ((Gump) Sender.GetTag("iSkill3")).GetTag("Skill");
     if (((num4 + num5) + num6) != 100)
     {
         Gumps.MessageBoxOk("The total of all your skills must equal 100.0", true, null);
     }
     else if (((str + dex) + @int) != 80)
     {
         Gumps.MessageBoxOk("The total of all your stats must equal 100.0", true, null);
     }
     else if (tag == -1)
     {
         GTextButton sender = (GTextButton) Sender.GetTag("iSkill1");
         CharSkillBox_OnClick(sender);
         Cursor.MoveTo(sender);
     }
     else if (num8 == -1)
     {
         GTextButton button2 = (GTextButton) Sender.GetTag("iSkill2");
         CharSkillBox_OnClick(button2);
         Cursor.MoveTo(button2);
     }
     else if (num9 == -1)
     {
         GTextButton button3 = (GTextButton) Sender.GetTag("iSkill3");
         CharSkillBox_OnClick(button3);
         Cursor.MoveTo(button3);
     }
     else if (tag == num8)
     {
         GTextButton button4 = (GTextButton) Sender.GetTag("iSkill2");
         CharSkillBox_OnClick(button4);
         Cursor.MoveTo(button4);
     }
     else if ((tag == num9) || (num8 == num9))
     {
         GTextButton button5 = (GTextButton) Sender.GetTag("iSkill3");
         CharSkillBox_OnClick(button5);
         Cursor.MoveTo(button5);
     }
     else
     {
         ShowCharAppearance(str, dex, @int, num4, num5, num6, tag, num8, num9);
     }
 }
Exemplo n.º 19
0
 public static void CharCreationAppearanceArrow_OnClick(Gump Sender)
 {
     int tag = (int) Sender.GetTag("Strength");
     int dex = (int) Sender.GetTag("Dexterity");
     int @int = (int) Sender.GetTag("Intelligence");
     int num4 = (int) Sender.GetTag("vSkill1");
     int num5 = (int) Sender.GetTag("vSkill2");
     int num6 = (int) Sender.GetTag("vSkill3");
     int num7 = (int) Sender.GetTag("iSkill1");
     int num8 = (int) Sender.GetTag("iSkill2");
     int num9 = (int) Sender.GetTag("iSkill3");
     int hSkinTone = ((GHuePreview) Sender.GetTag("Skin Tone")).Hue | 0x8000;
     int hShirtColor = ((GHuePreview) Sender.GetTag("Shirt Color")).Hue & 0x7fff;
     int hPantsColor = ((GHuePreview) Sender.GetTag("Pants Color")).Hue & 0x7fff;
     int hHairColor = ((GHuePreview) Sender.GetTag("Hair Color")).Hue & 0x7fff;
     int hFacialHairColor = ((GHuePreview) Sender.GetTag("Facial Hair Color")).Hue & 0x7fff;
     string name = ((GTextBox) Sender.GetTag("Name")).String;
     int gender = (int) Sender.GetTag("Gender");
     if ((((num4 + num5) + num6) == 100) && ((((((tag + dex) + @int) == 80) && (num7 != -1)) && ((num8 != -1) && (num9 != -1))) && (((num7 != num8) && (num7 != num9)) && (num8 != num9))))
     {
         if ((name == null) || (name.Length <= 1))
         {
             ((GTextBox) Sender.GetTag("Name")).Focus();
             Cursor.MoveTo((GTextBox) Sender.GetTag("Name"));
         }
         else
         {
             ShowCharCitySelection(tag, dex, @int, num4, num5, num6, num7, num8, num9, hSkinTone, hShirtColor, hPantsColor, hHairColor, hFacialHairColor, name, gender);
         }
     }
 }
Exemplo n.º 20
0
 private void Entry_OnClick(Gump Sender)
 {
     int tag = (int) Sender.GetTag("EntryID");
     Network.Send(new PPopupResponse(this.m_Owner, tag));
     Gumps.Destroy(this);
 }
Exemplo n.º 21
0
 private void SetIndex_OnClick(Gump g)
 {
     this.Index = (int)g.GetTag("Index");
     Gumps.Destroy(this.m_Dropdown);
 }
Exemplo n.º 22
0
 private void Entry_OnClick(Gump g)
 {
     if ((g.HasTag("HueID") && g.HasTag("Buttons")) && g.HasTag("Index"))
     {
         int tag = (int) g.GetTag("HueID");
         MouseButtons buttons = (MouseButtons) g.GetTag("Buttons");
         int index = (int) g.GetTag("Index");
         if ((buttons & MouseButtons.Right) != MouseButtons.None)
         {
             QuickHues.Remove(index);
             Gumps.Destroy(this);
             GQuickHues toAdd = new GQuickHues(this.m_Picker, this.m_Brightness, this.m_Okay);
             if (this.m_Expanded)
             {
                 toAdd.m_Expanded = true;
                 toAdd.Height = toAdd.m_ExpandedHeight;
             }
             base.m_Parent.Children.Add(toAdd);
         }
         else if ((tag >= 2) && (tag < 0x3ea))
         {
             tag -= 2;
             int num3 = tag % 5;
             tag /= 5;
             int num4 = tag % 20;
             tag /= 20;
             int num5 = tag;
             this.m_Picker.Brightness = num3;
             this.m_Picker.ShadeX = num4;
             this.m_Picker.ShadeY = num5;
             this.m_Brightness.Refresh();
             this.m_Okay.Click();
         }
     }
 }
Exemplo n.º 23
0
 public static void ListView_OnValueChange(double Value, double Old, Gump Sender)
 {
     if (Sender.HasTag("ListBox"))
     {
         GListBox tag = (GListBox) Sender.GetTag("ListBox");
         if (tag != null)
         {
             tag.StartIndex = (int) Value;
         }
     }
 }
Exemplo n.º 24
0
 public static void CharSkill_OnClick(Gump Sender)
 {
     if (Sender.HasTag("Box"))
     {
         GTextButton tag = (GTextButton) Sender.GetTag("Box");
         Skill skill = Skills[((GListItem) Sender.GetTag("Clicked")).Index];
         tag.SetTag("Skill", ((GListItem) Sender.GetTag("Clicked")).Index);
         tag.Text = skill.Name;
         ((GTextButton) Sender.GetTag("Box")).DefaultHue = Hues.Load(0x76b);
         ((GTextButton) Sender.GetTag("Box")).FocusHue = Hues.Load(0x961);
         Sender.RemoveTag("Box");
     }
 }
Exemplo n.º 25
0
 public static void QuickLogin_OnClick(Gump g)
 {
     int tag = (int) g.GetTag("Index");
     Entry entry = (Entry) QuickLogin.Entries[tag];
     m_QuickLogin = true;
     m_QuickEntry = entry;
     Cursor.Hourglass = true;
     Gumps.Desktop.Children.Clear();
     xGumps.Display("Connecting");
     DrawNow();
     if (Network.Connect())
     {
         Gumps.Desktop.Children.Clear();
         xGumps.Display("AccountVerify");
     }
     else
     {
         Gumps.Desktop.Children.Clear();
         xGumps.SetVariable("FailMessage", "Couldn't connect to the login server.  Either the server is down, or you've entered an invalid host / port.  Check Client.cfg.");
         xGumps.Display("ConnectionFailed");
         Cursor.Hourglass = false;
         m_QuickLogin = false;
         return;
     }
     Network.Send(new PLoginSeed());
     Network.Send(new PAccount(entry.AccountName, entry.Password));
 }
Exemplo n.º 26
0
 public static void CharSlot_OnClick(Gump Sender)
 {
     if (Sender.HasTag("CharID"))
     {
         int tag = (int) Sender.GetTag("CharID");
         Entry e = new Entry {
             AccountName = NewConfig.Username,
             Password = NewConfig.Password,
             CharID = tag,
             CharName = m_CharacterNames[tag],
             ServerID = NewConfig.LastServerID
         };
         for (int i = 0; i < m_Servers.Length; i++)
         {
             if (m_Servers[i].ServerID == e.ServerID)
             {
                 e.ServerName = m_Servers[i].Name;
             }
         }
         QuickLogin.Add(e);
         Cursor.Hourglass = true;
         Network.Send(new PCharSelect(m_CharacterNames[tag], tag));
         if (Animations.IsLoading)
         {
             Gumps.Desktop.Children.Clear();
             xGumps.Display("AnimationLoad");
             do
             {
                 DrawNow();
             }
             while (!Animations.WaitLoading());
         }
         Gumps.Desktop.Children.Clear();
         xGumps.Display("EnterBritannia");
         DrawNow();
     }
 }
Exemplo n.º 27
0
 public static void Server_OnClick(Gump Sender)
 {
     Cursor.Hourglass = true;
     NewConfig.LastServerID = (int) Sender.GetTag("ServerID");
     NewConfig.Save();
     Network.Send(new PHardwareInfo());
     Network.Send(new PServerSelection((int) Sender.GetTag("ServerID")));
     for (int i = 0; i < m_Servers.Length; i++)
     {
         if (m_Servers[i].ServerID == NewConfig.LastServerID)
         {
             m_ServerName = m_Servers[i].Name;
         }
     }
     Gumps.Desktop.Children.Clear();
     xGumps.Display("Connecting");
     Macros.Load();
     DrawNow();
 }
Exemplo n.º 28
0
 public static void City_OnClick(Gump Sender)
 {
     int tag = (int) Sender.GetTag("Strength");
     int num2 = (int) Sender.GetTag("Dexterity");
     int num3 = (int) Sender.GetTag("Intelligence");
     int num4 = (int) Sender.GetTag("vSkill1");
     int num5 = (int) Sender.GetTag("vSkill2");
     int num6 = (int) Sender.GetTag("vSkill3");
     int num7 = (int) Sender.GetTag("iSkill1");
     int num8 = (int) Sender.GetTag("iSkill2");
     int num9 = (int) Sender.GetTag("iSkill3");
     int num10 = (int) Sender.GetTag("Skin Tone");
     int num11 = (int) Sender.GetTag("Shirt Color");
     int num12 = (int) Sender.GetTag("Pants Color");
     int num13 = (int) Sender.GetTag("Hair Color");
     int num14 = (int) Sender.GetTag("Facial Hair Color");
     int num15 = (int) Sender.GetTag("CityID");
     string name = (string) Sender.GetTag("Name");
     int num16 = (int) Sender.GetTag("Gender");
     if (((((((num4 + num5) + num6) == 100) && ((num7 != num8) && (num7 != num9))) && ((num8 != num9) && (((tag + num2) + num3) == 80))) && (((name != null) && (name.Length > 1)) && ((num15 >= 0) && (num15 < 9)))) && ((num16 >= 0) && (num16 <= 1)))
     {
         GLabel label;
         Cursor.Hourglass = true;
         int num17 = 0;
         for (int i = 0; i < 5; i++)
         {
             if ((m_CharacterNames[i] == null) || (m_CharacterNames[i].Length <= 0))
             {
                 num17 = i;
                 break;
             }
         }
         Network.Send(new PCreateCharacter(name, (byte) num16, (byte) tag, (byte) num2, (byte) num3, (byte) num7, (byte) num4, (byte) num8, (byte) num5, (byte) num9, (byte) num6, (short) (num10 | 0x8000), 0x203b, (short) (num13 & 0x7fff), 0x2040, (short) (num14 & 0x7fff), (short) num15, (short) num17, Network.ClientIP, (short) (num11 & 0x7fff), (short) (num12 & 0x7fff)));
         if (Animations.IsLoading)
         {
             Gumps.Desktop.Children.Clear();
             xGumps.Display("AnimationLoad");
             do
             {
                 DrawNow();
             }
             while (!Animations.WaitLoading());
         }
         Gumps.Desktop.Children.Clear();
         GBackground toAdd = new GBackground(0xa2c, 0x164, 0xd4, 0x8e, 0x86, true);
         label = new GLabel("Entering Britannia..", GetFont(2), Hues.Load(0x75f), 0x74, 0x2a) {
             X = (toAdd.Width - label.Width) / 2
         };
         toAdd.Children.Add(label);
         toAdd.Children.Add(new GButton(0x47e, 0xa4, 170, null));
         Gumps.Desktop.Children.Add(new GBackground(0x588, ScreenWidth, ScreenHeight, false));
         Gumps.Desktop.Children.Add(toAdd);
         Gumps.Desktop.Children.Add(new GImage(0x157c, 0, 0));
         Gumps.Desktop.Children.Add(new GImage(0x15a0, 0, 4));
         GButton button = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) {
             Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit"))
         };
         Gumps.Desktop.Children.Add(button);
         DrawNow();
     }
 }
Exemplo n.º 29
0
 public static void StringQueryCancel_OnClick(Gump Sender)
 {
     if ((Sender.HasTag("Dialog") && Sender.HasTag("Serial")) && Sender.HasTag("Type"))
     {
         Gumps.Destroy((Gump) Sender.GetTag("Dialog"));
         Network.Send(new PStringQueryCancel((int) Sender.GetTag("Serial"), (short) Sender.GetTag("Type")));
     }
 }
Exemplo n.º 30
0
 public static void DestroyDialogShowAcctLogin_OnClick(Gump Sender)
 {
     World.Clear();
     Gump g = null;
     if (Sender.HasTag("Dialog"))
     {
         g = (Gump) Sender.GetTag("Dialog");
     }
     else
     {
         g = Sender.Parent;
     }
     if (g != null)
     {
         Gumps.Destroy(g);
         Network.Disconnect();
         ShowAcctLogin();
     }
 }
Exemplo n.º 31
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();
             }
         }
     }
 }
Exemplo n.º 32
0
 public static void DestroyGump_OnClick(Gump Sender)
 {
     if (Sender.HasTag("Gump"))
     {
         Gump tag = (Gump) Sender.GetTag("Gump");
         if (tag != null)
         {
             Gumps.Destroy(tag);
         }
     }
 }
Exemplo n.º 33
0
 private static void YellHue_OnHueSelect(Gump g)
 {
     World.CharData.YellHue = ((GHuePicker) g.GetTag("Hue Picker")).Hue;
     Renderer.SetText(m_Text);
     ((GTextButton) g.GetTag("Button")).DefaultHue = Hues.Load(((GHuePicker) g.GetTag("Hue Picker")).Hue);
     Gumps.Destroy(g.Parent);
     m_DyeWindowOpen = false;
 }
Exemplo n.º 34
0
 public static void HuePickerPicker_OnClick(Gump Sender)
 {
     if (Sender.HasTag("Hue Picker") && Sender.HasTag("Brightness Bar"))
     {
         GHuePicker tag = (GHuePicker) Sender.GetTag("Hue Picker");
         GBrightnessBar bar = (GBrightnessBar) Sender.GetTag("Brightness Bar");
         if ((tag != null) && (bar != null))
         {
             TargetHandler = new HuePickerTargetHandler(tag, bar);
         }
     }
 }
Exemplo n.º 35
0
 public static void AppearanceHuePicker_OnHueSelect(int Hue, Gump Sender)
 {
     GImage tag = (GImage) Sender.GetTag("Image");
     if ((((int) tag.GetTag("ItemID")) == 0) || !Map.m_ItemFlags[((int) tag.GetTag("ItemID")) & 0x3fff][TileFlag.PartialHue])
     {
         Hue ^= 0x8000;
     }
     tag.Hue = Hues.Load(Hue);
 }
Exemplo n.º 36
0
 public static void HuePickerSlider_OnValueChange(double Value, double Old, Gump Sender)
 {
     if (Sender.HasTag("Hue Picker"))
     {
         GHuePicker tag = (GHuePicker) Sender.GetTag("Hue Picker");
         if (tag != null)
         {
             tag.Brightness = (int) Value;
         }
     }
 }
Exemplo n.º 37
0
 public static void HuePickerOk_OnClick(Gump Sender)
 {
     if ((Sender.HasTag("Dialog") && Sender.HasTag("Hue Picker")) && (Sender.HasTag("Serial") && Sender.HasTag("Relay")))
     {
         Gump tag = (Gump) Sender.GetTag("Dialog");
         if (tag != null)
         {
             GHuePicker picker = (GHuePicker) Sender.GetTag("Hue Picker");
             if (picker == null)
             {
                 Gumps.Destroy(tag);
             }
             else
             {
                 int serial = (int) Sender.GetTag("Serial");
                 short relay = (short) Sender.GetTag("Relay");
                 Network.Send(new PSelectHueResponse(serial, relay, (short) picker.Hue));
                 Gumps.Destroy(tag);
             }
         }
     }
 }
Exemplo n.º 38
0
 private void Entry_OnHighlight(Gump g)
 {
     if (g.HasTag("HueID"))
     {
         int tag = (int) g.GetTag("HueID");
         if ((tag >= 2) && (tag < 0x3ea))
         {
             tag -= 2;
             int num2 = tag % 5;
             tag /= 5;
             int num3 = tag % 20;
             tag /= 20;
             int num4 = tag;
             this.m_Picker.Brightness = num2;
             this.m_Picker.ShadeX = num3;
             this.m_Picker.ShadeY = num4;
             this.m_Brightness.Refresh();
         }
     }
 }