Stardew_Valley_Mods/GeneralMods/StardustCore/ModCore.cs

45 lines
1.9 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using System.IO;
using StardewModdingAPI;
using StardustCore.UIUtilities;
using StardustCore.UIUtilities.SpriteFonts;
namespace StardustCore
{
public class ModCore : Mod
{
public static IModHelper ModHelper;
public static IMonitor ModMonitor;
public static IManifest Manifest;
public static TextureManager TextureManager;
public static Dictionary<string, TextureManager> TextureManagers;
2018-08-21 04:53:56 +08:00
public ModConfig config;
public static string ContentDirectory;
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
/// <param name="helper">Provides simplified APIs for writing mods.</param>
public override void Entry(IModHelper helper)
{
ModHelper = this.Helper;
ModMonitor = this.Monitor;
Manifest = this.ModManifest;
IlluminateFramework.Colors.initializeColors();
ContentDirectory = "Content";
if (!Directory.Exists(ContentDirectory)) Directory.CreateDirectory(Path.Combine(ModHelper.DirectoryPath, "Content"));
SpriteFonts.initialize();
TextureManagers = new Dictionary<string, TextureManager>();
TextureManager = new TextureManager();
2019-01-05 17:50:48 +08:00
TextureManager.addTexture("Test1", new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test1.png")));
TextureManager.addTexture("Test2", new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test2.png")));
TextureManager.addTexture("Test3", new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test3.png")));
TextureManagers.Add(this.ModManifest.UniqueID, TextureManager);
this.config = ModHelper.ReadConfig<ModConfig>();
}
}
}