Skip to content

Commit 540e500

Browse files
authored
Merge pull request #936 from erdelf/master
Auto update presets on launch
2 parents 85662a5 + 9b430d6 commit 540e500

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

AutoDuty/AutoDuty.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public AutoDuty()
216216
AssemblyDirectoryInfo = AssemblyFileInfo.Directory;
217217

218218
Configuration.Version =
219-
((PluginInterface.IsDev ? new Version(0,0,0, 206) :
219+
((PluginInterface.IsDev ? new Version(0,0,0, 208) :
220220
PluginInterface.IsTesting ? PluginInterface.Manifest.TestingAssemblyVersion ?? PluginInterface.Manifest.AssemblyVersion : PluginInterface.Manifest.AssemblyVersion)!).Revision;
221221
Configuration.Save();
222222

@@ -236,6 +236,13 @@ public AutoDuty()
236236
RepairNPCHelper.PopulateRepairNPCs();
237237
FileHelper.Init();
238238
Patcher.Patch(startup: true);
239+
240+
if (Configuration.BM_UpdatePresetsOnLaunch)
241+
{
242+
BossMod_IPCSubscriber.RefreshPreset("AutoDuty", Resources.AutoDutyPreset);
243+
BossMod_IPCSubscriber.RefreshPreset("AutoDuty Passive", Resources.AutoDutyPassivePreset);
244+
}
245+
239246
Chat = new();
240247
_overrideAFK = new();
241248
_ipcProvider = new();

AutoDuty/Windows/Config.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ public bool OverlayNoBG
135135
public bool CofferButton = true;
136136
public bool TTButton = true;
137137

138+
139+
//Dev Options
138140
internal bool updatePathsOnStartup = true;
139141
public bool UpdatePathsOnStartup
140142
{
141143
get => !Plugin.isDev || this.updatePathsOnStartup;
142144
set => this.updatePathsOnStartup = value;
143145
}
144-
145-
//Dev Options
146146

147147

148148
//Duty Config Options
@@ -295,8 +295,11 @@ public bool AutoGCTurnin
295295
public bool TerminationKeepActive = true;
296296

297297
//BMAI Config Options
298-
public bool HideBossModAIConfig = false;
299-
internal bool maxDistanceToTargetRoleBased = true;
298+
public bool HideBossModAIConfig = false;
299+
public bool BM_UpdatePresetsOnLaunch = true;
300+
301+
302+
internal bool maxDistanceToTargetRoleBased = true;
300303
public bool MaxDistanceToTargetRoleBased
301304
{
302305
get => maxDistanceToTargetRoleBased;
@@ -698,6 +701,8 @@ public static void Draw()
698701
BossMod_IPCSubscriber.RefreshPreset("AutoDuty", Resources.AutoDutyPreset);
699702
BossMod_IPCSubscriber.RefreshPreset("AutoDuty Passive", Resources.AutoDutyPassivePreset);
700703
}
704+
if (ImGui.Checkbox("Update Presets on Launch", ref Configuration.BM_UpdatePresetsOnLaunch))
705+
Configuration.Save();
701706
if (ImGui.Checkbox("Set Max Distance To Target Based on Player Role", ref Configuration.maxDistanceToTargetRoleBased))
702707
{
703708
Configuration.MaxDistanceToTargetRoleBased = Configuration.maxDistanceToTargetRoleBased;

0 commit comments

Comments
 (0)