Ejemplo n.º 1
0
        internal void Awake()
        {
            Logger = base.Logger;

            Hooks.InstallHooks();
            UniversalAutoResolver.Hooks.InstallHooks();
            Lists.Hooks.InstallHooks();

            ResourceRedirection.EnableSyncOverAsyncAssetLoads();
            ResourceRedirection.EnableRedirectMissingAssetBundlesToEmptyAssetBundle(-1000);
            ResourceRedirection.RegisterAsyncAndSyncAssetLoadingHook(RedirectHook);
            ResourceRedirection.RegisterAssetBundleLoadingHook(AssetBundleLoadingHook);

            MissingModWarning       = Config.AddSetting("Settings", "Show missing mod warnings", true, new ConfigDescription("Whether missing mod warnings will be displayed on screen. Messages will still be written to the log."));
            DebugLogging            = Config.AddSetting("Settings", "Debug logging", false, new ConfigDescription("Enable additional logging useful for debugging issues with Sideloader and sideloader mods.\nWarning: Will increase load and save times noticeably and will result in very large log sizes."));
            DebugResolveInfoLogging = Config.AddSetting("Settings", "Debug resolve info logging", false, new ConfigDescription("Enable verbose logging for debugging issues with Sideloader and sideloader mods.\nWarning: Will increase game start up time and will result in very large log sizes."));
            ModLoadingLogging       = Config.AddSetting("Settings", "Mod loading logging", true, new ConfigDescription("Enable verbose logging when loading mods.", tags: "Advanced"));
            KeepMissingAccessories  = Config.AddSetting("Settings", "Keep missing accessories", false, new ConfigDescription("Missing accessories will be replaced by a default item with color and position information intact when loaded in the character maker."));
            MigrationEnabled        = Config.AddSetting("Settings", "Migration enabled", true, new ConfigDescription("Attempt to change the GUID and or ID of mods based on the data configured in the manifest.xml."));
            AdditionalModsDirectory = Config.AddSetting("General", "Additional mods directory", FindKoiZipmodDir(), new ConfigDescription("Additional directory to load zipmods from."));

            if (!Directory.Exists(ModsDirectory))
            {
                Logger.LogWarning("Could not find the mods directory: " + ModsDirectory);
            }

            if (!AdditionalModsDirectory.Value.IsNullOrWhiteSpace() && !Directory.Exists(AdditionalModsDirectory.Value))
            {
                Logger.LogWarning("Could not find the additional mods directory specified in config: " + AdditionalModsDirectory.Value);
            }

            LoadModsFromDirectories(ModsDirectory, AdditionalModsDirectory.Value);
        }
Ejemplo n.º 2
0
        void Awake()
        {
            ResourceRedirection.RegisterAssetBundleLoadingHook(
                priority: 1000,
                action: AssetBundleLoading);

            ResourceRedirection.RegisterAsyncAssetBundleLoadingHook(
                priority: 1000,
                action: AsyncAssetBundleLoading);
        }