예제 #1
0
        public SplitItemStackGump(Item item, Point pickupOffset)
            : base(0, 0)
        {
            Item = item;
            m_PickupOffset = pickupOffset;

            IsMoveable = true;

            // Background
            AddControl(new GumpPic(this, 0, 0, 0x085c, 0));
            // Slider
            m_Slider = (HSliderBar)AddControl(new HSliderBar(this, 30, 16, 104, 0, item.Amount, item.Amount, HSliderBarStyle.BlueWidgetNoBar));
            m_LastValue = m_Slider.Value;
            // Ok button
            AddControl(new Button(this, 102, 38, 0x085d, 0x085e, ButtonTypes.Default, 0, 0));
            ((Button)LastControl).GumpOverID = 0x085f;
            ((Button)LastControl).MouseClickEvent += ClickOkayButton;
            // Text entry field
            m_AmountEntry = (TextEntry)AddControl(new TextEntry(this, 30, 39, 60, 16, 0, 0, 5, item.Amount.ToString()));
            m_AmountEntry.HtmlTag = "<big>";
            m_AmountEntry.LegacyCarat = true;
            m_AmountEntry.Hue = 1001;
            m_AmountEntry.ReplaceDefaultTextOnFirstKeypress = true;
            m_AmountEntry.NumericOnly = true;
        }
        public CreateCharAppearanceGump()
            : base(0, 0)
        {
            // backdrop
            AddControl(new GumpPicTiled(this, 0, 0, 800, 600, 9274));
            AddControl(new GumpPic(this, 0, 0, 5500, 0));
            // character name
            AddControl(new GumpPic(this, 280, 53, 1801, 0));
            m_Name = new TextEntry(this, 238, 70, 234, 20, 0, 0, 29, string.Empty);
            AddControl(new ResizePic(this, m_Name));
            AddControl(m_Name);
            // character window
            AddControl(new GumpPic(this, 238, 98, 1800, 0));
            // paperdoll
            m_paperdoll = new PaperdollLargeUninteractable(this, 237, 97);
            m_paperdoll.IsCharacterCreation = true;
            AddControl(m_paperdoll);

            // left option window
            AddControl(new ResizePic(this, 82, 125, 3600, 151, 310));
            // this is the place where you would put the race selector.
            // if you do add it, move everything else in this left window down by 45 pixels
            // gender
            AddControl(new TextLabelAscii(this, 100, 141, 2036, 9, IO.StringData.Entry(3000120)), 1);
            AddControl(m_Gender = new DropDownList(this, 97, 154, 122, 0, 2, new string[] { IO.StringData.Entry(3000118), IO.StringData.Entry(3000119) }, false));
            // hair (male)
            AddControl(new TextLabelAscii(this, 100, 186, 2036, 9, IO.StringData.Entry(3000121)), 1);
            AddControl(m_HairMale = new DropDownList(this, 97, 199, 122, 0, 6, IO.HairStyles.MaleHairNames, false), 1);
            // facial hair (male)
            AddControl(new TextLabelAscii(this, 100, 231, 2036, 9, IO.StringData.Entry(3000122)), 1);
            AddControl(m_FacialHairMale = new DropDownList(this, 97, 244, 122, 0, 6, IO.HairStyles.FacialHair, false), 1);
            // hair (female)
            AddControl(new TextLabelAscii(this, 100, 186, 2036, 9, IO.StringData.Entry(3000121)), 2);
            AddControl(m_HairFemale = new DropDownList(this, 97, 199, 122, 0, 6, IO.HairStyles.FemaleHairNames, false), 2);

            // right option window
            AddControl(new ResizePic(this, 475, 125, 3600, 151, 310));
            // skin tone
            AddControl(new TextLabelAscii(this, 489, 141, 2036, 9, IO.StringData.Entry(3000183)));
            AddControl(m_SkinHue = new ColorPicker(this, new Rectangle(490, 154, 120, 24), new Rectangle(490, 140, 120, 280), 7, 8, Hues.SkinTones));
            // hair color
            AddControl(new TextLabelAscii(this, 489, 186, 2036, 9, IO.StringData.Entry(3000184)));
            AddControl(m_HairHue = new ColorPicker(this, new Rectangle(490, 199, 120, 24), new Rectangle(490, 140, 120, 280), 8, 6, Hues.HairTones));
            // facial hair color (male)
            AddControl(new TextLabelAscii(this, 489, 231, 2036, 9, IO.StringData.Entry(3000185)), 1);
            AddControl(m_FacialHairHue = new ColorPicker(this, new Rectangle(490, 244, 120, 24), new Rectangle(490, 140, 120, 280), 8, 6, Hues.HairTones), 1);

            // back button
            AddControl(new Button(this, 586, 435, 5537, 5539, ButtonTypes.Activate, 0, (int)Buttons.BackButton), 1);
            ((Button)LastControl).GumpOverID = 5538;
            // forward button
            AddControl(new Button(this, 610, 435, 5540, 5542, ButtonTypes.Activate, 0, (int)Buttons.ForwardButton), 1);
            ((Button)LastControl).GumpOverID = 5541;
            // quit button
            AddControl(new Button(this, 554, 2, 5513, 5515, ButtonTypes.Activate, 0, (int)Buttons.QuitButton));
            ((Button)LastControl).GumpOverID = 5514;

            IsUncloseableWithRMB = true;
        }
