예제 #1
0
파일: GuiManager.cs 프로젝트: wt616/JxqyHD
        public static void Starting()
        {
            IsShow = true;

            _dropSound     = Utils.GetSoundEffect("界-拖放.wav");
            _interfaceShow = Utils.GetSoundEffect("界-弹出菜单.wav");
            _interfaceMiss = Utils.GetSoundEffect("界-缩回菜单.wav");

            TitleInterface = new TitleGui();
            _allGuiItems.AddLast(TitleInterface);

            SaveLoadInterface = new SaveLoadGui();
            _allGuiItems.AddLast(SaveLoadInterface);

            SystemInterface = new SystemGui();
            _allGuiItems.AddLast(SystemInterface);
            _panels.AddLast(SystemInterface);

            TopInterface = new TopGui();
            _allGuiItems.AddLast(TopInterface);

            BottomInterface = new BottomGui();
            _allGuiItems.AddLast(BottomInterface);

            ColumnInterface = new ColumnGui();
            _allGuiItems.AddLast(ColumnInterface);

            MagicInterface = new MagicGui();
            _allGuiItems.AddLast(MagicInterface);
            _panels.AddLast(MagicInterface);

            XiuLianInterface = new XiuLianGui();
            _allGuiItems.AddLast(XiuLianInterface);
            _panels.AddLast(XiuLianInterface);

            GoodsInterface = new GoodsGui();
            _allGuiItems.AddLast(GoodsInterface);
            _panels.AddLast(GoodsInterface);

            BuyInterface = new BuyGui();
            _allGuiItems.AddLast(BuyInterface);
            _panels.AddLast(BuyInterface);

            TimerInterface = new TimerGui();
            _allGuiItems.AddLast(TimerInterface);

            LittleMapInterface = new LittleMapGui();
            _allGuiItems.AddLast(LittleMapInterface);

            MemoInterface = new MemoGui();
            _allGuiItems.AddLast(MemoInterface);
            _panels.AddLast(MemoInterface);

            StateInterface = new StateGui();
            _allGuiItems.AddLast(StateInterface);
            _panels.AddLast(StateInterface);

            EquipInterface = new EquipGui();
            _allGuiItems.AddLast(EquipInterface);
            _panels.AddLast(EquipInterface);

            ToolTipInterface = new ToolTipGui();
            _allGuiItems.AddLast(ToolTipInterface);
            _panels.AddLast(ToolTipInterface);

            MouseInterface = new MouseGui();

            MessageInterface = new MessageGui();
            _allGuiItems.AddLast(MessageInterface);
            _panels.AddLast(MessageInterface);

            DialogInterface = new DialogGui();
            _allGuiItems.AddLast(DialogInterface);

            LittleHeadInterface = new LittleHeadGui();
            _allGuiItems.AddLast(LittleHeadInterface);

            SelectionInterface = new SelectionGui();
            _allGuiItems.AddLast(SelectionInterface);

            MagicListManager.RenewList();
            GoodsListManager.RenewList();
        }
예제 #2
0
        private void RegisterEventHandler()
        {
            int index, sourceIndex;

            _head.Drop += (arg1, arg2) =>
            {
                if (CanDrop(arg2, Good.EquipPosition.Head))
                {
                    if (GoodsGui.ExchangeItem(arg1, arg2, out index, out sourceIndex))
                    {
                    }
                }
            };
            _neck.Drop += (arg1, arg2) =>
            {
                if (CanDrop(arg2, Good.EquipPosition.Neck))
                {
                    if (GoodsGui.ExchangeItem(arg1, arg2, out index, out sourceIndex))
                    {
                    }
                }
            };
            _body.Drop += (arg1, arg2) =>
            {
                if (CanDrop(arg2, Good.EquipPosition.Body))
                {
                    if (GoodsGui.ExchangeItem(arg1, arg2, out index, out sourceIndex))
                    {
                    }
                }
            };
            _back.Drop += (arg1, arg2) =>
            {
                if (CanDrop(arg2, Good.EquipPosition.Back))
                {
                    if (GoodsGui.ExchangeItem(arg1, arg2, out index, out sourceIndex))
                    {
                    }
                }
            };
            _hand.Drop += (arg1, arg2) =>
            {
                if (CanDrop(arg2, Good.EquipPosition.Hand))
                {
                    if (GoodsGui.ExchangeItem(arg1, arg2, out index, out sourceIndex))
                    {
                    }
                }
            };
            _wrist.Drop += (arg1, arg2) =>
            {
                if (CanDrop(arg2, Good.EquipPosition.Wrist))
                {
                    if (GoodsGui.ExchangeItem(arg1, arg2, out index, out sourceIndex))
                    {
                    }
                }
            };
            _foot.Drop += (arg1, arg2) =>
            {
                if (CanDrop(arg2, Good.EquipPosition.Foot))
                {
                    if (GoodsGui.ExchangeItem(arg1, arg2, out index, out sourceIndex))
                    {
                    }
                }
            };

            foreach (var item in _items)
            {
                item.RightClick += (arg1, arg2) =>
                {
                    var theItem = (DragDropItem)arg1;
                    var data    = theItem.Data as GoodsGui.GoodItemData;
                    if (data != null)
                    {
                        int newIndex;
                        if (GoodsListManager.PlayerUnEquiping(data.Index, out newIndex))
                        {
                            theItem.BaseTexture = null;
                            theItem.TopLeftText = "";
                            GuiManager.UpdateGoodItemView(newIndex);
                        }
                    }
                };
                item.MouseStayOver += GoodsGui.MouseStayOverHandler;
                item.MouseLeave    += GoodsGui.MouseLeaveHandler;
            }
        }
