public WorldInteraction(WorldModel world)
        {
            m_Network = ServiceRegistry.GetService<INetworkClient>();
            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();

            m_World = world;
        }
        public UseSkillButtonGump(SkillEntry skill)
            : base(skill.ID, 0)
        {
            while (UserInterface.GetControl<UseSkillButtonGump>(skill.ID) != null)
            {
                UserInterface.GetControl<UseSkillButtonGump>(skill.ID).Dispose();
            }

            m_Skill = skill;
            m_World = ServiceRegistry.GetService<WorldModel>();

            IsMoveable = true;
            HandlesMouseInput = true;

            m_BG = new ResizePic[3];
            m_BG[0] = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x24B8, 120, 40));
            m_BG[1] = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x24EA, 120, 40));
            m_BG[2] = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x251C, 120, 40));
            m_Caption = (HtmlGumpling)AddControl(new HtmlGumpling(this, 0, 10, 120, 20, 0, 0, "<center>" + m_Skill.Name));

            for (int i = 0; i < 3; i++)
            {
                m_BG[i].MouseDownEvent += EventMouseDown;
                m_BG[i].MouseUpEvent += EventMouseUp;
                m_BG[i].MouseClickEvent += EventMouseClick;
            }
        }
        public PaperDollInteractable(AControl owner, int x, int y)
            : base(0, 0)
        {
            Owner = owner;
            Position = new Point(x, y);

            m_World = ServiceRegistry.GetService<WorldModel>();
        }
Exemple #4
0
 public DebugGump()
     : base(0, 0)
 {
     m_World = Service.Get<WorldModel>();
     IsMoveable = true;
     AddControl(new ResizePic(this, 0, 0, 0x2436, 256 + 16, 256 + 16));
     AddControl(m_Debug = new HtmlGumpling(this, 0, 0, 256, 256, 0, 0, string.Empty));
 }
Exemple #5
0
        public ItemGumpling(AControl parent, Item item)
            : base(parent)
        {
            BuildGumpling(item);
            HandlesMouseInput = true;

            m_World = Service.Get<WorldModel>();
        }
        public ItemGumpling(AControl owner, Item item)
            : base(owner)
        {
            buildGumpling(item);
            HandlesMouseInput = true;

            m_World = ServiceRegistry.GetService<WorldModel>();
        }
        public PaperDollInteractable(AControl parent, int x, int y)
            : base(0, 0)
        {
            Parent = parent;
            Position = new Point(x, y);

            m_World = ServiceRegistry.GetService<WorldModel>();
        }
Exemple #8
0
        public DebugGump()
            : base(0, 0)
        {
            m_World = ServiceRegistry.GetService<WorldModel>();

            IsMoveable = true;

            AddControl(new ResizePic(this, 0, 0, 0x2436, 256 + 16, 256 + 16));
        }
 public PaperDollInteractable(AControl parent, int x, int y, Mobile sourceEntity)
     : base(0, 0)
 {
     Parent = parent;
     Position = new Point(x, y);
     m_isFemale = sourceEntity.Flags.IsFemale;
     SourceEntity = sourceEntity;
     m_World = ServiceRegistry.GetService<WorldModel>();
 }
Exemple #10
0
        public MiniMapGump()
            : base(0, 0)
        {
            m_World = Service.Get<WorldModel>();

            m_UseLargeMap = MiniMap_LargeFormat;

            IsMoveable = true;
            MakeThisADragger();
        }
Exemple #11
0
 // ================================================================================
 // Ctor, Dispose, BuildGump, and SetActivePage
 // ================================================================================
 public BookGump(BaseBook entity)
     : base(entity.Serial, 0)
 {
     m_Book = entity;
     m_Book.SetCallbacks(OnEntityUpdate, OnEntityDispose);
     m_LastPage = (m_Book.PageCount + 2) / 2;
     IsMoveable = true;
     m_World = Service.Get<WorldModel>(false);
     BuildGump();
 }
Exemple #12
0
        public WorldView(WorldModel model)
            : base(model)
        {
            Isometric = new IsometricRenderer();
            Isometric.Lighting.LightDirection = -0.6f;

            MiniMap = new MiniMapTexture();
            MiniMap.Initialize();

            m_UI = Service.Get<UserInterfaceService>();
        }
Exemple #13
0
        public SkillsGump()
            : base(0, 0)
        {
            IsMoveable = true;

            m_World = ServiceRegistry.GetService<WorldModel>();

            AddControl(m_Background = new ExpandableScroll(this, 0, 0, 200));
            m_Background.TitleGumpID = 0x834;

            AddControl(m_SkillsHtml = new HtmlGumpling(this, 32, 32, 240, 200 - 92, 0, 2, string.Empty));
        }