예제 #3
0
파일: BookGump.cs 프로젝트: jorsi/UltimaXNA
 void BuildGump()
 {
     ClearControls();
     if (m_Book.ItemID >= 0xFEF && m_Book.ItemID <= 0xFF2)
     {
         m_BookBackground = new GumpPic(this, 0, 0, 0x1FE, 0);
         m_PageCornerLeft = new GumpPic(this, 0, 0, 0x1FF, 0);
         m_PageCornerRight = new GumpPic(this, 356, 0, 0x200, 0);
     }
     AddControl(m_BookBackground);   // book background gump
     AddControl(m_PageCornerLeft);   // page turn left
     m_PageCornerLeft.GumpLocalID = 0;
     m_PageCornerLeft.MouseClickEvent += PageCorner_MouseClickEvent;
     m_PageCornerLeft.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent;
     AddControl(m_PageCornerRight);  // page turn right
     m_PageCornerRight.GumpLocalID = 1;
     m_PageCornerRight.MouseClickEvent += PageCorner_MouseClickEvent;
     m_PageCornerRight.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent;
     // Draw the title and author page
     m_TitleTextEntry = new TextEntry(this, 45, 50, 155, 300, 1, 0, 0, m_Book.Title);
     m_TitleTextEntry.MakeThisADragger();
     m_TitleTextEntry.IsEditable = m_Book.IsEditable;
     m_AuthorTextEntry = new TextEntry(this, 45, 110, 160, 300, 1, 0, 0, m_Book.Author);
     m_AuthorTextEntry.MakeThisADragger();
     m_AuthorTextEntry.IsEditable = m_Book.IsEditable;
     AddControl(m_TitleTextEntry, 1);
     AddControl(new HtmlGumpling(this, 45, 90, 155, 300, 0, 0, "<font color=#444>By"), 1);
     AddControl(m_AuthorTextEntry, 1);
     // Add book pages to active pages
     bool isRight = true;
     string color = m_Book.IsEditable ? "800" : "000";
     for (int i = 0; i < m_Book.PageCount; i++)
     {
         int onGumpPage = (i + 3) / 2;
         int x = isRight ? 235 : 45;
         m_Pages.Add(new TextEntryPage(this, x, 32, 155, 300, i));
         m_Pages[i].SetMaxLines(8, OnPageOverflow, OnPageUnderflow);
         m_Pages[i].SetKeyboardPageControls(OnPreviousPage, OnNextPage);
         m_Pages[i].MakeThisADragger();
         m_Pages[i].IsEditable = m_Book.IsEditable;
         m_Pages[i].LeadingHtmlTag = $"<font color=#{color}>";
         m_Pages[i].Text = m_Book.Pages[i].GetAllLines();
         AddControl(m_Pages[i], onGumpPage);
         AddControl(new HtmlGumpling(this, x, 195, 135, 20, 0, 0, $"<center><font color=#444>{i + 1}"), onGumpPage);
         isRight = !isRight;
     }
     AudioService service = Service.Get<AudioService>();
     service.PlaySound(0x058);
     SetActivePage(1);
     UserInterface.KeyboardFocusControl = m_Pages[0];
     m_Pages[0].CaratAt = m_Pages[0].Text.Length;
 }
