Example #1
0
        public Button(AControl owner)
            : base(owner)
        {
            HandlesMouseInput = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
        }
        public ColorPickerBox(AControl parent)
            : base(parent)
        {
            HandlesMouseInput = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
        }
Example #3
0
 public LoginState()
     : base()
 {
     m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
     m_Login = ServiceRegistry.GetService<LoginModel>();
     m_Input = ServiceRegistry.GetService<InputManager>();
 }
Example #4
0
        public HueTestState()
            : base()
        {
            OverHue = -1;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
        }
Example #5
0
        public WorldInteraction(WorldModel world)
        {
            m_Network = ServiceRegistry.GetService<INetworkClient>();
            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();

            m_World = world;
        }
Example #6
0
        public DropDownList(AControl owner)
            : base(owner)
        {
            HandlesMouseInput = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Font = ServiceRegistry.GetService<IUIResourceProvider>().GetAsciiFont(1);
        }
Example #7
0
        public TextEntry(AControl parent)
            : base(parent)
        {
            HandlesMouseInput = true;
            HandlesKeyboardFocus = true;

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
        }
Example #8
0
        public WorldCursor(WorldModel model)
        {
            m_Network = ServiceRegistry.GetService<INetworkClient>();
            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Input = ServiceRegistry.GetService<InputManager>();

            m_World = model;
            InternalRegisterInteraction();
        }
Example #9
0
        public WorldInput(WorldModel world)
        {
            World = world;

            m_Network = ServiceRegistry.GetService<INetworkClient>();
            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Input = ServiceRegistry.GetService<InputManager>();

            MousePick = new MousePicking();
        }
Example #10
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>();
        }
        public override void Intitialize()
        {
            base.Intitialize();

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Login = ServiceRegistry.GetService<LoginModel>();

            m_SelectServerGump = (SelectServerGump)m_UserInterface.AddControl(new SelectServerGump(), 0, 0);
            m_SelectServerGump.OnBackToLoginScreen += OnBackToLoginScreen;
            m_SelectServerGump.OnSelectLastServer += OnSelectLastServer;
            m_SelectServerGump.OnSelectServer += OnSelectServer;
        }
Example #12
0
        public override void Intitialize()
        {
            base.Intitialize();

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Login = ServiceRegistry.GetService<LoginModel>();

            m_Gump = (LoggingInGump)m_UserInterface.AddControl(new LoggingInGump(), 0, 0);
            m_Gump.OnCancelLogin += OnCancelLogin;

            m_Login.Client.Disconnect();
        }
Example #13
0
        protected override void OnInitialize()
        {
            ServiceRegistry.GetService<UltimaGame>().SetupWindowForLogin();

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_UserInterface.Cursor = new UltimaCursor();

            m_SceneManager = new StateManager();
            m_SceneManager.ResetToLoginScreen();

            ServiceRegistry.GetService<AudioService>().PlayMusic(0);
        }
        public override void Intitialize()
        {
            base.Intitialize();

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Login = ServiceRegistry.GetService<LoginModel>();

            m_CharListGump = (CharacterListGump)m_UserInterface.AddControl(new CharacterListGump(), 0, 0);
            m_CharListGump.OnBackToSelectServer += OnBackToSelectServer;
            m_CharListGump.OnLoginWithCharacter += OnLoginWithCharacter;
            m_CharListGump.OnDeleteCharacter += OnDeleteCharacter;
            m_CharListGump.OnNewCharacter += OnNewCharacter;
        }
Example #15
0
        public WorldInput(WorldModel world)
        {
            // parent reference
            World = world;

            // service references
            m_Network = ServiceRegistry.GetService<INetworkClient>();
            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Input = ServiceRegistry.GetService<InputManager>();

            // local instances
            MousePick = new MousePicking();
            m_Macros = new MacroEngine();
        }
Example #16
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_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_World = ServiceRegistry.GetService<WorldModel>();

            IsUncloseableWithRMB = true;
        }
Example #17
0
        // ============================================================================================================
        // Ctor, Initialization, Dispose, Update
        // ============================================================================================================
        public WorldModel()
        {
            Service.Add<WorldModel>(this);

            m_Engine = Service.Get<UltimaGame>();
            m_Network = Service.Get<INetworkClient>();
            m_UserInterface = Service.Get<UserInterfaceService>();

            Entities = new EntityManager(this);
            Entities.Reset(true);
            Effects = new EffectManager(this);
            Statics = new StaticManager();

            Input = new WorldInput(this);
            Interaction = new WorldInteraction(this);
            Client = new WorldClient(this);
        }
Example #18
0
        public override void Intitialize()
        {
            base.Intitialize();

            m_UserInterface = ServiceRegistry.GetService <UserInterfaceService>();
            m_Login         = ServiceRegistry.GetService <LoginModel>();

            m_SelectServerGump = (SelectServerGump)m_UserInterface.AddControl(new SelectServerGump(), 0, 0);
            m_SelectServerGump.OnBackToLoginScreen += OnBackToLoginScreen;
            m_SelectServerGump.OnSelectLastServer  += OnSelectLastServer;
            m_SelectServerGump.OnSelectServer      += OnSelectServer;

            m_Login.Client.OnWaitingForRelay  += DoRelay;
            m_Login.Client.OnHasCharacterList += SwitchToSelectChar;

            SelectAServerIfOnlyOneServer();
        }
