Пример #1
0
        private static void Postfix()
        {
            Logger.Log("The Long Dark version: '{0}'", GameManager.GetVersionString());

            SerializableSkill.MaybeRegisterInIl2Cpp();

            try { BlueprintMapper.MapBlueprints(); }
            catch (System.Exception e)
            {
                Logger.LogError("Blueprint Mapping failed: " + e);
            }

            try { SkillsMapper.MapSkills(); }
            catch (System.Exception e)
            {
                Logger.LogError("Skills Mapping failed: " + e);
            }


            //
            //Need to be called after GameManager is initialized
            //

            if (!ModExisting.IsInitialized())            //ModExisting only needs to be initialized at the start of the game
            {
                ModExisting.Initialize();
            }
            AlternativeToolManager.ProcessList();
        }
Пример #2
0
        private static void MapBlueprint(GameObject prefab, string sourcePath)
        {
            ModBlueprint modBlueprint = ModComponentUtils.ComponentUtils.GetComponent <ModBlueprint>(prefab);

            if (modBlueprint != null)
            {
                BlueprintMapper.RegisterBlueprint(modBlueprint, sourcePath);
            }
        }
Пример #3
0
        private static void ProcessText(string path, string text)
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                PageManager.SetItemPackNotWorking(path, "Skipping because blueprint text contains no information");
                return;
            }

            try
            {
                ModBlueprint blueprint = MelonLoader.TinyJSON.JSON.Load(text).Make <ModBlueprint>();
                if (!(blueprint is null))
                {
                    BlueprintMapper.RegisterBlueprint(blueprint, path);
                }
                else
                {
                    PageManager.SetItemPackNotWorking(path, "Skipping because blueprint is null");
                }
            }