예제 #4
0
 public LoginGump(Action<string, int, string, SecureString> onLogin)
     : base(0, 0)
 {
     m_OnLogin = onLogin;
     // get the resource provider
     IResourceProvider provider = Service.Get<IResourceProvider>();
     int hue = 902; // dark grey
     // backdrop
     AddControl(new GumpPicTiled(this, 0, 0, 800, 600, 0x0588));
     AddControl(new ResizePic(this, 96, 285, 0x13BE, 492, 190));
     AddControl(new GumpPic(this, 0, 0, 0x157C, 0)); // 0x2329 - upper-left border graphic
     AddControl(new GumpPic(this, 294, 42, 0x058A, 0)); // 0x2329 - castle graphic
     // quit button
     AddControl(new Button(this, 554, 2, 5513, 5515, ButtonTypes.Activate, 0, (int)LoginGumpButtons.QuitButton));
     ((Button)LastControl).GumpOverID = 5514;
     // Log in to Ultima Online
     AddControl(new TextLabelAscii(this, 230, 305, 2, hue, provider.GetString(3000038)));
     // Account Name
     AddControl(new TextLabelAscii(this, 181, 346, 2, hue, provider.GetString(3000099)));
     // Password
     AddControl(new TextLabelAscii(this, 181, 386, 2, hue, provider.GetString(3000103)));
     // name field
     TextEntry g1 = new TextEntry(this, 332, 346, 200, 20, 0, (int)LoginGumpTextFields.AccountName, 32, Settings.Login.UserName);
     g1.LeadingHtmlTag = "<basefont color=#000000><big>";
     AddControl(new ResizePic(this, g1));
     AddControl(g1);
     // password field
     TextEntry g2 = new TextEntry(this, 332, 386, 200, 20, 0, (int)LoginGumpTextFields.Password, 32, "");
     g2.IsPasswordField = true;
     g2.LeadingHtmlTag = "<basefont color=#000000><big>";
     AddControl(new ResizePic(this, g2));
     AddControl(g2);
     // login button
     AddControl(new Button(this, 550, 439, 5540, 5542, ButtonTypes.Activate, 0, (int)LoginGumpButtons.LoginButton));
     ((Button)LastControl).GumpOverID = 5541;
     // Version information
     AddControl(new HtmlGumpling(this, 120, 440, 400, 20, 0, 0, $"<center><medium><outline><font color='#DDDDDD'>{Utility.VersionString}</center></medium></outline>"));
     // flag graphic
     AddControl(new GumpPic(this, 0, 0, 0x15A0, 0));
     // buttons on the left side
     AddControl(new ButtonResizable(this, 10, 450, 100, 23, "CREDITS", OnClickCredits));
     int y = 420;
     foreach (Tuple<string, Action> button in m_Buttons) {
         AddControl(new ButtonResizable(this, 10, y, 100, 23, button.Item1, button.Item2));
         y -= 30;
     }
     IsUncloseableWithRMB = true;
 }
