示例#1
0
        public override void OnButtonClick(int buttonID)
        {
            switch ((Buttons)buttonID)
            {
            case Buttons.Map:
                MiniMapGump miniMapGump = UIManager.GetGump <MiniMapGump>();

                if (miniMapGump == null)
                {
                    UIManager.Add(new MiniMapGump());
                }
                else
                {
                    miniMapGump.SetInScreen();
                    miniMapGump.BringOnTop();
                }

                break;

            case Buttons.Paperdoll:
                PaperDollGump paperdollGump = UIManager.GetGump <PaperDollGump>(World.Player);

                if (paperdollGump == null)
                {
                    GameActions.OpenPaperdoll(World.Player);
                }
                else
                {
                    paperdollGump.SetInScreen();
                    paperdollGump.BringOnTop();
                }

                break;

            case Buttons.Inventory:
                Item backpack = World.Player.FindItemByLayer(Layer.Backpack);
                if (backpack == null)
                {
                    return;
                }

                ContainerGump backpackGump = UIManager.GetGump <ContainerGump>(backpack);

                if (backpackGump == null)
                {
                    GameActions.DoubleClick(backpack);
                }
                else
                {
                    backpackGump.SetInScreen();
                    backpackGump.BringOnTop();
                }

                break;

            case Buttons.Journal:
                JournalGump journalGump = UIManager.GetGump <JournalGump>();

                if (journalGump == null)
                {
                    UIManager.Add(new JournalGump
                    {
                        X = 64, Y = 64
                    });
                }
                else
                {
                    journalGump.SetInScreen();
                    journalGump.BringOnTop();
                }

                break;

            case Buttons.Chat:
                if (UOChatManager.ChatIsEnabled == CHAT_STATUS.ENABLED)
                {
                    UOChatGump chatGump = UIManager.GetGump <UOChatGump>();

                    if (chatGump == null)
                    {
                        UIManager.Add(new UOChatGump());
                    }
                    else
                    {
                        chatGump.SetInScreen();
                        chatGump.BringOnTop();
                    }
                }
                else if (UOChatManager.ChatIsEnabled == CHAT_STATUS.ENABLED_USER_REQUEST)
                {
                    UOChatGumpChooseName chatGump = UIManager.GetGump <UOChatGumpChooseName>();

                    if (chatGump == null)
                    {
                        UIManager.Add(new UOChatGumpChooseName());
                    }
                    else
                    {
                        chatGump.SetInScreen();
                        chatGump.BringOnTop();
                    }
                }

                break;

            case Buttons.GlobalChat:
                Log.Warn("Chat button pushed! Not implemented yet!");
                GameActions.Print("GlobalChat not implemented yet.", 0x23, MessageType.System);
                break;

            case Buttons.UOStore:
                if (Client.Version >= ClientVersion.CV_706400)
                {
                    NetClient.Socket.Send(new POpenUOStore());
                }
                break;

            case Buttons.Help:
                GameActions.RequestHelp();

                break;

            case Buttons.Debug:

                DebugGump debugGump = UIManager.GetGump <DebugGump>();

                if (debugGump == null)
                {
                    debugGump = new DebugGump(100, 100);
                    UIManager.Add(debugGump);
                }
                else
                {
                    debugGump.IsVisible = !debugGump.IsVisible;
                    debugGump.SetInScreen();
                }

                break;

            case Buttons.NetStats:
                NetworkStatsGump netstatsgump = UIManager.GetGump <NetworkStatsGump>();

                if (netstatsgump == null)
                {
                    netstatsgump = new NetworkStatsGump(100, 100);
                    UIManager.Add(netstatsgump);
                }
                else
                {
                    netstatsgump.IsVisible = !netstatsgump.IsVisible;
                    netstatsgump.SetInScreen();
                }

                break;

            case Buttons.WorldMap:

                WorldMapGump worldMap = UIManager.GetGump <WorldMapGump>();

                if (worldMap == null || worldMap.IsDisposed)
                {
                    worldMap = new WorldMapGump();
                    UIManager.Add(worldMap);
                }
                else
                {
                    worldMap.BringOnTop();
                    worldMap.SetInScreen();
                }
                break;
            }
        }
