Ejemplo n.º 1
0
 internal static void Postfix(LevelSetsManager __instance)
 {
     foreach (var path in Campaigns.LevelPaths)
     {
         __instance.allLevelPaths_.Add(path);
         __instance.myLevelsLevelFilePaths_.Add(path);
         LevelInfo info = Utils.Common.LevelInfoFromPath(path);
         __instance.AddLevelNameAndPathPair(path, info, __instance.allLevelNameAndPathPairs_);
         __instance.AddLevelNameAndPathPair(path, info, __instance.myLevelsLevelNameAndPathPairs_);
     }
 }
        internal static void Postfix(LevelEditorLevelNameSelectMenuLogic __instance)
        {
            if (Mod.Instance.Config.DisplayWorkshopLevels && !G.Sys.GameManager_.IsDevBuild_)
            {
                LevelSetsManager levelSets = G.Sys.LevelSets_;

                __instance.CreateButtons(levelSets.LevelsLevelFilePaths_.ToList(), Colors.YellowColors.gold, LevelEditorLevelNameSelectMenuLogic.LevelPathEntry.DisplayOption.RelativePath);
                __instance.CreateButtons(levelSets.WorkshopLevelFilePaths_.ToList(), GConstants.communityLevelColor_, LevelEditorLevelNameSelectMenuLogic.LevelPathEntry.DisplayOption.LevelName);

                __instance.buttonList_.SortAndUpdateVisibleButtons();
            }
        }
Ejemplo n.º 3
0
        public static void Generate()
        {
            try
            {
                LevelSetsManager lsm = G.Sys.LevelSets_;

                Export.Clear();

                Export.Add("OfficialLevels", lsm.OfficialLevelInfosList_.ToList().Where((item) => item.relativePath_.ToLower().StartsWith("officiallevels/")));
                Export.Add("CommunityLevels", lsm.OfficialLevelInfosList_.ToList().Where((item) => item.relativePath_.ToLower().StartsWith("communitylevels/")));

                SaveExportData();
            }
            catch (Exception e)
            {
                Log.Exception(e);
            }
        }
Ejemplo n.º 4
0
        internal static bool Prefix(ref LevelSetsManager __instance)
        {
            if (!__instance.communityLevelInfos_)
            {
                return(true);
            }
            LevelInfos temp = LevelInfos.Create();

            foreach (var level in __instance.communityLevelInfos_.LevelPathsToLevelInfos_)
            {
                if (!Campaigns.LevelPaths.Contains(level.Key))
                {
                    temp.levelPathsToLevelInfos_.Add(level.Key, level.Value);
                }
            }

            temp.SavePersonalLevelInfos();
            temp.Destroy();
            return(false);
        }