2018-12-30 18:00:05 +08:00
|
|
|
using System.Collections.Generic;
|
2018-12-30 13:01:20 +08:00
|
|
|
using System.IO;
|
2017-09-13 02:20:18 +08:00
|
|
|
using StardewModdingAPI;
|
2018-06-13 14:25:36 +08:00
|
|
|
using StardustCore.UIUtilities;
|
2018-03-30 20:46:24 +08:00
|
|
|
using StardustCore.UIUtilities.SpriteFonts;
|
2017-07-14 11:27:48 +08:00
|
|
|
|
2017-09-05 19:13:42 +08:00
|
|
|
namespace StardustCore
|
2017-07-14 11:27:48 +08:00
|
|
|
{
|
2017-09-05 19:13:42 +08:00
|
|
|
public class ModCore : Mod
|
2017-07-14 11:27:48 +08:00
|
|
|
{
|
2017-09-12 09:35:31 +08:00
|
|
|
public static IModHelper ModHelper;
|
|
|
|
public static IMonitor ModMonitor;
|
2018-08-09 04:18:51 +08:00
|
|
|
public static IManifest Manifest;
|
2018-12-30 13:01:20 +08:00
|
|
|
public static TextureManager TextureManager;
|
2018-08-09 04:18:51 +08:00
|
|
|
public static Dictionary<string, TextureManager> TextureManagers;
|
|
|
|
|
2018-08-21 04:53:56 +08:00
|
|
|
public ModConfig config;
|
|
|
|
|
2018-02-06 17:27:28 +08:00
|
|
|
public static string ContentDirectory;
|
2018-12-30 18:00:05 +08:00
|
|
|
|
|
|
|
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
|
|
|
|
/// <param name="helper">Provides simplified APIs for writing mods.</param>
|
2017-09-12 09:35:31 +08:00
|
|
|
public override void Entry(IModHelper helper)
|
|
|
|
{
|
2018-12-30 13:01:20 +08:00
|
|
|
ModHelper = this.Helper;
|
|
|
|
ModMonitor = this.Monitor;
|
|
|
|
Manifest = this.ModManifest;
|
2018-12-16 12:54:58 +08:00
|
|
|
|
2017-11-17 15:07:30 +08:00
|
|
|
IlluminateFramework.Colors.initializeColors();
|
2018-08-14 03:41:11 +08:00
|
|
|
ContentDirectory = "Content";
|
|
|
|
if (!Directory.Exists(ContentDirectory)) Directory.CreateDirectory(Path.Combine(ModHelper.DirectoryPath, "Content"));
|
2018-03-30 20:46:24 +08:00
|
|
|
SpriteFonts.initialize();
|
2018-06-13 09:42:31 +08:00
|
|
|
|
2018-08-09 04:18:51 +08:00
|
|
|
TextureManagers = new Dictionary<string, TextureManager>();
|
2018-06-13 17:36:52 +08:00
|
|
|
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")));
|
2018-12-30 13:01:20 +08:00
|
|
|
TextureManagers.Add(this.ModManifest.UniqueID, TextureManager);
|
2018-12-16 12:54:58 +08:00
|
|
|
|
2018-12-30 13:01:20 +08:00
|
|
|
this.config = ModHelper.ReadConfig<ModConfig>();
|
2017-09-12 09:35:31 +08:00
|
|
|
}
|
2017-07-14 11:27:48 +08:00
|
|
|
}
|
|
|
|
}
|