Ejemplo n.º 1
0
    private void UpdateHideState()
    {
        if (mCurStep < 0 || mCurStep >= mSteps.Count)
        {
            return;
        }
        GuideStepTableItem node   = mSteps[mCurStep];
        UIWindow           window = WindowManager.Instance.GetUI(node.window);

        if (window == null)
        {
            return;
        }
        if ((int)CTRL_FIND_TYPE.FIND_TYPE_QUEST_SELECT_ID == node.param1)
        {
            UIQuestForm quest = (UIQuestForm)window;

            mHide = (quest.GetCurrentID() != node.param2);
        }
        else if ((int)CTRL_FIND_TYPE.FIND_TYPE_STAGE_SELECT_ID == node.param1)
        {
            UIStageList stage = (UIStageList)window;

            mHide = (stage.GetCurrentID() != node.param2);
        }
        else
        {
            mHide = false;
        }
    }
Ejemplo n.º 2
0
    //打开翻牌界面
    public void OnOpenUI(string uiName)
    {
        if (!DataManager.UITable.ContainsKey(uiName))
        {
            GameDebug.Log("OnOpenUI 没有找到UI :" + uiName);
            return;
        }
        int condtion = -1;

        if (uiName == "quest")
        {
            UIQuestForm quest = WindowManager.Instance.GetUI(uiName) as UIQuestForm;
            condtion = quest.GetCurrentID();
        }
        else if (uiName == "stagelist")
        {
            UIStageList stagelist = WindowManager.Instance.GetUI(uiName) as UIStageList;
            condtion = stagelist.GetCurrentID();
        }

        //else if (uiName == "mainmap")
        //{
        //     WorldMapModule mWorldMapModule = ModuleManager.Instance.FindModule<WorldMapModule>();
        //     if (mWorldMapModule!= null)
        //         condtion = mWorldMapModule.GuideResId;
        //}
        UITableItem item = DataManager.UITable[uiName] as UITableItem;

        if (!mGuides.ContainsKey(GUIDE_TYPE.GUIDE_OPEN_UI))
        {
            return;
        }
        List <GuideTableItem> childs = mGuides[GUIDE_TYPE.GUIDE_OPEN_UI];

        for (int i = 0; i < childs.Count; ++i)
        {
            if (childs[i].param == item.resID)
            {
                if (CheckAndBeginGuide(childs[i], condtion))
                {
                    LogOut("打开界面 name = " + uiName + " 触发引导ID= " + childs[i].id.ToString());
                    return;
                }
            }
        }
    }
Ejemplo n.º 3
0
    private GameObject FindControl(GuideStepTableItem node)
    {
        GameObject obj = null;
        //如果填表错误 一直找不到对象  需要处理
        UIWindow window = WindowManager.Instance.GetUI(node.window);

        if (window == null)
        {
            return(null);
        }

        mDepth = window.GetDepth() /*+ 1*/;

        if (node.param1 >= 0)
        {
            switch (node.param1)
            {
            case (int)CTRL_FIND_TYPE.FIND_TYPE_BAG_ITEM:
            {
                if (window is UIBagForm)
                {
                    UIBagForm bag = (UIBagForm)window;

                    return(bag.FindBagItem(node.param2));
                }
            }
            break;

            case (int)CTRL_FIND_TYPE.FIND_TYPE_EQUIP_ITEM:
            {
                if (window is UIBagForm)
                {
                    UIBagForm bag = (UIBagForm)window;

                    return(bag.FindEquipItem(node.param2));
                }
            } break;

            case (int)CTRL_FIND_TYPE.FIND_TYPE_QUEST_SELECT_ID:
            {
                if (window is UIQuestForm)
                {
                    UIQuestForm quest = (UIQuestForm)window;

                    return(quest.FindEnterBtn(node.param2));
                }
            }
            break;

            case (int)CTRL_FIND_TYPE.FIND_TYPE_STAGE_SELECT_ID:
            {
                if (window is UIStageList)
                {
                    UIStageList stage = (UIStageList)window;

                    return(stage.FindEnterBtn(node.param2));
                }
            }
            break;

            case (int)CTRL_FIND_TYPE.FIND_TYPE_CHECK_EQUIP_ITEM:
            {
                PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>();

                PackageManager pack = module.GetPackManager();

                Dictionary <int, ItemObj> dic = pack.getPackDic(PackageType.Pack_Equip);

                bool find = false;
                foreach (KeyValuePair <int, ItemObj> value in dic)
                {
                    if (value.Value.GetResId() == node.param2)
                    {
                        find = true;
                    }
                }
                if (!find)
                {
                    End();
                    return(null);
                }
            } break;

            case (int)CTRL_FIND_TYPE.FIND_TYPE_CHECK_NO_SKILL:
            {
                SkillModule module = ModuleManager.Instance.FindModule <SkillModule>();

                if (module.GetSkillLvBySkillID(node.param2) > 0)
                {
                    End();
                    return(null);
                }
            } break;
            }
        }
        obj = window.FindChild(node.ctrl);
        return(obj);
    }