Skip to content

Instantly share code, notes, and snippets.

@Neceros
Last active March 12, 2020 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neceros/5c565313b9f6a7bcdd8631c524fd4b2a to your computer and use it in GitHub Desktop.
Save Neceros/5c565313b9f6a7bcdd8631c524fd4b2a to your computer and use it in GitHub Desktop.
givememeat
using UnityEngine;
using Verse;
namespace GiveMeMeat
{
public class GiveMeMeatSettings : ModSettings
{
public static float MeatAmountToMultiply => meatATM;
// DON'T reference these following var(s) except from inside this class; Reference the above variables instead. ExposeData requires them to be public
public static float meatATM = 2;
// End warning
public override void ExposeData()
{
base.ExposeData();
Scribe_Values.Look(ref meatATM, "MeatAmountToMultiply");
}
}
public class GiveMeMeatMod : Mod
{
GiveMeMeatSettings settings;
public GiveMeMeatMod(ModContentPack con) : base(con)
{
this.settings = GetSettings<GiveMeMeatSettings>();
}
public override void DoSettingsWindowContents(Rect inRect)
{
Listing_Standard listing = new Listing_Standard();
listing.Begin(inRect);
listing.Label("meatATMLabel".Translate() + " " + (GiveMeMeatSettings.meatATM * 100).ToString() + "%");
listing.Slider(GiveMeMeatSettings.meatATM, 0f, 10f);
listing.End();
base.DoSettingsWindowContents(inRect);
}
public override string SettingsCategory()
{
return "meatATMTitle".Translate();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment