Turn off Generate Cost Config for Hookah unlockable

It is a new option in DawnLib/Dusk 0.7.8, and it allows to skip binding
cost to a config option which is turn means more artistic control and
less cache invalidation issues.
This commit is contained in:
ivan tkachenko 2026-02-02 16:11:13 +02:00
parent 74f7436ab3
commit 6575b2685f
3 changed files with 0 additions and 26 deletions

View File

@ -1,22 +0,0 @@
using BepInEx.Configuration;
using Dusk;
namespace HookahPlace.Content;
internal static class NukeDawnLibConfig
{
static internal void NukeUnlockable(ConfigFile config, string heading, string name, int cost)
{
heading = $"{heading} Options";
var costName = $"{name} | Cost";
var disclaimer = "Sorry, this is not configurable. This is a dirty hack to suppress DawnLib/DuskMod from allowing any configurability here.";
var ctx = new ConfigContext(config, heading);
var enabledEntry = ctx.Bind("Enabled", disclaimer, true);
enabledEntry.Value = true;
var costEntry = ctx.Bind(costName, disclaimer, cost);
costEntry.Value = cost;
}
}

View File

@ -4,12 +4,8 @@ namespace HookahPlace.Content;
public class HookahContentHandler : ContentHandler<HookahContentHandler>
{
const int HOOKAH_PRICE = 130;
public HookahContentHandler(DuskMod mod) : base(mod)
{
NukeDawnLibConfig.NukeUnlockable(HookahPlace.Config, "HookahUnlockable", "Hookah", HOOKAH_PRICE);
if (!RegisterContent("hookahunlockableassets", out DefaultBundle? bundle, forceEnabled: true) || bundle == null)
{
HookahPlace.Logger.LogError($"Failed to register content");