Beispiel #1
0
 public override void Entry(IModHelper helper)
 {
     petCommands = Helper.Data.ReadJsonFile <PetCommands>("commands.json") ?? new PetCommands();
     TimeEvents.AfterDayStarted       += TimeEvents_AfterDayStarted;
     SaveEvents.AfterLoad             += SaveEvents_AfterLoad;
     SaveEvents.BeforeSave            += SaveEvents_BeforeSave;
     GameEvents.QuarterSecondTick     += GameEvents_QuarterSecondTick;
     GameEvents.UpdateTick            += GameEvents_UpdateTick;
     PlayerEvents.Warped              += PlayerEvents_Warped;
     GraphicsEvents.OnPostRenderEvent += GraphicsEvents_OnPostRenderEvent;
 }
Beispiel #2
0
 private void SaveEvents_AfterLoad(object sender, EventArgs e)
 {
     petData     = Helper.Data.ReadJsonFile <ModData>($"data/{Constants.SaveFolderName}.json") ?? new ModData();
     petCommands = Helper.Data.ReadJsonFile <PetCommands>("commands.json") ?? new PetCommands();
     messages    = this.Helper.Reflection.GetField <List <ChatMessage> >(Game1.chatBox, "messages", true).GetValue();
 }