Skip to content

4) Enum Sliders

Aaron C Robinson edited this page Aug 29, 2018 · 4 revisions

This utility helps when you have enum types in settings.

Listing_Standard.AddLabeledSlider

  • Label
  • enum Value (by ref)
        ...

public override void DoSettingsWindowContents(Rect inRect)
{
   Listing_Standard listing = new Listing_Standard();
   listing.Begin(inRect);
   listing.AddLabeledSlider<FirewatcherChieftainness>("FireWatcher Chieftainness", 
                                                      ref settings.chieftainness);
   listing.End();
   settings.Write();
}

Example from: NoFirewatcher's ModSettings

Clone this wiki locally