コード例 #1
0
        private bool CheckShowNextOpenSysTipIfLock(UIPlayerBar.BtnDestination btnDest)
        {
            int cfgID = LockSysHash.getConfigByBtnDestination(btnDest);

            if (cfgID != 0 && !LockSysHash.CanUnlock(cfgID))
            { // 未解锁
                UINextOpenTips.Show(cfgID);
                return(true);
            }
            return(false);
        }
コード例 #2
0
        public void OnClickButton(UIPlayerBar.BtnDestination btnDest)
        {
            if (KHVer.IsOfflineMatch)
            {
                if (btnDest != UIPlayerBar.BtnDestination.Match && btnDest != UIPlayerBar.BtnDestination.PVPRealTime)
                {
                    UIAPI.ShowMsgTip("赛事版本,该功能暂不开放");
                    return;
                }
            }
            UIEntryElement ele = null;

            mainPageEntrys.TryGetValue(btnDest, out ele);
            if (ele == null)
            {
                Debuger.Log("OnClickButton, btn:" + btnDest + ", not binding logic UIEntryElement");
                return;
            }
            // 新手引导通知
            if (btnDest != UIPlayerBar.BtnDestination.None)
            {
                KHUIManager.getInstance().dispatchClickToGuideEvent(ele.gameObject.tag);
            }
            // 如果未开启,则显示系统开启提示
            if (CheckShowNextOpenSysTipIfLock(btnDest))
            {
                return;
            }

            if (DefineExt.shieldSystemLst.Contains((uint)LockSysHash.StateBit_2_Excel[LockSysHash.BtnDestination_2_StateBit[btnDest]]))
            {
                UIAPI.ShowMsgTip("客户端不是最新版本,无法参加当前玩法,请更新版本后尝试");
                return;
            }
            if (KHLowDeviceManager.GetLowDeviceShield((uint)LockSysHash.StateBit_2_Excel[LockSysHash.BtnDestination_2_StateBit[btnDest]]))
            {
                return;
            }

            if (false && !playerEntity.GetOpenInfo(LockSysHash.BtnDestination_2_StateBit[btnDest]))
            {
                int configId             = LockSysHash.getConfigByBtnDestination(btnDest);
                FeatureUnlockConfig conf = null;
                GeneralTableConfig.getInstance().FeatureDefine.TryGetValue(configId, out conf);
                if (conf != null)
                {
                    UIAPI.ShowMsgTip(conf.tip);
                }
                else
                {
                    Debuger.LogWarning("未找到对应的解锁配置, Id = " + configId);
                }
            }
            switch (btnDest)
            {
            case UIPlayerBar.BtnDestination.None:
                break;

            case UIPlayerBar.BtnDestination.FullFood:
                KHPluginManager.Instance.SendMessage(FullFoodPlugin.NAME, "ShowView", new ShowViewArgument(UIDef.FULL_FOOD_MAIN_PANEL_VIEW));
                break;

            case UIPlayerBar.BtnDestination.CityShop:
                KHPluginManager.Instance.SendMessage("Shop", "ShowView", new ShowViewArgument(UIDef.SHOP_UI, true, 1u));
                break;

            case UIPlayerBar.BtnDestination.EliteLevel:

                KHPluginManager.Instance.SendMessage(LevelSelectPlugin.pluginName, "ShowView", new ShowViewArgument(UIDef.LEVEL_SELECT_CHAPTER, needBg: false, data: UILevelSelectMainView.LevelSelectMainViewTabEnum.Elite));
                break;

            case UIPlayerBar.BtnDestination.Talent:
                KHPluginManager.Instance.SendMessage("NewTalentPlugin", "OpenSystem");
                break;

            case UIPlayerBar.BtnDestination.MissonMode:
                UIAPI.ShowMsgTip("功能尚未开放");
                break;

            case UIPlayerBar.BtnDestination.SurvivalChallenge:
                //KHPluginManager.Instance.SendMessage(SurvivalChallPlugin.pluginName, SurvivalChallOperation.OperRequestEnter);
                KHPluginManager.Instance.SendMessage("Mirage", "ShowView",
                                                     new ShowViewArgument(UIDef.MIRAGE_PRACTICE_VIEW));
                break;

            case UIPlayerBar.BtnDestination.MirageMode:
                KHPluginManager.Instance.SendMessage("Mirage", "Mirage.GetMirageData");
                break;

            case UIPlayerBar.BtnDestination.NewPVPMode:
                KHPluginManager.Instance.SendMessage(PvPUIPlugin2.PluginName, "OpenSystem");
                break;

            case UIPlayerBar.BtnDestination.PVPRealTime:
                //KHPluginManager.Instance.SendMessage("ArenaPlugin", "OpenHomeView");
                KHUtil.GoToPvpMainView(null, true, true);
                break;

            case UIPlayerBar.BtnDestination.TeamPVE:
                KHPluginManager.Instance.SendMessage("TeamPVEUI", "ShowView", new ShowViewArgument(UIDef.TEAMPVE_MAIN_VIEW));
                break;

            case UIPlayerBar.BtnDestination.Guild:
                KHPluginManager.Instance.SendMessage(GuildPlugin.pluginName, GuildOperation.ClickGuild, false);

                //KHPluginManager.Instance.GetPluginByName("DramaPlugin").ShowView("UILua/Drama/DramaView", false);

                break;

            case UIPlayerBar.BtnDestination.RankingView:
                KHPluginManager.Instance.SendMessage(RankListPlugin.NAME, "ShowView", new ShowViewArgument(UIDef.RANK_LIST_VIEW));
                break;

            case UIPlayerBar.BtnDestination.NinjaTask:
                KHPluginManager.Instance.SendMessage(NinjaTaskPlugin.pluginName, NinjaTaskOperation.OpenNinjaTask);
                break;

            case UIPlayerBar.BtnDestination.TeamGroup:
                //KHPluginManager.Instance.SendMessage(GroupPlugin.pluginName, GroupOperation.ClickGroup);
                KHPluginManager.Instance.SendMessage("MysticalDuplicatePlugin", "OnOpen");
                break;

            case UIPlayerBar.BtnDestination.Match:
                if (KHVer.IsOfflineMatch)
                {
                    KHUtilForLua.SendMessageForLuaSystem("OfflineMatchPlugin", "OpenFirstView", null);
                }
                else
                {
                    LuaSystemPlugin sysPlugin = KHPluginManager.Instance.GetPluginByName("MatchMainEntrancePlugin") as LuaSystemPlugin;
                    sysPlugin.CallLuaFunctionToOperation("kihan.match.MatchMainEntranceOperation", "OpenSystem", null);
                }
                break;

            case UIPlayerBar.BtnDestination.KizunaContest:
                //KHPluginManager.Instance.SendMessage("KizunaContestEntrancePlugin", "TryEnter");
                break;

            case UIPlayerBar.BtnDestination.GuildHegemony:
                KHPluginManager.Instance.SendMessage("GuildHegemonyPlugin", "Query");
                break;

            case UIPlayerBar.BtnDestination.ZoneFightMatch:
                KHPluginManager.Instance.SendMessage(ZoneFightMatchPlugin.pluginName, ZoneFightMatchOperation.OpenEntranceView);
                break;

            case UIPlayerBar.BtnDestination.Main_NinjaFight:
                //KHPluginManager.Instance.SendMessage("MysticalDuplicatePlugin", "OnOpen");
                KHPluginManager.Instance.SendMessage(TeamPlugin.pluginName, TeamOperation.EnterTeamScene);
                break;

            case UIPlayerBar.BtnDestination.Drama:
                KHUIManager.Instance.ShowFlyNext(true, () => {
                    KHPluginManager.Instance.SendMessage("MainUI", "HideView", "MainUI");
                    KHPluginManager.Instance.SendMessage("MainUI", "HideView", "PlayerBarUI");
                    KHPluginManager.Instance.GetPluginByName("DramaPlugin").ShowView("UILua/Drama/DramaView", false);
                });
                break;

            default:
                break;
            }
        }