public void Initialize(DalamudPluginInterface pluginInterface) { _pluginInterface = pluginInterface; _commandManager = new Managers.CommandManager(pluginInterface); _configuration = pluginInterface.GetPluginConfig() as GatherBuddyConfiguration ?? new GatherBuddyConfiguration(); Gatherer = new Gatherer(pluginInterface, _configuration, _commandManager); Alarms = Gatherer.Alarms; _gatherInterface = new Interface(this, pluginInterface, _configuration); _fishingTimer = new FishingTimer(_pluginInterface, _configuration, Gatherer !.FishManager); var tmp = _pluginInterface.TargetModuleScanner.GetStaticAddressFromSig("0F 84 AD 01 00 00 49 89 5B 08 4C 8D 15"); PluginLog.Information($"Doop : {tmp.ToInt64():X16} {tmp.ToInt64() - _pluginInterface.TargetModuleScanner.Module.BaseAddress.ToInt64():X16}"); var count = _pluginInterface.Data.Excel.GetSheet <Lumina.Excel.GeneratedSheets.FishParameter>().Count(f => f.IsInLog); PluginLog.Information($"Derp : {tmp.ToInt64() + count / 8:X16} {tmp.ToInt64() - _pluginInterface.TargetModuleScanner.Module.BaseAddress.ToInt64() + count / 8:X16}"); if (!Gatherer !.FishManager.GetSaveFileName(_pluginInterface).Exists) { Gatherer !.FishManager.SaveFishRecords(_pluginInterface); }
public void Initialize(DalamudPluginInterface pluginInterface) { _pluginInterface = pluginInterface; _commandManager = new Managers.CommandManager(pluginInterface); _configuration = pluginInterface.GetPluginConfig() as GatherBuddyConfiguration ?? new GatherBuddyConfiguration(); Gatherer = new Gatherer(pluginInterface, _configuration, _commandManager); Alarms = Gatherer.Alarms; _gatherInterface = new Interface(this, pluginInterface, _configuration); _fishingTimer = new FishingTimer(_pluginInterface, _configuration); _pluginInterface !.CommandManager.AddHandler("/gatherbuddy", new CommandInfo(OnGatherBuddy) { HelpMessage = "Use for settings. Use without arguments for interface.", ShowInHelp = true, }); _pluginInterface !.CommandManager.AddHandler("/gather", new CommandInfo(OnGather) { HelpMessage = "Mark the nearest node containing the item supplied, teleport to the nearest aetheryte, equip appropriate gear.", ShowInHelp = true, }); _pluginInterface !.CommandManager.AddHandler("/gatherbot", new CommandInfo(OnGatherBot) { HelpMessage = "Mark the nearest botanist node containing the item supplied, teleport to the nearest aetheryte, equip appropriate gear.", ShowInHelp = true, }); _pluginInterface !.CommandManager.AddHandler("/gathermin", new CommandInfo(OnGatherMin) { HelpMessage = "Mark the nearest miner node containing the item supplied, teleport to the nearest aetheryte, equip appropriate gear.", ShowInHelp = true, }); _pluginInterface !.CommandManager.AddHandler("/gatherfish", new CommandInfo(OnGatherFish) { HelpMessage = "Mark the nearest fishing spot containing the fish supplied, teleport to the nearest aetheryte and equip fishing gear.", ShowInHelp = true, }); _pluginInterface !.CommandManager.AddHandler("/gathergroup", new CommandInfo(OnGatherGroup) { HelpMessage = "Teleport to the node of a group corresponding to current time. Use /gathergroup for more details.", ShowInHelp = true, }); _pluginInterface !.CommandManager.AddHandler("/gatherdebug", new CommandInfo(OnGatherDebug) { HelpMessage = "Dump some collected information.", ShowInHelp = false, }); pluginInterface.ClientState.TerritoryChanged += Gatherer !.OnTerritoryChange; pluginInterface.UiBuilder.OnBuildUi += _gatherInterface !.Draw; pluginInterface.UiBuilder.OnBuildUi += _fishingTimer !.Draw; pluginInterface.UiBuilder.OnOpenConfigUi += OnConfigCommandHandler; if (_configuration !.DoRecord) { Gatherer.StartRecording(); } if (_configuration.AlarmsEnabled) { Alarms !.Enable(true); } }