示例#2
0
        public override void OnButtonClick(int buttonID)
        {
            switch ((Buttons)buttonID)
            {
            case Buttons.Map:

                MiniMapGump miniMapGump = Engine.UI.GetControl <MiniMapGump>();

                if (miniMapGump == null)
                {
                    Engine.UI.Add(new MiniMapGump());
                }
                else
                {
                    miniMapGump.SetInScreen();
                    miniMapGump.BringOnTop();
                }

                break;

            case Buttons.Paperdoll:
                PaperDollGump paperdollGump = Engine.UI.GetControl <PaperDollGump>(World.Player);

                if (paperdollGump == null)
                {
                    GameActions.OpenPaperdoll(World.Player);
                }
                else
                {
                    paperdollGump.SetInScreen();
                    paperdollGump.BringOnTop();
                }

                break;

            case Buttons.Inventory:
                Item backpack = World.Player.Equipment[(int)Layer.Backpack];

                ContainerGump backpackGump = Engine.UI.GetControl <ContainerGump>(backpack);

                if (backpackGump == null)
                {
                    GameActions.DoubleClick(backpack);
                }
                else
                {
                    backpackGump.SetInScreen();
                    backpackGump.BringOnTop();
                }

                break;

            case Buttons.Journal:
                JournalGump journalGump = Engine.UI.GetControl <JournalGump>();

                if (journalGump == null)
                {
                    Engine.UI.Add(new JournalGump
                    {
                        X = 64, Y = 64
                    });
                }
                else
                {
                    journalGump.SetInScreen();
                    journalGump.BringOnTop();
                }

                break;

            case Buttons.Chat:
                Log.Message(LogTypes.Warning, "Chat button pushed! Not implemented yet!");

                break;

            case Buttons.Help:
                GameActions.RequestHelp();

                break;

            case Buttons.Debug:

                DebugGump debugGump = Engine.UI.GetControl <DebugGump>();

                if (debugGump == null)
                {
                    debugGump = new DebugGump
                    {
                        X = Engine.Profile.Current.DebugGumpPosition.X,
                        Y = Engine.Profile.Current.DebugGumpPosition.Y
                    };

                    Engine.UI.Add(debugGump);
                }
                else
                {
                    debugGump.IsVisible = !debugGump.IsVisible;
                    debugGump.SetInScreen();
                }

                Engine.DropFpsMinMaxValues();

                break;
            }
        }
