Esempio n. 1
0
        private string MakeResultString(Json_DropInfo[] drops)
        {
            MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;

            UnitParam[] allUnits = masterParam.GetAllUnits();
            string      str      = string.Empty;

            foreach (Json_DropInfo drop in drops)
            {
                ItemParam itemParam = masterParam.GetItemParam(drop.iname);
                if (itemParam != null)
                {
                    str = str + itemParam.name + "\n";
                }
                else
                {
                    foreach (UnitParam unitParam in allUnits)
                    {
                        if (unitParam.iname == drop.iname)
                        {
                            str = str + unitParam.name + "\n";
                            break;
                        }
                    }
                }
            }
            return(str);
        }
Esempio n. 2
0
        private void AddAssets()
        {
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (this.mQueue != null)
            {
                for (int index = 0; index < this.mQueue.Count; ++index)
                {
                    AssetDownloader.Add(this.mQueue[index].IDStr);
                }
                this.mQueue = (List <AssetList.Item>)null;
            }
            if (this.Download == (FlowNode_DownloadAssets.DownloadAssets) - 1)
            {
                return;
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.Tutorial) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                if ((instanceDirect.Player.TutorialFlags & 1L) != 0L)
                {
                    if (instanceDirect.HasTutorialDLAssets)
                    {
                        instanceDirect.DownloadTutorialAssets();
                    }
                    AssetManager.PrepareAssets("town001");
                }
                else if (BackgroundDownloader.Instance.IsEnabled)
                {
                    this.ProgressBar = false;
                    this.ActivateOutputLinks(10);
                    BackgroundDownloader.Instance.GetRequiredAssets(GameSettings.Instance.Tutorial_Steps[instanceDirect.TutorialStep]);
                }
                else
                {
                    if (instanceDirect.HasTutorialDLAssets)
                    {
                        instanceDirect.DownloadTutorialAssets();
                    }
                    if (!GameUtility.IsDebugBuild || GlobalVars.DebugIsPlayTutorial)
                    {
                        AssetManager.PrepareAssets("PortraitsM/urob");
                        AssetManager.PrepareAssets("op0002exit");
                        AssetManager.PrepareAssets("op0005exit");
                        AssetManager.PrepareAssets("op0006exit");
                    }
                    AssetManager.PrepareAssets("town001");
                    AssetManager.PrepareAssets("UI/QuestAssets");
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.OwnUnits) != (FlowNode_DownloadAssets.DownloadAssets) 0 && ((instanceDirect.Player.TutorialFlags & 1L) != 0L || !BackgroundDownloader.Instance.IsEnabled))
            {
                PlayerData player = MonoSingleton <GameManager> .Instance.Player;
                if (player != null)
                {
                    for (int index = 0; index < player.Units.Count; ++index)
                    {
                        DownloadUtility.DownloadUnit(player.Units[index].UnitParam, player.Units[index].Jobs);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.AllUnits) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                MasterParam masterParam    = MonoSingleton <GameManager> .Instance.MasterParam;
                UnitParam[] unitParamArray = masterParam != null?masterParam.GetAllUnits() : (UnitParam[])null;

                if (unitParamArray != null)
                {
                    for (int index = 0; index < unitParamArray.Length; ++index)
                    {
                        DownloadUtility.DownloadUnit(unitParamArray[index], (JobData[])null);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.LoginBonus) != (FlowNode_DownloadAssets.DownloadAssets) 0 && ((instanceDirect.Player.TutorialFlags & 1L) != 0L || !BackgroundDownloader.Instance.IsEnabled))
            {
                Json_LoginBonusTable loginBonus28days = MonoSingleton <GameManager> .Instance.Player.LoginBonus28days;
                if (loginBonus28days != null && loginBonus28days.bonus_units != null && loginBonus28days.bonus_units.Length > 0)
                {
                    MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;
                    foreach (string bonusUnit in loginBonus28days.bonus_units)
                    {
                        DownloadUtility.DownloadUnit(masterParam.GetUnitParam(bonusUnit), (JobData[])null);
                    }
                }
            }
            if ((this.Download & FlowNode_DownloadAssets.DownloadAssets.Artifacts) != (FlowNode_DownloadAssets.DownloadAssets) 0)
            {
                List <ArtifactData> artifacts = MonoSingleton <GameManager> .Instance.Player.Artifacts;
                if (artifacts != null && artifacts.Count > 0)
                {
                    for (int index = 0; index < artifacts.Count; ++index)
                    {
                        DownloadUtility.DownloadArtifact(artifacts[index].ArtifactParam);
                    }
                }
            }
            for (int index = 0; index < this.AssetPaths.Length; ++index)
            {
                if (!string.IsNullOrEmpty(this.AssetPaths[index]))
                {
                    AssetManager.PrepareAssets(this.AssetPaths[index]);
                }
            }
            if (!Object.op_Inequality((Object)instanceDirect, (Object)null))
            {
                return;
            }
            for (int index = 0; index < this.DownloadUnits.Length; ++index)
            {
                if (!string.IsNullOrEmpty(this.DownloadUnits[index]))
                {
                    UnitParam unitParam = instanceDirect.GetUnitParam(this.DownloadUnits[index]);
                    if (unitParam != null)
                    {
                        DownloadUtility.DownloadUnit(unitParam, (JobData[])null);
                    }
                }
            }
            for (int index = 0; index < this.DownloadQuests.Length; ++index)
            {
                if (!string.IsNullOrEmpty(this.DownloadQuests[index]))
                {
                    QuestParam quest = instanceDirect.FindQuest(this.DownloadQuests[index]);
                    if (quest == null)
                    {
                        DebugUtility.LogError("Can't download " + this.DownloadQuests[index]);
                    }
                    else
                    {
                        DownloadUtility.DownloadQuestBase(quest);
                    }
                }
            }
        }