示例#1
0
        public void TryFin(string id)
        {
            bool flag = !this._currGuides.ContainsKey(id);

            if (!flag)
            {
                GuideData guideData = this._currGuides[id];
                bool      flag2     = guideData == null;
                if (!flag2)
                {
                    bool    flag3   = true;
                    Variant conf    = guideData.conf;
                    Variant variant = conf["step"];
                    bool    flag4   = variant.Count <= guideData.nextStep;
                    if (flag4)
                    {
                        this.saveShareFlag(conf);
                        bool flag5 = guideData.stopFun != null;
                        if (flag5)
                        {
                            guideData.stopFun();
                        }
                    }
                    else
                    {
                        bool flag6 = guideData.currStep != null;
                        if (flag6)
                        {
                            bool flag7 = conf.ContainsKey("restart") && conf["restart"] != null;
                            if (flag7)
                            {
                                guideData.desc     = null;
                                guideData.target   = null;
                                guideData.currStep = variant[0];
                                guideData.nextStep = 1;
                                this.updateGuideUI(guideData.ui, guideData);
                                flag3 = false;
                            }
                        }
                    }
                    bool flag8 = flag3;
                    if (flag8)
                    {
                        bool flag9 = conf.ContainsKey("findo");
                        if (flag9)
                        {
                            this.addWaitDoAction("finlink", 0, conf["findo"]);
                        }
                        this.stopGuideImpl(id);
                    }
                }
            }
        }
示例#2
0
        protected void stopGuideImpl(string id)
        {
            GuideData guideData = this._currGuides[id];
            bool      flag      = guideData != null;

            if (flag)
            {
                guideData.ui.StopGuide();
                guideData.ui.SetVisible(false);
                this._currGuides.Remove(id);
                this._currGuideByTp[guideData.conf["tp"]] = null;
            }
        }
示例#3
0
        public void GuideStep(string id, string step, Rect target = null, string desc = null)
        {
            bool flag = !this._canGuide;

            if (!flag)
            {
                GuideData guideData = this._currGuides[id];
                bool      flag2     = guideData != null;
                if (flag2)
                {
                    this.guideStep(guideData, step, target, desc);
                }
            }
        }
示例#4
0
        private void guideStep(GuideData currGuide, string step, Rect target = null, string desc = null)
        {
            Variant variant = currGuide.conf["step"];
            bool    flag    = variant.Count > currGuide.nextStep;

            if (flag)
            {
                for (int i = currGuide.nextStep; i < variant.Count; i++)
                {
                    Variant variant2 = variant[i];
                    bool    flag2    = step == variant2["id"]._str;
                    if (flag2)
                    {
                        currGuide.currStep = variant2;
                        currGuide.nextStep = i + 1;
                        currGuide.target   = target;
                        currGuide.desc     = desc;
                        this.updateGuideUI(currGuide.ui, currGuide);
                        break;
                    }
                }
            }
        }
示例#5
0
        private void updateGuideUI(IGuideUI uiGuide, GuideData data)
        {
            bool flag = uiGuide == null;

            if (!flag)
            {
                Variant currStep = data.currStep;
                bool    flag2    = currStep != null && currStep.ContainsKey("empty") && currStep["empty"] != null;
                if (flag2)
                {
                    uiGuide.SetVisible(false);
                }
                else
                {
                    uiGuide.SetVisible(this._hideFlags._arr.IndexOf(data.conf["tp"]) < 0);
                    string guideDesc = null;
                    bool   flag3     = data.desc != null;
                    if (flag3)
                    {
                        guideDesc = LanguagePack.getLanguageText("guidedesc", data.desc);
                    }
                    else
                    {
                        bool flag4 = currStep.ContainsKey("desc");
                        if (flag4)
                        {
                            guideDesc = LanguagePack.getLanguageText("guidedesc", currStep["desc"]._str);
                        }
                    }
                    uiGuide.SetGuideDesc(guideDesc);
                    uiGuide.AdjustChilds(currStep["ctrl"]);
                    uiGuide.SetParent(currStep["panel"]);
                    uiGuide.AdjustTarget(data.target, currStep["target"], currStep["ori"]);
                }
            }
        }