Exemple #14
0
        public ChatControl(AControl parent, int x, int y, int width, int height)
            : base(parent)
        {
            Position = new Point(x, y);
            Size = new Point(width, height);

            m_TextEntries = new List<ChatLineTimed>();
            m_MessageHistory = new List<Tuple<ChatMode, string>>();

            m_Input = ServiceRegistry.GetService<InputManager>();
            m_World = ServiceRegistry.GetService<WorldModel>();

            IsUncloseableWithRMB = true;
        }
Exemple #15
0
        public EquipmentSlot(AControl parent, int x, int y, Mobile entity, EquipLayer layer)
            : base(parent)
        {
            HandlesMouseInput = true;

            m_Entity = entity;
            m_EquipLayer = layer;
            
            Position = new Point(x, y);
            AddControl(new GumpPicTiled(this, 0, 0, 19, 20, 0x243A));
            AddControl(new GumpPic(this, 0, 0, 0x2344, 0));

            m_World = ServiceRegistry.GetService<WorldModel>();
        }
Exemple #16
0
        public WorldViewGump()
            : base(0, 0)
        {
            HandlesMouseInput = false;
            IsUncloseableWithRMB = true;
            IsUncloseableWithEsc = true;
            IsMoveable = true;
            MetaData.Layer = UILayer.Under;

            m_Model = ServiceRegistry.GetService<WorldModel>();

            m_WorldWidth = Settings.UserInterface.PlayWindowGumpResolution.Width;
            m_WorldHeight = Settings.UserInterface.PlayWindowGumpResolution.Height;

            Position = new Point(32, 32);
            OnResize();
        }
        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;
            }
        }
        public UseSpellButtonGump(SpellDefinition spell)
            : base(spell.ID, 0)
        {
            while (UserInterface.GetControl<UseSpellButtonGump>(spell.ID) != null)
            {
                UserInterface.GetControl<UseSpellButtonGump>(spell.ID).Dispose();
            }

            m_Spell = spell;
            m_World = ServiceRegistry.GetService<WorldModel>();

            IsMoveable = true;
            HandlesMouseInput = true;

            m_SpellButton = (GumpPic)AddControl(new GumpPic(this, 0, 0, spell.GumpIconSmallID, 0));
            LastControl.HandlesMouseInput = true;
            LastControl.MouseDoubleClickEvent += EventMouseDoubleClick;
        }
        public TopMenuGump()
            : base(0, 0)
        {
            IsUncloseableWithRMB = true;
            IsMoveable = true;

            // maximized view
            AddControl(new ResizePic(this, 0, 0, 9200, 610, 27), 1);
            AddControl(new Button(this, 5, 3, 5540, 5542, 0, 2, 0), 1);
            ((Button)LastControl).GumpOverID = 5541;
            // buttons are 2443 small, 2445 big
            // 30, 93, 201, 309, 417, 480, 543
            // map, paperdollB, inventoryB, journalB, chat, help, < ? >
            AddControl(new Button(this, 30, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Map), 1);
            ((Button)LastControl).Caption = "<basefont color=#000000>Map";
            AddControl(new Button(this, 93, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Paperdoll), 1);
            ((Button)LastControl).Caption = "<basefont color=#000000>Paperdoll";
            AddControl(new Button(this, 201, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Inventory), 1);
            ((Button)LastControl).Caption = "<basefont color=#000000>Inventory";
            AddControl(new Button(this, 309, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Journal), 1);
            ((Button)LastControl).Caption = "<basefont color=#000000>Journal";
            AddControl(new Button(this, 417, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Chat), 1);
            ((Button)LastControl).Caption = "<basefont color=#000000>Chat";
            AddControl(new Button(this, 480, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Help), 1);
            ((Button)LastControl).Caption = "<basefont color=#000000>Help";
            AddControl(new Button(this, 543, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Question), 1);
            ((Button)LastControl).Caption = "<basefont color=#000000>Debug";
            // minimized view
            AddControl(new ResizePic(this, 0, 0, 9200, 30, 27), 2);
            AddControl(new Button(this, 5, 3, 5537, 5539, 0, 1, 0), 2);
            ((Button)LastControl).GumpOverID = 5538;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_World = ServiceRegistry.GetService<WorldModel>();
            m_Client = ServiceRegistry.GetService<INetworkClient>();

            MetaData.Layer = UILayer.Over;
        }