Example #19
0
        // ============================================================================================================
        // Ctor, Initialization, Dispose, Update
        // ============================================================================================================
        public WorldModel()
        {
            Service.Add <WorldModel>(this);

            m_Engine        = Service.Get <UltimaGame>();
            m_Network       = Service.Get <INetworkClient>();
            m_UserInterface = Service.Get <UserInterfaceService>();

            Entities = new EntityManager(this);
            Entities.Reset(true);
            Effects = new EffectManager(this);
            Statics = new StaticManager();

            Input       = new WorldInput(this);
            Interaction = new WorldInteraction(this);
            Client      = new WorldClient(this);
        }
        public override void Intitialize()
        {
            base.Intitialize();

            m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
            m_Login = ServiceRegistry.GetService<LoginModel>();

            m_SelectServerGump = (SelectServerGump)m_UserInterface.AddControl(new SelectServerGump(), 0, 0);
            m_SelectServerGump.OnBackToLoginScreen += OnBackToLoginScreen;
            m_SelectServerGump.OnSelectLastServer += OnSelectLastServer;
            m_SelectServerGump.OnSelectServer += OnSelectServer;

            m_Login.Client.OnWaitingForRelay += DoRelay;
            m_Login.Client.OnHasCharacterList += SwitchToSelectChar;

            SelectAServerIfOnlyOneServer();
        }
Example #21
0
        public void RefreshPartyGumps()
        {
            UserInterfaceService ui = Service.Get <UserInterfaceService>();

            ui.RemoveControl <PartyHealthTrackerGump>();
            for (int i = 0; i < Members.Count; i++)
            {
                ui.AddControl(new PartyHealthTrackerGump(Members[i]), 5, 40 + (48 * i));
            }
            Gump gump;

            if ((gump = ui.GetControl <PartyGump>()) != null)
            {
                int x = gump.X;
                int y = gump.Y;
                ui.RemoveControl <PartyGump>();
                ui.AddControl(new PartyGump(), x, y);
            }
        }
Example #22
0
        public static void Toggle()
        {
            UserInterfaceService ui = Service.Get <UserInterfaceService>();

            if (ui.GetControl <MiniMapGump>() == null)
            {
                ui.AddControl(new MiniMapGump(), 566, 25);
            }
            else
            {
                if (MiniMapGump.MiniMap_LargeFormat == false)
                {
                    MiniMapGump.MiniMap_LargeFormat = true;
                }
                else
                {
                    ui.RemoveControl <MiniMapGump>();
                    MiniMapGump.MiniMap_LargeFormat = false;
                }
            }
        }
Example #23
0
        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;
        }
Example #24
0
        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;
        }
Example #25
0
 public virtual void Dispose()
 {
     m_UserInterface = null;
 }
Example #26
0
 public virtual void Intitialize()
 {
     m_UserInterface = ServiceRegistry.GetService <UserInterfaceService>();
 }
        public PaperDollGump(Mobile parent)
            : base(0, 0)
        {
            Parent = parent;

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

            IsMovable = true;

            if (parent == (Mobile)EntityManager.GetPlayerObject())
            {
                AddControl(new GumpPic(this, 0, 0, 0, 0x07d0, 0));
                LastControl.MakeDragger(this);
                LastControl.MakeCloseTarget(this);

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

                // Paperdoll
                AddControl(new PaperDollInteractable(this, 0, 8, 21)
                {
                    SourceEntity = Parent
                });
            }
            else
            {
                AddControl(new GumpPic(this, 0, 0, 0, 0x07d1, 0));
                LastControl.MakeDragger(this);
                LastControl.MakeCloseTarget(this);

                // Paperdoll
                AddControl(new PaperDollInteractable(this, 0, 8, 21)
                {
                    SourceEntity = Parent
                });
            }
        }
 public CreateCharacterState()
     : base()
 {
     m_UserInterface = UltimaServices.GetService <UserInterfaceService>();
     m_Login         = UltimaServices.GetService <LoginModel>();
 }
Example #29
0
 public UltimaCursor()
 {
     m_UserInterface = Service.Get <UserInterfaceService>();
 }
Example #30
0
 public virtual void Intitialize()
 {
     m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
 }
Example #31
0
        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)));
        }
Example #32
0
 public UltimaCursor()
 {
     m_UserInterface = Service.Get<UserInterfaceService>();
 }
