Skip to content

Commit

Permalink
e
Browse files Browse the repository at this point in the history
  • Loading branch information
TianMengLucky committed Aug 3, 2023
1 parent 8352ec4 commit 480cdb0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions NextShip/Options/OptionBases/FloatOptionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class FloatOptionBase : OptionBase
public FloatOptionBase(string Title, int id, optionTab tab, FloatOptionValue floatOptionValue, bool Translation = true) : base(Title, id, tab, optionType.Float, Translation)
{
_floatOptionValue = floatOptionValue;
OptionManager.AllFloatOption.Add(this);
}


Expand Down
22 changes: 20 additions & 2 deletions NextShip/Options/OptionManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using HarmonyLib;
using NextShip.Utilities.Attributes;

namespace NextShip.Options;
Expand All @@ -16,7 +17,24 @@ public static class OptionManager
public static void Load()
{
OptionLoad.StartOptionLoad();
Check();
}

public static void Check()
{
var e = new List<int>();
AllOption.Do(check);

void check(OptionBase @base)
{
if (e.Contains(@base.id))
{
Warn($"选项id冲突 id: {@base.id} name: {@base.Title}");
}
else
{
e.Add(@base.id);
}
}
}


}

0 comments on commit 480cdb0

Please sign in to comment.