// Factory function.
        public static ScheduleLibrary Create(IModHelper helper)
        {
            ScheduleLibrary instance = helper.ReadJsonFile <ScheduleLibrary>("CharacterScheduleLibrary.json");

            if (instance == null)
            {
                instance = new ScheduleLibrary();
                helper.WriteJsonFile("CharacterScheduleLibrary.json", instance);
            }

            instance.Helper = helper;
            return(instance);
        }
示例#2
0
        public override void Entry(IModHelper helper)
        {
            //load the mod's ability to inject custom scheduling
            this.ScheduleLibrary = ScheduleLibrary.Create(helper);
            helper.Content.AssetEditors.Add(this.ScheduleLibrary);

            this.MapEditor = new MapEditor(helper, this.Monitor);

            this.CurrentInputContext = MouseInputContext.DefaultContext;
            this.ActionManager       = new ActionManager(this.Helper, this.Monitor);
            this.ActionManager.AddTileProperty(new ChangeClothesAction());
            this.ActionManager.AddTileProperty(new MessageAction());

            //wire up various events
            AddEventHandlers();
        }