예제 #5
0
        public LoginGump()
            : base(0, 0)
        {
            // get the resource provider
            IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();

            int hue = 902; // dark grey
            // backdrop
            AddControl(new GumpPicTiled(this, 0, 0, 800, 600, 0x0588));
            AddControl(new ResizePic(this, 96, 285, 0x13BE, 492, 190));
            AddControl(new GumpPic(this, 0, 0, 0x157C, 0)); // 0x2329 - upper-left border graphic
            AddControl(new GumpPic(this, 294, 42, 0x058A, 0)); // 0x2329 - castle graphic

            // quit button
            AddControl(new Button(this, 554, 2, 5513, 5515, ButtonTypes.Activate, 0, (int)LoginGumpButtons.QuitButton));
            ((Button)LastControl).GumpOverID = 5514;
            // Log in to Ultima Online
            AddControl(new TextLabelAscii(this, 230, 305, 2, hue, provider.GetString(3000038)));
            // Account Name
            AddControl(new TextLabelAscii(this, 181, 346, 2, hue, provider.GetString(3000099)));
            // Password
            AddControl(new TextLabelAscii(this, 181, 386, 2, hue, provider.GetString(3000103)));
            // name field
            TextEntry g1 = new TextEntry(this, 332, 346, 200, 20, 0, (int)LoginGumpTextFields.AccountName, 32, Settings.Server.UserName);
            g1.LeadingHtmlTag = "<basefont color=#000000><big>";
            AddControl(new ResizePic(this, g1));
            AddControl(g1);
            // password field
            TextEntry g2 = new TextEntry(this, 332, 386, 200, 20, 0, (int)LoginGumpTextFields.Password, 32, "");
            g2.IsPasswordField = true;
            g2.LeadingHtmlTag = "<basefont color=#000000><big>";
            AddControl(new ResizePic(this, g2));
            AddControl(g2);
            // login button
            AddControl(new Button(this, 550, 439, 5540, 5542, ButtonTypes.Activate, 0, (int)LoginGumpButtons.LoginButton));
            ((Button)LastControl).GumpOverID = 5541;
            // Version information
            AddControl(new HtmlGumpling(this, 120, 440, 400, 20, 0, 0, "<center><medium><outline><font color='#DDDDDD'>" + Utility.VersionString));

            // flag graphic
            AddControl(new GumpPic(this, 0, 0, 0x15A0, 0));
            // credits
            AddControl(new Button(this, 10, 450, 0x15A8, 0x15A7, ButtonTypes.Activate, 0, (int)LoginGumpButtons.CreditsButtons));

            IsUncloseableWithRMB = true;
        }
예제 #6
0
        public MobileHealthTrackerGump(Mobile mobile)
            : base(mobile.Serial, 0)
        {
            while (UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial) != null)
            {
                UserInterface.GetControl<MobileHealthTrackerGump>(mobile.Serial).Dispose();
            }

            IsMoveable = true;

            Mobile = mobile;
            m_World = Service.Get<WorldModel>();

            if (Mobile.IsClientEntity)
            {
                AddControl(m_Background = new GumpPic(this, 0, 0, 0x0803, 0));
                m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent;
                m_BarBGs = new GumpPic[3];
                AddControl(m_BarBGs[0] = new GumpPic(this, 34, 10, 0x0805, 0));
                AddControl(m_BarBGs[1] = new GumpPic(this, 34, 24, 0x0805, 0));
                AddControl(m_BarBGs[2] = new GumpPic(this, 34, 38, 0x0805, 0));
                m_Bars = new GumpPicWithWidth[3];
                AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 10, 0x0806, 0, 1f));
                AddControl(m_Bars[1] = new GumpPicWithWidth(this, 34, 24, 0x0806, 0, 1f));
                AddControl(m_Bars[2] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f));
            }
            else
            {
                AddControl(m_Background = new GumpPic(this, 0, 0, 0x0804, 0));
                m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent;
                m_BarBGs = new GumpPic[1];
                AddControl(m_BarBGs[0] = new GumpPic(this, 34, 38, 0x0805, 0));
                m_Bars = new GumpPicWithWidth[1];
                AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f));
                AddControl(m_NameEntry = new TextEntry(this, 17, 16, 124, 20, 0, 0, 99, mobile.Name));
                SetupMobileNameEntry();
            }

            // bars should not handle mouse input, pass it to the background gump.
            for (int i = 0; i < m_BarBGs.Length; i++)
            {
                m_BarBGs[i].HandlesMouseInput = false;
                m_Bars[i].HandlesMouseInput = false;
            }
        }
