Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
remove color32 serializer and show float value
Browse files Browse the repository at this point in the history
  • Loading branch information
xKiraiChan committed Jun 26, 2022
1 parent 74e3e2c commit e80f84b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 47 deletions.
40 changes: 0 additions & 40 deletions Color32Convert.cs

This file was deleted.

8 changes: 1 addition & 7 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ public class Plugin : BasePlugin

public override void Load()
{
TomlTypeConverter.AddConverter(typeof(Color32), new TypeConverter()
{
ConvertToObject = (str, type) => Color32Convert.FromString(str),
ConvertToString = (obj, type) => Color32Convert.FromColor32((Color32)obj),
});

BackgroundColor = Config.Bind<Color32>("Visuals", "Background", new(0x56, 0x00, 0xA5, 0xFF), "What color should the background be?");
ForegroundColor = Config.Bind<Color32>("Visuals", "Foreground", new(0xFF, 0xFF, 0xFF, 0xFF), "What color should the foreground be?");

Expand Down Expand Up @@ -67,8 +61,8 @@ private static void WindowElements(int _)
groupToggle.Bound.Value = GUILayout.Toggle(groupToggle.Bound._value, element.name, options);
else if (element is UIElement<float> groupSlider)
{
GUILayout.Label(element.name, options);
float val = groupSlider.Bound._value;
GUILayout.Label(element.name + " (" + val + ")", options);
groupSlider.Bound.Value = GUILayout.HorizontalSlider(val, val - 10, val + 10, options);
}
else if (element.GetType() == typeof(UIElement))
Expand Down

0 comments on commit e80f84b

Please sign in to comment.