Exemple #20
0
        // ================================================================================
        // Ctor, Update, Dispose
        // ================================================================================
        public SpellbookGump(SpellBook entity, int itemID)
            : base(entity.Serial, 0)
        {
            m_World = ServiceRegistry.GetService<WorldModel>();

            m_Spellbook = entity;
            m_Spellbook.OnEntityUpdated += OnEntityUpdate;

            IsMoveable = true;

            if (m_Spellbook.BookType != SpellBookTypes.Unknown)
            {
                CreateMageryGumplings();
            }
            else
            {
                // display a default spellbook graphic, based on the default spellbook type for this item ID.
                // right now, I'm just using a magery background, but really the background should change based
                // on the item id.
                AddControl(new GumpPic(this, 0, 0, 0x08AC, 0));
                // other options? necro? spellweaving?
            }
        }
        private void BuildGump()
        {
            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_World = ServiceRegistry.GetService<WorldModel>();
            m_Client = ServiceRegistry.GetService<INetworkClient>();

            IsMoveable = true;
            SaveOnWorldStop = true;
            GumpLocalID = Mobile.Serial;

            if (Mobile.IsClientEntity)
            {
                AddControl(new GumpPic(this, 0, 0, 0x07d0, 0));

                // HELP
                AddControl(new Button(this, 185, 44 + 27 * 0, 0x07ef, 0x07f0, ButtonTypes.Activate, 0,
                    (int)Buttons.Help));
                ((Button)LastControl).GumpOverID = 0x07f1;
                // OPTIONS
                AddControl(new Button(this, 185, 44 + 27 * 1, 0x07d6, 0x07d7, ButtonTypes.Activate, 0,
                    (int)Buttons.Options));
                ((Button)LastControl).GumpOverID = 0x07d8;
                // LOG OUT
                AddControl(new Button(this, 185, 44 + 27 * 2, 0x07d9, 0x07da, ButtonTypes.Activate, 0,
                    (int)Buttons.LogOut));
                ((Button)LastControl).GumpOverID = 0x07db;
                // QUESTS
                AddControl(new Button(this, 185, 44 + 27 * 3, 0x57b5, 0x57b7, ButtonTypes.Activate, 0,
                    (int)Buttons.Quests));
                ((Button)LastControl).GumpOverID = 0x57b6;
                // SKILLS
                AddControl(new Button(this, 185, 44 + 27 * 4, 0x07df, 0x07e0, ButtonTypes.Activate, 0,
                    (int)Buttons.Skills));
                ((Button)LastControl).GumpOverID = 0x07e1;
                // GUILD
                AddControl(new Button(this, 185, 44 + 27 * 5, 0x57b2, 0x57b4, ButtonTypes.Activate, 0,
                    (int)Buttons.Guild));
                ((Button)LastControl).GumpOverID = 0x57b3;
                // PEACE / WAR
                m_IsWarMode = Mobile.Flags.IsWarMode;
                int[] btngumps = m_IsWarMode ? WarModeBtnGumps : PeaceModeBtnGumps;
                m_WarModeBtn = (Button)AddControl(new Button(this, 185, 44 + 27 * 6, btngumps[0], btngumps[1], ButtonTypes.Activate, 0,
                    (int)Buttons.PeaceWarToggle));
                ((Button)LastControl).GumpOverID = btngumps[2];
                // STATUS
                AddControl(new Button(this, 185, 44 + 27 * 7, 0x07eb, 0x07ec, ButtonTypes.Activate, 0,
                    (int)Buttons.Status));
                ((Button)LastControl).GumpOverID = 0x07ed;

                // Virtue menu
                AddControl(new GumpPic(this, 80, 8, 0x0071, 0));
                LastControl.MouseDoubleClickEvent += VirtueMenu_MouseDoubleClickEvent;

                // Special moves book
                // AddControl(new GumpPic(this, 158, 200, 0x2B34, 0));
                // LastControl.MouseDoubleClickEvent += SpecialMoves_MouseDoubleClickEvent;

                // equipment slots for hat/earrings/neck/ring/bracelet
                AddControl(new EquipmentSlot(this, 2, 76, Mobile, EquipLayer.Helm));
                AddControl(new EquipmentSlot(this, 2, 76 + 22 * 1, Mobile, EquipLayer.Earrings));
                AddControl(new EquipmentSlot(this, 2, 76 + 22 * 2, Mobile, EquipLayer.Neck));
                AddControl(new EquipmentSlot(this, 2, 76 + 22 * 3, Mobile, EquipLayer.Ring));
                AddControl(new EquipmentSlot(this, 2, 76 + 22 * 4, Mobile, EquipLayer.Bracelet));

                // Paperdoll control!
                AddControl(new PaperDollInteractable(this, 8, 21)
                {
                    SourceEntity = Mobile
                });
            }
            else
            {
                AddControl(new GumpPic(this, 0, 0, 0x07d1, 0));

                // Paperdoll
                AddControl(new PaperDollInteractable(this, 8, 21)
                {
                    SourceEntity = Mobile
                });
            }

            // name and title
            AddControl(new HtmlGumpling(this, 36, 262, 180, 42, 0, 0, string.Format("<span color=#aaa style='font-family:uni0;'>{0}", Mobile.Name)));
            AddControl(new HtmlGumpling(this, 35, 262, 180, 42, 0, 0, string.Format("<span color=#222 style='font-family:uni0;'>{0}", Mobile.Name)));
        }