예제 #7
0
        public LoginGump()
            : base(0, 0)
        {
            int hue = 902; // dark grey
            // backdrop
            AddControl(new GumpPicTiled(this, 0, 0, 800, 600, 0x0588));
            AddControl(new ResizePic(this, 128, 285, 0x13BE, 520, 190));
            AddControl(new GumpPic(this, 0, 0, 0x157C, 0)); // 0x2329
            AddControl(new GumpPic(this, 354, 42, 0x058A, 0)); // 0x2329
            // quit button
            AddControl(new Button(this, 554, 2, 5513, 5515, ButtonTypes.Activate, 0, (int)LoginGumpButtons.QuitButton));
            ((Button)LastControl).GumpOverID = 5514;
            // Log in to Ultima Online
            AddControl(new TextLabelAscii(this, 254, 305, hue, 2, IO.StringData.Entry(3000038)));
            // Account Name
            AddControl(new TextLabelAscii(this, 181, 346, hue, 2, IO.StringData.Entry(3000099)));
            // Password
            AddControl(new TextLabelAscii(this, 181, 386, hue, 2, IO.StringData.Entry(3000103)));
            // name field
            TextEntry g1 = new TextEntry(this, 332, 346, 200, 20, 0, (int)LoginGumpTextFields.AccountName, 32, Settings.Server.UserName);
            g1.HtmlTag = "<basefont color=#000000><big>";
            AddControl(new ResizePic(this, g1));
            AddControl(g1);
            // password field
            TextEntry g2 = new TextEntry(this, 332, 386, 200, 20, 0, (int)LoginGumpTextFields.Password, 32, "");
            g2.IsPasswordField = true;
            g2.HtmlTag = "<basefont color=#000000><big>";
            AddControl(new ResizePic(this, g2));
            AddControl(g2);
            // login button
            AddControl(new Button(this, 610, 439, 5540, 5542, ButtonTypes.Activate, 0, (int)LoginGumpButtons.LoginButton));
            ((Button)LastControl).GumpOverID = 5541;
            // Version information
            AddControl(new HtmlGumpling(this, 183, 440, 300, 20, 0, 0, "<medium><outline><font color='#CCDDCC'>" + Utility.VersionString));

            IsUncloseableWithRMB = true;
        }
