This repository was archived by the owner on Jan 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPurrplingCoreMod.cs
More file actions
57 lines (47 loc) · 1.8 KB
/
PurrplingCoreMod.cs
File metadata and controls
57 lines (47 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using PurrplingCore.Events;
using PurrplingCore.Framework.Events;
using PurrplingCore.Framework.Proxy;
using PurrplingCore.Patching;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewModdingAPI.Utilities;
using StardewValley;
using StardewValley.Monsters;
using StardewValley.Quests;
namespace PurrplingCore
{
/// <summary>The mod entry point.</summary>
public class PurrplingCoreMod : Mod, IPurrplingCoreApi
{
internal EventManager EventManager { get; private set; }
public ICoreModEvents Events { get; private set; }
/// <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)
{
this.EventManager = new EventManager();
this.Events = new CoreModEvents(this.EventManager);
// var patches = new GamePatcher(this.ModManifest.UniqueID, this.Monitor);
helper.Events.GameLoop.SaveLoaded += this.GameLoop_SaveLoaded;
}
private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e)
{
IPurrplingCoreProxy proxy = new PurrplingCoreProxy(this, this);
proxy.RegisterDataType<Quest>();
proxy.RegisterDataType<Monster>();
proxy.Data.WriteJsonFile("test/quests.json", Game1.player.questLog);
var data = proxy.Data.ReadJsonFile<List<Quest>>("test/quests.json");
}
public override object GetApi()
{
return this;
}
public IPurrplingCoreProxy CreateProxy(Mod forMod)
{
return new PurrplingCoreProxy(this, forMod);
}
}
}