Exemple #22
0
        public OptionsGump()
            : base(0, 0)
        {
            IsMoveable = true;

            AddControl(new ResizePic(this, 40, 0, 2600, 550, 450));
            //left column
            AddControl(new Button(this, 0, 40, 218, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound));
            AddControl(new Button(this, 0, 110, 220, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help));
            AddControl(new Button(this, 0, 250, 224, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat));
            AddControl(new Button(this, 0, 320, 237, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros));
            //right column
            AddControl(new Button(this, 576, 40, 226, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface));
            AddControl(new Button(this, 576, 110, 228, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display));
            AddControl(new Button(this, 576, 180, 230, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation));
            AddControl(new Button(this, 576, 250, 232, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous));
            AddControl(new Button(this, 576, 320, 235, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters));
            //bottom buttons
            AddControl(new Button(this, 140, 410, 243, 241, ButtonTypes.Activate, 0, (int)Buttons.Cancel));
            AddControl(new Button(this, 240, 410, 239, 240, ButtonTypes.Activate, 0, (int)Buttons.Apply));
            AddControl(new Button(this, 340, 410, 246, 244, ButtonTypes.Activate, 0, (int)Buttons.Default));
            AddControl(new Button(this, 440, 410, 249, 248, ButtonTypes.Activate, 0, (int)Buttons.Okay));

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_World = ServiceRegistry.GetService<WorldModel>();

            // page 1 Sound and Music
            AddControl(new Button(this, 0, 40, 217, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound), 1);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Sound and Music"), 1);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settting affect the sound and music you will hear while playing Ultima Online."), 1);

            AddControl(new TextLabelAscii(this, 85, 85, 9, 1, @"Sound on/off"), 1);
            m_SoundOn = AddControl<CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.Audio.SoundOn, 61), 1);

            AddControl(new TextLabelAscii(this, 60, 110, 9, 1, @"Sound volume"), 1);
            m_SoundVolume = AddControl<HSliderBar>(new HSliderBar(this, 60, 130, 150, 0, 100, Settings.Audio.SoundVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1);
            m_Labels[(int)Labels.SoundVolume] = AddControl<TextLabelAscii>(new TextLabelAscii(this, 220, 130, 9, 1, Settings.Audio.SoundVolume.ToString()), 1);

            AddControl(new TextLabelAscii(this, 85, 155, 9, 1, @"Music on/off"), 1);
            m_MusicOn = AddControl<CheckBox>(new CheckBox(this, 60, 150, 210, 211, Settings.Audio.MusicOn, 62), 1);

            AddControl(new TextLabelAscii(this, 60, 180, 9, 1, @"Music volume"), 1);
            m_MusicVolume = AddControl<HSliderBar>(new HSliderBar(this, 60, 200, 150, 0, 100, Settings.Audio.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1);
            m_Labels[(int)Labels.MusicVolume] = AddControl<TextLabelAscii>(new TextLabelAscii(this, 220, 200, 9, 1, m_MusicVolume.Value.ToString()), 1);

            AddControl(new TextLabelAscii(this, 85, 225, 9, 1, @"Play footstep sound"), 1);
            m_FootStepSoundOn = AddControl<CheckBox>(new CheckBox(this, 60, 220, 210, 211, Settings.Audio.FootStepSoundOn, 62), 1);

            // page 2 Pop-up Help
            AddControl(new Button(this, 0, 110, 219, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help), 2);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Pop-up Help"), 2);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settting configure the behavior of the pop-up help."), 2);

            // page 3 Chat
            AddControl(new Button(this, 0, 250, 223, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat), 3);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Chat"), 3);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settting affect the interface display for chat system."), 3);

            // page 4 Macro Options
            AddControl(new Button(this, 0, 320, 236, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros), 4);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Macro Options"), 4);
            AddControl(new TextLabelAscii(this, 60, 40, 9, 1, @""), 4);
            AddControl(new Button(this, 180, 60, 2460, 2461, ButtonTypes.Activate, 4, (int)Buttons.MAdd), 4); // add
            AddControl(new Button(this, 234, 60, 2463, 2464, ButtonTypes.Activate, 4, (int)Buttons.MDelete), 4); // delete
            AddControl(new Button(this, 302, 60, 2466, 2467, ButtonTypes.Activate, 4, (int)Buttons.MPrevious), 4); // previous
            AddControl(new Button(this, 386, 60, 2469, 2470, ButtonTypes.Activate, 4, (int)Buttons.MNext), 4); // next
            AddControl(new TextLabelAscii(this, 125, 85, 9, 1, @"Keystroke"), 4);
            
            // key press event
            KeyPressControl myKeyPress = new KeyPressControl(this, 130, 100, 57, 14, 4000, WinKeys.None);
            AddControl(new ResizePic(this, myKeyPress), 4);
            m_MacroKeyPress = AddControl<KeyPressControl>(myKeyPress, 4);
            ///
            AddControl(new TextLabelAscii(this, 195, 100, 9, 1, @"Key"), 4);

            m_chkShift = AddControl<CheckBox>(new CheckBox(this, 260, 90, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //shift
            m_chkAlt = AddControl<CheckBox>(new CheckBox(this, 330, 90, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //alt
            m_chkCtrl = AddControl<CheckBox>(new CheckBox(this, 400, 90, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //ctrl
            AddControl(new TextLabelAscii(this, 285, 90, 9, 1, @"Shift"), 4);
            AddControl(new TextLabelAscii(this, 355, 90, 9, 1, @"Alt"), 4);
            AddControl(new TextLabelAscii(this, 425, 90, 9, 1, @"Ctrl"), 4);

            AddControl(new TextLabelAscii(this, 180, 135, 9, 1, @"ACTION"), 4);
            AddControl(new TextLabelAscii(this, 420, 135, 9, 1, @"VALUE"), 4);
            
            // macro's action type and controlling another dropdown list for visual
            int y = 0;
            for (int i = 0; i < MACRO_CAPACITY; i++)
            {
                //number of action
                AddControl(new TextLabelAscii(this, 84, 155 + y, 9, 1, (i + 1).ToString()), 4);
                
                // action dropdown list (i need ID variable for find in controls)
                m_ActionTypeList[i] = AddControl<MacroDropDownList>(new MacroDropDownList(
                    this, 100, 150 + y, 215, Utility.CreateStringLinesFromList(Macros.Types), 10, 0, false, (i + 1000), true), 4);
                
                // value dropdown list (i need ID variable for find in controls)
                m_ActionDropDown[i] = AddControl<MacroDropDownList>(new MacroDropDownList(
                    this, 330, 150 + y, 190, new string[] { }, 10, 0, false, (i + 2000), false), 4);
                
                //visual control about resizable picture
                m_ActionDropDown[i].IsVisible = false;
                
                //here is textentry for example: Say,Emote,Yell (i need ID variable for find in controls)
                m_ActionText[i] = AddControl<TextEntry>(new TextEntry(this, 340, 150 + y, 160, 20, 1, (3000 + i), 80, string.Empty), 4);
                m_ActionText[i].IsEditable = false;
                m_ActionText[i].IsVisible = false;
                y += 25;
            }

            // page 5 Interface
            AddControl(new Button(this, 576, 40, 225, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface), 5);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Interface"), 5);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settting affect your interface."), 5);

            AddControl(new TextLabelAscii(this, 85, 85, 9, 1, @"Your character will always run if this is checked"), 5);
            m_AlwaysRun = AddControl<CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.UserInterface.AlwaysRun, 61), 5);

            AddControl(new TextLabelAscii(this, 85, 115, 9, 1, @"Disable the Menu Bar"), 5);
            m_MenuBarDisabled = AddControl<CheckBox>(new CheckBox(this, 60, 110, 210, 211, Settings.UserInterface.MenuBarDisabled, 61), 5);

            // page 6 Display
            AddControl(new Button(this, 576, 110, 227, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display), 6);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Display"), 6);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settting affect your display, and adjusting some of them may improve your graphics performance.", 430), 6);

            AddControl(new TextLabelAscii(this, 85, 80, 9, 1, @"Enable vertical synchronization"), 6);
            m_IsVSyncEnabled = AddControl<CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.Engine.IsVSyncEnabled, 61), 6);

            AddControl(new TextLabelAscii(this, 85, 100, 9, 1, @"Some unused option"), 6);
            AddControl(new CheckBox(this, 60, 100, 210, 211, false, 62), 6);

            AddControl(new TextLabelAscii(this, 85, 120, 9, 1, @"Use full screen display"), 6);
            AddControl(new CheckBox(this, 60, 120, 210, 211, Settings.UserInterface.IsMaximized, 61), 6);

            AddControl(new TextLabelAscii(this, 60, 150, 9, 1, @"Full Screen Resolution:"), 6);
            m_DropDownFullScreenResolutions = AddControl<DropDownList>(new DropDownList(this, 60, 165, 122, Utility.CreateStringLinesFromList(Resolutions.FullScreenResolutionsList), 10, GetCurrentFullScreenIndex(), false), 6);

            AddControl(new TextLabelAscii(this, 60, 190, 9, 1, @"Play Window Resolution:"), 6);
            m_DropDownPlayWindowResolutions = AddControl<DropDownList>(new DropDownList(this, 60, 205, 122, Utility.CreateStringLinesFromList(Resolutions.FullScreenResolutionsList), 10, GetCurrentPlayWindowIndex(), false), 6);

            AddControl(new TextLabelAscii(this, 85, 235, 9, 1, @"Speech color"), 6);
            m_SpeechColor = AddControl<ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 235, 15, 15), new Rectangle(60, 235, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.SpeechColor), 6);

            AddControl(new TextLabelAscii(this, 85, 255, 9, 1, @"Emote color"), 6);
            m_EmoteColor = AddControl<ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 255, 15, 15), new Rectangle(60, 255, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.EmoteColor), 6);

            AddControl(new TextLabelAscii(this, 85, 275, 9, 1, @"Party message color"), 6);
            m_PartyMsgColor = AddControl<ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 275, 15, 15), new Rectangle(60, 275, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.PartyMsgColor), 6);

            AddControl(new TextLabelAscii(this, 85, 295, 9, 1, @"Guild message color"), 6);
            m_GuildMsgColor = AddControl<ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 295, 15, 15), new Rectangle(60, 295, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.GuildMsgColor), 6);

            AddControl(new TextLabelAscii(this, 85, 315, 9, 1, @"Ignore guild messages"), 6);
            m_IgnoreGuildMsg = AddControl<CheckBox>(new CheckBox(this, 60, 315, 210, 211, Settings.UserInterface.IgnoreGuildMsg, 62), 6);

            AddControl(new TextLabelAscii(this, 85, 335, 9, 1, @"Alliance message color"), 6);
            m_AllianceMsgColor = AddControl<ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 335, 15, 15), new Rectangle(60, 335, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.AllianceMsgColor), 6);

            AddControl(new TextLabelAscii(this, 85, 355, 9, 1, @"Ignore alliance messages"), 6);
            m_IgnoreAllianceMsg = AddControl<CheckBox>(new CheckBox(this, 60, 355, 210, 211, Settings.UserInterface.IgnoreAllianceMsg, 62), 6);

            // page 7 Reputation system
            AddControl(new Button(this, 576, 180, 229, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation), 7);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Reputation system"), 7);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settting affect the reputation system, which is Ultima Online's system for controlling antisocial behavior."), 7);

            // page 8 Miscellaneous
            AddControl(new Button(this, 576, 250, 231, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous), 8);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Miscellaneous"), 8);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"Miscellaneous options."), 8);

            AddControl(new TextLabelAscii(this, 85, 80, 9, 1, @"Enable debug console"), 8);
            m_IsConsoleEnabled = AddControl<CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.Debug.IsConsoleEnabled, 61), 8);

            AddControl(new TextLabelAscii(this, 85, 100, 9, 1, @"Show FPS"), 8);
            m_ShowFps = AddControl<CheckBox>(new CheckBox(this, 60, 100, 210, 211, Settings.Debug.ShowFps, 61), 8);

            // page 9 Filter Options
            AddControl(new Button(this, 576, 320, 234, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters), 9);
            AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Filter Options"), 9);
            AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @""), 9);
            
            ChangeCurrentMacro(Macros.Player.Count - 1);
        }