示例#3
0
        public override void OnButtonClick(int buttonID)
        {
            switch ((Buttons)buttonID)
            {
            case Buttons.Map:
                MiniMapGump miniMapGump = UIManager.GetGump <MiniMapGump>();

                if (miniMapGump == null)
                {
                    UIManager.Add(new MiniMapGump());
                }
                else
                {
                    miniMapGump.SetInScreen();
                    miniMapGump.BringOnTop();
                }

                break;

            case Buttons.Paperdoll:
                PaperDollGump paperdollGump = UIManager.GetGump <PaperDollGump>(World.Player);

                if (paperdollGump == null)
                {
                    GameActions.OpenPaperdoll(World.Player);
                }
                else
                {
                    paperdollGump.SetInScreen();
                    paperdollGump.BringOnTop();
                }

                break;

            case Buttons.Inventory:
                Item backpack = World.Player.Equipment[(int)Layer.Backpack];

                ContainerGump backpackGump = UIManager.GetGump <ContainerGump>(backpack);

                if (backpackGump == null)
                {
                    GameActions.DoubleClick(backpack);
                }
                else
                {
                    backpackGump.SetInScreen();
                    backpackGump.BringOnTop();
                }

                break;

            case Buttons.Journal:
                JournalGump journalGump = UIManager.GetGump <JournalGump>();

                if (journalGump == null)
                {
                    UIManager.Add(new JournalGump
                    {
                        X = 64, Y = 64
                    });
                }
                else
                {
                    journalGump.SetInScreen();
                    journalGump.BringOnTop();
                }

                break;

            case Buttons.Chat:
                if (UOChatManager.ChatIsEnabled)
                {
                    UOChatGump chatGump = UIManager.GetGump <UOChatGump>();

                    if (chatGump == null)
                    {
                        UIManager.Add(new UOChatGump());
                    }
                    else
                    {
                        chatGump.SetInScreen();
                        chatGump.BringOnTop();
                    }
                }
                break;

            case Buttons.GlobalChat:
                Log.Warn("Chat button pushed! Not implemented yet!");
                GameActions.Print("GlobalChat not implemented yet.", 0x23, MessageType.System);
                break;

            case Buttons.UOStore:
                if (Client.Version >= ClientVersion.CV_706400)
                {
                    NetClient.Socket.Send(new POpenUOStore());
                }
                break;

            case Buttons.Help:
                GameActions.RequestHelp();

                break;

            case Buttons.Debug:

                DebugGump debugGump = UIManager.GetGump <DebugGump>();

                if (debugGump == null)
                {
                    debugGump = new DebugGump
                    {
                        X = ProfileManager.Current.DebugGumpPosition.X,
                        Y = ProfileManager.Current.DebugGumpPosition.Y
                    };

                    UIManager.Add(debugGump);
                }
                else
                {
                    debugGump.IsVisible = !debugGump.IsVisible;
                    debugGump.SetInScreen();
                }

                //Engine.DropFpsMinMaxValues();

                break;

            case Buttons.WorldMap:

                WorldMapGump worldMap = UIManager.GetGump <WorldMapGump>();

                if (worldMap == null || worldMap.IsDisposed)
                {
                    worldMap = new WorldMapGump();
                    UIManager.Add(worldMap);
                }
                else
                {
                    worldMap.BringOnTop();
                    worldMap.SetInScreen();
                }
                break;
            }
        }
示例#4
0
        public override void OnButtonClick(int buttonID)
        {
            switch ((Buttons)buttonID)
            {
            case Buttons.Map:

                MiniMapGump miniMapGump = Engine.UI.GetByLocalSerial <MiniMapGump>();
                if (miniMapGump == null)
                {
                    Engine.UI.Add(new MiniMapGump());
                }
                else
                {
                    miniMapGump.BringOnTop();
                }

                break;

            case Buttons.Paperdoll:
                PaperDollGump paperdollGump = Engine.UI.GetByLocalSerial <PaperDollGump>(World.Player);
                if (paperdollGump == null)
                {
                    GameActions.OpenPaperdoll(World.Player);
                }
                else
                {
                    paperdollGump.BringOnTop();
                }

                break;

            case Buttons.Inventory:
                Item backpack = World.Player.Equipment[(int)Layer.Backpack];

                ContainerGump backpackGump = Engine.UI.GetByLocalSerial <ContainerGump>(backpack);

                if (backpackGump == null)
                {
                    GameActions.DoubleClick(backpack);
                }
                else
                {
                    backpackGump.BringOnTop();
                }

                break;

            case Buttons.Journal:
                JournalGump journalGump = Engine.UI.GetByLocalSerial <JournalGump>();

                if (journalGump == null)
                {
                    Engine.UI.Add(new JournalGump()
                    {
                        X = 64, Y = 64
                    });
                }
                else
                {
                    journalGump.BringOnTop();
                }

                break;

            case Buttons.Chat:
                Log.Message(LogTypes.Warning, "Chat button pushed! Not implemented yet!");

                break;

            case Buttons.Help:
                GameActions.RequestHelp();

                break;

            case Buttons.Debug:

                DebugGump debugGump = Engine.UI.GetByLocalSerial <DebugGump>();

                if (debugGump == null)
                {
                    // dont consider this case
                }
                else
                {
                    debugGump.IsVisible = !debugGump.IsVisible;
                }

                break;
            }
        }