예제 #3
0
        public static void Starting()
        {
            Setttings = new FileIniDataParser().ReadFile(@"Content\ui\UI_Settings.ini", Globals.LocalEncoding);

            GoodsListManager.InitIndex(Setttings);
            MagicListManager.InitIndex(Setttings);

            IsShow = true;

            _dropSound     = Utils.GetSoundEffect("界-拖放.wav");
            _interfaceShow = Utils.GetSoundEffect("界-弹出菜单.wav");
            _interfaceMiss = Utils.GetSoundEffect("界-缩回菜单.wav");

            TitleInterface = new TitleGui();
            _allGuiItems.AddLast(TitleInterface);

            SaveLoadInterface = new SaveLoadGui();
            _allGuiItems.AddLast(SaveLoadInterface);

            SystemInterface = new SystemGui();
            _allGuiItems.AddLast(SystemInterface);
            _panels.AddLast(SystemInterface);

            TopInterface = new TopGui();
            _allGuiItems.AddLast(TopInterface);

            BottomInterface = new BottomGui();
            _allGuiItems.AddLast(BottomInterface);

            ColumnInterface = new ColumnGui();
            _allGuiItems.AddLast(ColumnInterface);

            MagicInterface = new MagicGui();
            _allGuiItems.AddLast(MagicInterface);
            _panels.AddLast(MagicInterface);

            XiuLianInterface = new XiuLianGui();
            _allGuiItems.AddLast(XiuLianInterface);
            _panels.AddLast(XiuLianInterface);

            GoodsInterface = new GoodsGui();
            _allGuiItems.AddLast(GoodsInterface);
            _panels.AddLast(GoodsInterface);

            BuyInterface = new BuyGui();
            _allGuiItems.AddLast(BuyInterface);
            _panels.AddLast(BuyInterface);

            TimerInterface = new TimerGui();
            _allGuiItems.AddLast(TimerInterface);

            LittleMapInterface = new LittleMapGui();
            _allGuiItems.AddLast(LittleMapInterface);

            MemoInterface = new MemoGui();
            _allGuiItems.AddLast(MemoInterface);
            _panels.AddLast(MemoInterface);

            StateInterface = new StateGui();
            _allGuiItems.AddLast(StateInterface);
            _panels.AddLast(StateInterface);

            EquipInterface = new EquipGui();
            _allGuiItems.AddLast(EquipInterface);
            _panels.AddLast(EquipInterface);

            var toolTipUseType = int.Parse(Setttings.Sections["ToolTip_Use_Type"]["UseType"]);

            if (toolTipUseType == 1)
            {
                ToolTipInterface = new ToolTipGuiType1();
            }
            else
            {
                ToolTipInterface = new ToolTipGuiType2();
            }
            _allGuiItems.AddLast(ToolTipInterface);
            _panels.AddLast(ToolTipInterface);

            MouseInterface = new MouseGui();

            MessageInterface = new MessageGui();
            _allGuiItems.AddLast(MessageInterface);
            _panels.AddLast(MessageInterface);

            DialogInterface = new DialogGui();
            _allGuiItems.AddLast(DialogInterface);

            LittleHeadInterface = new LittleHeadGui();
            _allGuiItems.AddLast(LittleHeadInterface);

            SelectionInterface = new SelectionGui();
            _allGuiItems.AddLast(SelectionInterface);

            MagicListManager.RenewList();
            GoodsListManager.RenewList();
        }