Exemple #23
0
 protected override void OnInitialize()
 {
     m_Model = ServiceRegistry.GetService<WorldModel>();
 }
Exemple #24
0
 protected override void OnInitialize()
 {
     m_Model = Service.Get<WorldModel>();
 }
Exemple #25
0
        public OptionsGump()
            : base(0, 0)
        {
            BuildResolutionsLists();

            IsMoveable = true;
            AddControl(new ResizePic(this, 40, 0, 2600, 550, 450));
            //left column
            AddControl(new Button(this, 0, 40, 218, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound));
            AddControl(new Button(this, 0, 110, 220, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help));
            AddControl(new Button(this, 0, 250, 224, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat));
            AddControl(new Button(this, 0, 320, 237, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros));
            //right column
            AddControl(new Button(this, 576, 40, 226, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface));
            AddControl(new Button(this, 576, 110, 228, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display));
            AddControl(new Button(this, 576, 180, 230, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation));
            AddControl(new Button(this, 576, 250, 232, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous));
            AddControl(new Button(this, 576, 320, 235, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters));
            //bottom buttons
            AddControl(new Button(this, 140, 410, 243, 241, ButtonTypes.Activate, 0, (int)Buttons.Cancel));
            AddControl(new Button(this, 240, 410, 239, 240, ButtonTypes.Activate, 0, (int)Buttons.Apply));
            AddControl(new Button(this, 340, 410, 246, 244, ButtonTypes.Activate, 0, (int)Buttons.Default));
            AddControl(new Button(this, 440, 410, 249, 248, ButtonTypes.Activate, 0, (int)Buttons.Okay));

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_World = ServiceRegistry.GetService<WorldModel>();

            // page 1 Sound and Music
            AddControl(new Button(this, 0, 40, 217, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound),1);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Sound and Music"), 1);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect the sound and music you will hear while playing Ultima Online."), 1);

            AddControl(new TextLabelAscii(this, 85, 85, 1, 9, @"Sound on/off"), 1);
            m_SoundOn = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.Audio.SoundOn, 61), 1);

            AddControl(new TextLabelAscii(this, 60, 110, 1, 9, @"Sound volume"), 1);
            m_SoundVolume = (HSliderBar)AddControl(new HSliderBar(this, 60, 130, 150, 0, 100, Settings.Audio.SoundVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1);
            m_Labels[(int)Labels.SoundVolume] = (TextLabelAscii)AddControl(new TextLabelAscii(this, 220, 130, 1, 9, Settings.Audio.SoundVolume.ToString()), 1);

            AddControl(new TextLabelAscii(this, 85, 155, 1, 9, @"Music on/off"), 1);
            m_MusicOn = (CheckBox)AddControl(new CheckBox(this, 60, 150, 210, 211, Settings.Audio.MusicOn, 62), 1);

            AddControl(new TextLabelAscii(this, 60, 180, 1, 9, @"Music volume"), 1);
            m_MusicVolume = (HSliderBar)AddControl(new HSliderBar(this, 60, 200, 150, 0, 100, Settings.Audio.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1);
            m_Labels[(int)Labels.MusicVolume] = (TextLabelAscii)AddControl(new TextLabelAscii(this, 220, 200, 1, 9, m_MusicVolume.Value.ToString()), 1);

            AddControl(new TextLabelAscii(this, 85, 225, 1, 9, @"Play footstep sound"), 1);
            m_FootStepSoundOn = (CheckBox)AddControl(new CheckBox(this, 60, 220, 210, 211, Settings.Audio.FootStepSoundOn, 62), 1);

            // page 2 Pop-up Help
            AddControl(new Button(this, 0, 110, 219, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help),2);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Pop-up Help"), 2);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting configure the behavior of the pop-up help."), 2);

            // page 3 Chat
            AddControl(new Button(this, 0, 250, 223, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat),3);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Chat"), 3);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect the interface display for chat system."), 3);

            // page 4 Macro Options
            AddControl(new Button(this, 0, 320, 236, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros),4);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Macro Options"), 4);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @""), 4);
            AddControl(new Button(this, 180, 110, 2460, 2461, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros), 4); // add
            AddControl(new Button(this, 234, 110, 2463, 2464, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros), 4); // delete
            AddControl(new Button(this, 302, 110, 2466, 2467, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros), 4); // previous
            AddControl(new Button(this, 386, 110, 2469, 2470, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros), 4); // next
            AddControl(new TextLabelAscii(this, 160, 150, 1, 9, @"Keystroke"), 4);
            AddControl(new GumpPic(this, 155, 175, 2444, 0), 4); // macro key input
            AddControl(new TextLabelAscii(this, 225, 180, 1, 9, @"Key"), 4);

            AddControl(new CheckBox(this, 270, 140, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //shift
            AddControl(new CheckBox(this, 270, 170, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //alt
            AddControl(new CheckBox(this, 270, 200, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //ctrl
            AddControl(new TextLabelAscii(this, 307, 150, 1, 9, @"Shift"), 4);
            AddControl(new TextLabelAscii(this, 307, 180, 1, 9, @"Alt"), 4);
            AddControl(new TextLabelAscii(this, 307, 210, 1, 9, @"Ctrl"), 4);

            AddControl(new TextLabelAscii(this, 160, 225, 1, 9, @"Actions"), 4);
            AddControl(new GumpPic(this, 155, 245, 2445, 0), 4); // action type
            AddControl(new GumpPic(this, 267, 245, 2446, 0), 4); // action

            AddControl(new GumpPic(this, 155, 272, 2445, 0), 4); // action type

            // page 5 Interface
            AddControl(new Button(this, 576, 40, 225, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface),5);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Interface"), 5);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect your interface."), 5);

            AddControl(new TextLabelAscii(this, 85, 85, 1, 9, @"Your character will always run if this is checked"), 5);
            m_AlwaysRun = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.World.AlwaysRun, 61), 5);

            AddControl(new TextLabelAscii(this, 85, 115, 1, 9, @"Disable the Menu Bar"), 5);
            m_MenuBarDisabled = (CheckBox)AddControl(new CheckBox(this, 60, 110, 210, 211, Settings.World.MenuBarDisabled, 61), 5);

            // page 6 Display
            AddControl(new Button(this, 576, 110, 227, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display),6);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Display"), 6);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect your display, and adjusting some of them may improve your graphics performance.", 430), 6);

            AddControl(new TextLabelAscii(this, 85, 80, 1, 9, @"Enable vertical synchronization"), 6);
            m_IsVSyncEnabled = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.Game.IsVSyncEnabled, 61), 6);

            AddControl(new TextLabelAscii(this, 85, 100, 1, 9, @"Some unused option"), 6);
            AddControl(new CheckBox(this, 60, 100, 210, 211, false, 62), 6);

            AddControl(new TextLabelAscii(this, 85, 120, 1, 9, @"Use full screen display"), 6);
            AddControl(new CheckBox(this, 60, 120, 210, 211, Settings.World.IsMaximized, 61), 6);

            AddControl(new TextLabelAscii(this, 60, 150, 1, 9, @"Client Window Resolution:"), 6);
            m_DropDownFullScreenResolutions = (DropDownList)AddControl(new DropDownList(this, 60, 165, 122, CreateResolutionsStringArrayFromList(m_FullScreenResolutionsList), 10, GetCurrentFullScreenIndex(), false), 6);

            AddControl(new TextLabelAscii(this, 60, 190, 1, 9, @"Play Window Resolution:"), 6);
            m_DropDownPlayWindowResolutions = (DropDownList)AddControl(new DropDownList(this, 60, 205, 122, CreateResolutionsStringArrayFromList(m_PlayWindowResolutionsList), 10, GetCurrentPlayWindowIndex(), false), 6);

            AddControl(new TextLabelAscii(this, 85, 235, 1, 9, @"Speech color"), 6);
            m_SpeechColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 235, 15, 15), new Rectangle(60, 235, 450, 150), 30, 10, Hues.TextTones, Settings.Game.SpeechColor), 6);

            AddControl(new TextLabelAscii(this, 85, 255, 1, 9, @"Emote color"), 6);
            m_EmoteColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 255, 15, 15), new Rectangle(60, 255, 450, 150), 30, 10, Hues.TextTones, Settings.Game.EmoteColor), 6);

            AddControl(new TextLabelAscii(this, 85, 275, 1, 9, @"Party message color"), 6);
            m_PartyMsgColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 275, 15, 15), new Rectangle(60, 275, 450, 150), 30, 10, Hues.TextTones, Settings.Game.PartyMsgColor), 6);

            AddControl(new TextLabelAscii(this, 85, 295, 1, 9, @"Guild message color"), 6);
            m_GuildMsgColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 295, 15, 15), new Rectangle(60, 295, 450, 150), 30, 10, Hues.TextTones, Settings.Game.GuildMsgColor), 6);

            AddControl(new TextLabelAscii(this, 85, 315, 1, 9, @"Ignore guild messages"), 6);
            m_IgnoreGuildMsg = (CheckBox)AddControl(new CheckBox(this, 60, 315, 210, 211, Settings.Game.IgnoreGuildMsg, 62), 6);

            AddControl(new TextLabelAscii(this, 85, 335, 1, 9, @"Alliance message color"), 6);
            m_AllianceMsgColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 335, 15, 15), new Rectangle(60, 335, 450, 150), 30, 10, Hues.TextTones, Settings.Game.AllianceMsgColor), 6);

            AddControl(new TextLabelAscii(this, 85, 355, 1, 9, @"Ignore alliance messages"), 6);
            m_IgnoreAllianceMsg = (CheckBox)AddControl(new CheckBox(this, 60, 355, 210, 211, Settings.Game.IgnoreAllianceMsg, 62), 6);

            // page 7 Reputation system
            AddControl(new Button(this, 576, 180, 229, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation),7);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Reputation system"), 7);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect the reputation system, which is Ultima Online's system for controlling antisocial behavior."), 7);

            // page 8 Miscellaneous
            AddControl(new Button(this, 576, 250, 231, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous),8);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Miscellaneous"), 8);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"Miscellaneous options."), 8);

            AddControl(new TextLabelAscii(this, 85, 80, 1, 9, @"Enable debug console"), 8);
            m_IsConsoleEnabled = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.Debug.IsConsoleEnabled, 61), 8);

            AddControl(new TextLabelAscii(this, 85, 100, 1, 9, @"Show FPS"), 8);
            m_ShowFps = (CheckBox)AddControl(new CheckBox(this, 60, 100, 210, 211, Settings.Debug.ShowFps, 61), 8);

            // page 9 Filter Options
            AddControl(new Button(this, 576, 320, 234, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters),9);
            AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Filter Options"), 9);
            AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @""), 9);
        }