Example #1
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"]);
                }
            }
        }
Example #2
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);
        }