mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-22 16:39:29 +01:00
Add some better handling for Highlights, add copy/paste buttons for colors.
This commit is contained in:
parent
805e192d63
commit
d13e3ccbd7
5 changed files with 113 additions and 36 deletions
|
|
@ -1,4 +1,6 @@
|
|||
namespace Glamourer.GameData;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Glamourer.GameData;
|
||||
|
||||
public readonly struct CustomizeParameterValue
|
||||
{
|
||||
|
|
@ -47,4 +49,30 @@ public readonly struct CustomizeParameterValue
|
|||
|
||||
public override string ToString()
|
||||
=> _data.ToString();
|
||||
|
||||
public string ToJson()
|
||||
{
|
||||
try
|
||||
{
|
||||
return JsonConvert.SerializeObject(_data, Formatting.None);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FromJson(string input, out CustomizeParameterValue value)
|
||||
{
|
||||
try
|
||||
{
|
||||
value = new CustomizeParameterValue(JsonConvert.DeserializeObject<Vector4>(input));
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
value = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue