Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace COLORFABRICATOR
- {
- public static class Config
- {
- public static SerializableColor FabricatorColor = new Color(0.016f, 1.0f, 1.0f);
- public static float rValue;
- public static float gValue;
- public static float bValue;
- public static float fabricatorValue;
- public static float fabricatorgValue;
- public static float fabricatorbValue;
- public static bool ToggleColor;
- public static bool fabricatorColor;
- public static void Load()
- {
- fabricatorValue = PlayerPrefs.GetFloat("fabricatorR", 0.016f);
- fabricatorgValue = PlayerPrefs.GetFloat("fabricatorG", 1.000f);
- fabricatorbValue = PlayerPrefs.GetFloat("fabricatorB", 1.000f);
- fabricatorColor = PlayerPrefsExtra.GetBool("fabricatorColor", false);
- }
- }
- public class Options : ModOptions
- {
- public Options() : base("Fabricator Settings")
- {
- SliderChanged += Options_SliderChanged;
- ToggleChanged += Options_ToggleChanged;
- }
- public void Options_ToggleChanged(object sender, ToggleChangedEventArgs e)
- {
- if (e.Id == "toggleColor")
- {
- Config.ToggleColor = e.Value;
- PlayerPrefsExtra.SetBool("ToggleColor", e.Value);
- }
- }
- public void Options_SliderChanged(object sender, SliderChangedEventArgs e)
- {
- if (e.Id == "fabricatorr")
- {
- Config.fabricatorValue = e.Value;
- PlayerPrefs.SetFloat("FabricatorR", e.Value);
- }
- else if (e.Id == "fabricatorg")
- {
- Config.fabricatorgValue = e.Value;
- PlayerPrefs.SetFloat("FabricatorG", e.Value);
- }
- else if (e.Id == "fabricatorb")
- {
- Config.fabricatorbValue = e.Value;
- PlayerPrefs.SetFloat("FabricatorB", e.Value);
- }
- }
- public override void BuildModOptions()
- {
- if ( Config.fabricatorColor)
- {
- AddToggleOption("fabricatorcolor", "ColorFabricator Color Enabled", Config.fabricatorColor);
- AddSliderOption("fabricatorr", "Fabricator Red", 0, 255, Config.fabricatorValue);
- AddSliderOption("fabricatorg", "Fabricator Green", 0, 255, Config.fabricatorgValue);
- AddSliderOption("fabricatorb", "Fabricator Blue", 0, 255, Config.fabricatorbValue);
- Config.Load();
- }
- else
- {
- AddToggleOption("fabricatorcolor", "ColorFabricator Color Enabled", Config.fabricatorColor);
- Config.Load();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement