Last active
March 12, 2020 06:16
-
-
Save Neceros/5c565313b9f6a7bcdd8631c524fd4b2a to your computer and use it in GitHub Desktop.
givememeat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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