示例#6
0
        public bool Start(string id, Variant userdata = null, Action stopFun = null)
        {
            bool flag = !this._canGuide;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                Variant guideConf = (this._uiClient.g_gameConfM as muCLientConfig).localGuild.GetGuideConf(id.ToString());
                bool    flag2     = guideConf == null;
                if (flag2)
                {
                    result = false;
                }
                else
                {
                    Variant variant = guideConf["step"];
                    bool    flag3   = variant.Count == 0;
                    if (flag3)
                    {
                        result = false;
                    }
                    else
                    {
                        bool flag4 = this.isGuided(guideConf);
                        if (flag4)
                        {
                            result = false;
                        }
                        else
                        {
                            bool flag5 = guideConf.ContainsKey("level");
                            if (flag5)
                            {
                                bool flag6 = guideConf["level"]._uint < (this._uiClient.g_netM as muNetCleint).joinWorldInfoInst.level;
                                if (flag6)
                                {
                                    result = false;
                                    return(result);
                                }
                            }
                            IGuideUI guideUI = null;
                            bool     flag7   = this._guideUIs.Count > 0;
                            if (flag7)
                            {
                                guideUI = this._guideUIs[guideConf["tp"]];
                            }
                            bool flag8 = guideUI == null;
                            if (flag8)
                            {
                                Variant guideUIConf = (this._uiClient.g_gameConfM as muCLientConfig).localGuild.GetGuideUIConf();
                                bool    flag9       = guideUIConf == null;
                                if (flag9)
                                {
                                    result = false;
                                    return(result);
                                }
                                guideUI = this.createGuideUI(guideUIConf["template"]);
                                guideUI.InitFrame();
                                this._guideUIs[guideConf["tp"]] = guideUI;
                                guideUI.SetPointAt(guideUIConf["ptx"], guideUIConf["pty"]);
                            }
                            string text   = null;
                            bool   flag10 = this._currGuideByTp.Count > 0 && this._currGuideByTp[guideConf["tp"]] != null;
                            if (flag10)
                            {
                                text = this._currGuideByTp[guideConf["tp"]];
                            }
                            bool      flag11 = text != null;
                            GuideData guideData;
                            if (flag11)
                            {
                                bool flag12 = text == id;
                                if (flag12)
                                {
                                    result = false;
                                    return(result);
                                }
                                guideData = this._currGuides[text];
                                bool flag13 = guideConf["weight"]._int < guideData.conf["weight"]._int;
                                if (flag13)
                                {
                                    result = false;
                                    return(result);
                                }
                                guideUI.ClearGuide();
                                this._currGuides.Remove(text);
                            }
                            this._currGuideByTp[guideConf["tp"]] = id;
                            guideData = new GuideData();
                            this._currGuides[id.ToString()] = guideData;
                            guideData.userdata = userdata;
                            guideData.stopFun  = stopFun;
                            guideData.conf     = guideConf;
                            guideData.currStep = null;
                            guideData.nextStep = 0;
                            guideData.ui       = guideUI;
                            guideUI.StartGuide();
                            bool flag14 = guideConf.ContainsKey("tm");
                            if (flag14)
                            {
                                this.addWaitDoAction("stopguide", (int)(GameTools.getTimer() + (long)guideConf["tm"]._int), id);
                            }
                            bool flag15 = guideConf.ContainsKey("stdo");
                            if (flag15)
                            {
                                this.addWaitDoAction("startlink", 0, guideConf["stdo"]);
                            }
                            result = true;
                        }
                    }
                }
            }
            return(result);
        }
示例#7
0
        public Variant GetUserdata(uint id)
        {
            GuideData guideData = this._currGuides[id.ToString()];

            return((guideData != null) ? guideData.userdata : null);
        }
示例#8
0
        public string GetCurrGuideStep(string id)
        {
            GuideData guideData = this._currGuides[id];

            return((guideData != null && guideData.currStep != null) ? guideData.currStep["id"] : null);
        }