예제 #8
0
        public override void Update(double totalMS, double frameMS)
        {
            if (m_TextEntry == null)
            {
                IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
                IFont font = provider.GetUnicodeFont(0);
                m_TextEntry = new TextEntry(this, 1, Height - font.Height, Width, font.Height, 0, 0, MaxChatMessageLength, string.Empty);
                m_TextEntry.LegacyCarat = true;
                Mode = ChatMode.Default;

                AddControl(new CheckerTrans(this, 0, Height - 20, Width, 20));
                AddControl(m_TextEntry);
            }

            for (int i = 0; i < m_TextEntries.Count; i++)
            {
                m_TextEntries[i].Update(totalMS, frameMS);
                if (m_TextEntries[i].IsExpired)
                {
                    m_TextEntries[i].Dispose();
                    m_TextEntries.RemoveAt(i);
                    i--;
                }
            }

            // Ctrl-Q = Cycle backwards through the things you have said today
            // Ctrl-W = Cycle forwards through the things you have said today
            if (m_Input.HandleKeyboardEvent(KeyboardEvent.Down, WinKeys.Q, false, false, true) && m_MessageHistoryIndex > -1)
            {
                if (m_MessageHistoryIndex > 0)
                    m_MessageHistoryIndex -= 1;
                {
                    Mode = m_MessageHistory[m_MessageHistoryIndex].Item1;
                    m_TextEntry.Text = m_MessageHistory[m_MessageHistoryIndex].Item2;
                }
            }
            else if (m_Input.HandleKeyboardEvent(KeyboardEvent.Down, WinKeys.W, false, false, true))
            {
                if (m_MessageHistoryIndex < m_MessageHistory.Count - 1)
                {
                    m_MessageHistoryIndex += 1;
                    Mode = m_MessageHistory[m_MessageHistoryIndex].Item1;
                    m_TextEntry.Text = m_MessageHistory[m_MessageHistoryIndex].Item2;
                }
                else
                    m_TextEntry.Text = string.Empty;
            }
            // backspace when mode is not default and Text is empty = clear mode.
            else if (m_Input.HandleKeyboardEvent(KeyboardEvent.Down, WinKeys.Back, false, false, false) && m_TextEntry.Text == string.Empty)
            {
                Mode = ChatMode.Default;
            }

            // if in default, only switch mode if there is a single command char (;, :, etc) followed by any other char.
            // in not in default, only switch mode if the single command char is the only char entered.
            if ((Mode == ChatMode.Default && m_TextEntry.Text.Length == 2) ||
                (Mode != ChatMode.Default && m_TextEntry.Text.Length == 1))
            {
                switch (m_TextEntry.Text[0])
                {
                    case ':': // emote
                        Mode = ChatMode.Emote;
                        break;
                    case ';': // whisper
                        Mode = ChatMode.Whisper;
                        break;
                    case '/': // party
                        Mode = ChatMode.Party;
                        break;
                    case '\\': // guild
                        Mode = ChatMode.Guild;
                        break;
                    case '|': // alliance
                        Mode = ChatMode.Alliance;
                        break;
                }
            }

            base.Update(totalMS, frameMS);
        }
예제 #9
0
        public override void Update(double totalMS, double frameMS)
        {
            if (m_TextEntry == null)
            {
                IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
                IFont font = provider.GetUnicodeFont(0);
                m_TextEntry = new TextEntry(this, 1, Height - font.Height, Width, font.Height, 0, 0, MaxChatMessageLength, string.Empty);
                m_TextEntry.LegacyCarat = true;

                AddControl(new CheckerTrans(this, 0, Height - 20, Width, 20));
                AddControl(m_TextEntry);
            }

            for (int i = 0; i < m_TextEntries.Count; i++)
            {
                m_TextEntries[i].Update(totalMS, frameMS);
                if (m_TextEntries[i].IsExpired)
                {
                    m_TextEntries[i].Dispose();
                    m_TextEntries.RemoveAt(i);
                    i--;
                }
            }

            // Ctrl-Q = Cycle backwards through the things you have said today
            // Ctrl-W = Cycle forwards through the things you have said today
            if (m_Input.HandleKeyboardEvent(KeyboardEventType.Down, WinKeys.Q, false, false, true) && m_MessageHistoryIndex > -1)
            {
                if (m_MessageHistoryIndex > 0)
                    m_MessageHistoryIndex -= 1;
                m_TextEntry.Text = m_MessageHistory[m_MessageHistoryIndex];

            }
            else if (m_Input.HandleKeyboardEvent(KeyboardEventType.Down, WinKeys.W, false, false, true))
            {
                if (m_MessageHistoryIndex < m_MessageHistory.Count - 1)
                {
                    m_MessageHistoryIndex += 1;
                    m_TextEntry.Text = m_MessageHistory[m_MessageHistoryIndex];
                }
                else
                    m_TextEntry.Text = string.Empty;
            }

            base.Update(totalMS, frameMS);
        }