Beispiel #1
0
    public void InitializeComponent()
    {
        for (int i = 0; i < Items.Count; i++)
        {
            Items[i].e_OnClick        += ItemOnClick;
            Items[i].e_OnMouseMoveIn  += ItemOnMouseMoveIn;
            Items[i].e_OnMouseMoveOut += ItemOnMouseMoveOut;
        }

        for (int i = 0; i < panels.Count; i++)
        {
            if (panels[i].gameObject.name == "root")
            {
                rootPanel = panels[i];
            }
            panels[i].Hide();
        }
        if (rootPanel != null)
        {
            rootPanel.Show();
        }
    }
Beispiel #2
0
    // event
    void ItemOnMouseMoveIn(object sender)
    {
        UIMenuListItem item = sender as UIMenuListItem;

        if (item != null)
        {
            //lz-2016.05.30 Diplomacy菜单是在游戏里面过了344剧情才开的,所有这里根据条件动态的添加和移除
            if (item.mMenuItemFlag == UIGameMenuCtrl.MenuItemFlag.Flag_Phone)
            {
                UIMenuListItem diplomacyItem = Items.Find(a => a.mMenuItemFlag == UIGameMenuCtrl.MenuItemFlag.Flag_Diplomacy);
                //lz-2016.10.10 错误 #4221 历险模式中右下角菜单中没有外交选项
                if (PeGameMgr.IsAdventure || ReputationSystem.Instance.GetActiveState((int)PeCreature.Instance.mainPlayer.GetAttribute(AttribType.DefaultPlayerID)))
                {
                    if (null == diplomacyItem)
                    {
                        this.AddItem(item, NewUIText.mMenuDiplomacy.GetString(), UIGameMenuCtrl.MenuItemFlag.Flag_Diplomacy, "listico_22_1");
                    }
                }
                else
                {
                    if (diplomacyItem != null)
                    {
                        this.DeleteItem(diplomacyItem);
                    }
                }

                //lz-2016.07.25 检测怪物图鉴
                UIMenuListItem speciesWikiItem = Items.Find(a => a.mMenuItemFlag == UIGameMenuCtrl.MenuItemFlag.Flag_SpeciesWiki);

                //lz-2016.10.18 Adventure默认开启,Story检测开启
                if (PeGameMgr.IsAdventure || (PeGameMgr.IsStory && null != StroyManager.Instance && StroyManager.Instance.enableBook))
                {
                    if (null == speciesWikiItem)
                    {
                        this.AddItem(item, NewUIText.mMenuSpeciesWiki.GetString(), UIGameMenuCtrl.MenuItemFlag.Flag_SpeciesWiki, "listico_24_1");
                    }
                }
                else
                {
                    if (speciesWikiItem != null)
                    {
                        this.DeleteItem(speciesWikiItem);
                    }
                }

                //lz-2016.07.25 检测开启播放器
                UIMenuListItem radioItem = Items.Find(a => a.mMenuItemFlag == UIGameMenuCtrl.MenuItemFlag.Flag_Radio);
                if (null != GameUI.Instance)
                {
                    if (!GameUI.Instance.mPhoneWnd.InitRadio)
                    {
                        GameUI.Instance.mPhoneWnd.InitRadioData();
                    }
                    if (GameUI.Instance.mPhoneWnd.CheckOpenRadio())
                    {
                        if (null == radioItem)
                        {
                            this.AddItem(item, NewUIText.mMenuRadio.GetString(), UIGameMenuCtrl.MenuItemFlag.Flag_Radio, "listico_25_1");
                        }
                    }
                    else
                    {
                        if (radioItem != null)
                        {
                            this.DeleteItem(radioItem);
                        }
                    }
                }
            }

            item.ItemSelectedBg.enabled = true;
            //lz-2016.09.12 播放进入菜单音效
            AudioManager.instance.Create(Vector3.zero, MouseMoveInAudioID);

            if (item != mMouseMoveInItem)
            {
                Hide_BotherPanels(item);
                if (item.IsHaveChild)
                {
                    UIMenuPanel panel = FindMenuPanel(item);
                    if (panel != null)
                    {
                        panel.Show();
                    }
                }
            }
        }
        mMouseMoveInItem = item;
        e_ItemOnMouseMoveIn.Send(eventReceiver, sender);
    }