Example #33
0
        public PaperDollGump(Mobile parent)
            : base(parent.Serial, 0)
        {
            Parent = parent;

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

            IsMovable = true;

            if (parent == (Mobile)WorldModel.Entities.GetPlayerObject())
            {
                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
                AddControl(new Button(this, 185, 44 + 27*6, 0x07e5, 0x07e6, ButtonTypes.Activate, 0,
                    (int) Buttons.PeaceWarToggle));
                ((Button) LastControl).GumpOverID = 0x07e7;
                // STATUS
                AddControl(new Button(this, 185, 44 + 27*7, 0x07eb, 0x07ec, ButtonTypes.Activate, 0,
                    (int) Buttons.Status));
                ((Button) LastControl).GumpOverID = 0x07ed;

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

                // Paperdoll
                AddControl(new PaperDollInteractable(this, 8, 21)
                {
                    SourceEntity = Parent
                });
            }
        }
 public CreateCharacterState()
     : base()
 {
     m_UserInterface = ServiceRegistry.GetService <UserInterfaceService>();
     m_Login         = ServiceRegistry.GetService <LoginModel>();
 }
Example #35
0
        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)));
        }
Example #36
0
        protected override void Initialize()
        {
            Content.RootDirectory = "Content";

            // register this instance as a service
            ServiceRegistry.Register<UltimaGame>(this);

            // Create all the services we need.
            ServiceRegistry.Register<SpriteBatch3D>(new SpriteBatch3D(this));
            ServiceRegistry.Register<SpriteBatchUI>(new SpriteBatchUI(this));
            ServiceRegistry.Register<AudioService>(new AudioService());
            Network = ServiceRegistry.Register<INetworkClient>(new NetworkClient());
            Input = ServiceRegistry.Register<InputManager>(new InputManager(Window.Handle));
            UserInterface = ServiceRegistry.Register<UserInterfaceService>(new UserInterfaceService());
            Plugins = new PluginManager(AppDomain.CurrentDomain.BaseDirectory);

            // Make sure we have a UO installation before loading IO.
            if (FileManager.IsUODataPresent)
            {
                // Initialize and load data
                IResourceProvider provider = new ResourceProvider(this);
                provider.RegisterResource<EffectData>(new EffectDataResource());
                ServiceRegistry.Register<IResourceProvider>(provider);

                HueData.Initialize(GraphicsDevice);
                SkillsData.Initialize();
                GraphicsDevice.Textures[1] = HueData.HueTexture0;
                GraphicsDevice.Textures[2] = HueData.HueTexture1;

                IsRunning = true;
                WorldModel.IsInWorld = false;

                ActiveModel = new LoginModel();
            }
            else
            {
                Tracer.Critical("Did not find a compatible UO Installation. UltimaXNA is compatible with any version of UO through Mondian's Legacy.");
            }
        }
Example #37
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);

            // 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);
        }
Example #38
0
 public virtual void Dispose()
 {
     m_UserInterface = null;
 }
Example #39
0
        /// <summary>
        /// Creates the user interface service.
        /// </summary>
        /// <param name="container">The IOC container that contains all the references.</param>
        /// <param name="diagnostics">The object that provides the diagnostics methods for the application.</param>
        /// <returns>
        /// The newly created user interface service.
        /// </returns>
        private KernelService CreateUserInterfaceService(IContainer container, SystemDiagnostics diagnostics)
        {
            var userInterface = new UserInterfaceService(container, StartUserInterface, diagnostics);

            return(userInterface);
        }
Example #40
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);

            // 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);
        }
Example #41
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);
        }
Example #42
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 = Service.Get <UserInterfaceService>();
            m_World         = Service.Get <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 settings 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 settings 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 settings 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 options 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 options 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 settings affect the reputation system, which is Ultima Online's system for controlling antisocial behavior."), 7);

            AddControl(new TextLabelAscii(this, 85, 100, 9, 1, @"Query before performing criminal actions"), 7);
            m_CrimeQuery = AddControl <CheckBox>(new CheckBox(this, 60, 100, 210, 211, Settings.UserInterface.CrimeQuery, 61), 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);
        }
 public CreateCharacterState()
     : base()
 {
     m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
     m_Login = ServiceRegistry.GetService<LoginModel>();
 }
Example #44
0
 public StateManager()
 {
     m_UserInterface = ServiceRegistry.GetService <UserInterfaceService>();
     m_Login         = ServiceRegistry.GetService <LoginModel>();
 }
Example #45
0
 public virtual void Intitialize()
 {
     m_UserInterface = UltimaServices.GetService <UserInterfaceService>();
 }
Example #46
0
 public WorldInteraction(WorldModel world)
 {
     _network       = Service.Get <INetworkClient>();
     _userInterface = Service.Get <UserInterfaceService>();
     _world         = world;
 }
Example #47
0
 public StateManager()
 {
     m_UserInterface = UltimaServices.GetService <UserInterfaceService>();
     m_Login         = UltimaServices.GetService <LoginModel>();
 }
Example #48
0
 public StateManager()
 {
     m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
     m_Login = ServiceRegistry.GetService<LoginModel>();
 }
Example #49
0
 public UltimaCursor()
 {
     m_UserInterface = ServiceRegistry.GetService<UserInterfaceService>();
 }