Advanced setting to ignore max offers when keeping add offer window open

This commit is contained in:
Tyfon
2024-05-25 12:06:27 -07:00
parent d18dfc0310
commit b82eba92eb
2 changed files with 11 additions and 1 deletions

View File

@@ -32,7 +32,7 @@ namespace UIFixes
{
// Close the window if you're gonna hit max offers
var ragfair = __instance.R().Ragfair;
if (ragfair.MyOffersCount + 1 < ragfair.GetMaxOffersCount(ragfair.MyRating))
if (Settings.KeepAddOfferOpenIgnoreMaxOffers.Value || ragfair.MyOffersCount + 1 < ragfair.GetMaxOffersCount(ragfair.MyRating))
{
BlockClose = true;
}

View File

@@ -63,6 +63,7 @@ namespace UIFixes
// Advanced
public static ConfigEntry<bool> StyleItemPanel { get; set; }
public static ConfigEntry<bool> KeepAddOfferOpenIgnoreMaxOffers { get; set; }
public static void Init(ConfigFile config)
{
@@ -264,6 +265,15 @@ namespace UIFixes
null,
new ConfigurationManagerAttributes { IsAdvanced = true })));
configEntries.Add(KeepAddOfferOpenIgnoreMaxOffers = config.Bind(
AdvancedSection,
"Keep Add Offer Window Open: Ignore Max Offers",
false,
new ConfigDescription(
"Specifically for the Keep Add Offers Window Open, this setting will keep the window open even if you're at max offers.",
null,
new ConfigurationManagerAttributes { IsAdvanced = true })));
RecalcOrder(configEntries);
}
private static void RecalcOrder(List<ConfigEntryBase> configEntries)