Move and Rename reading of SColorF
This commit is contained in:
1 parent
a2720c2108
commit
4efd670747
5 files changed
+15
-15
No files matched your search
@@ -338,7 +338,7 @@ namespace Vocaluxe.Base.Fonts
|
|||||||
ok &= xmlReader.GetValue("//root/Fonts/Font" + i + "/FileBold", out sf.FileBold);
|
ok &= xmlReader.GetValue("//root/Fonts/Font" + i + "/FileBold", out sf.FileBold);
|
||||||
ok &= xmlReader.GetValue("//root/Fonts/Font" + i + "/FileBoldItalic", out sf.FileBoldItalic);
|
ok &= xmlReader.GetValue("//root/Fonts/Font" + i + "/FileBoldItalic", out sf.FileBoldItalic);
|
||||||
ok &= xmlReader.TryGetNormalizedFloatValue("//root/Fonts/Font" + i + "/Outline", ref sf.Outline);
|
ok &= xmlReader.TryGetNormalizedFloatValue("//root/Fonts/Font" + i + "/Outline", ref sf.Outline);
|
||||||
ok &= xmlReader.TryGetColorFromRGBA("//root/Fonts/Font" + i + "/OutlineColor", out sf.OutlineColor);
|
ok &= xmlReader.Read("//root/Fonts/Font" + i + "/OutlineColor", out sf.OutlineColor);
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ namespace Vocaluxe.Base.ThemeSystem
|
|||||||
for (int i = 0; i < CSettings.MaxNumPlayer; i++)
|
for (int i = 0; i < CSettings.MaxNumPlayer; i++)
|
||||||
{
|
{
|
||||||
SColorF color;
|
SColorF color;
|
||||||
if (!xmlReader.TryGetColorFromRGBA("//root/Colors/Player" + (i + 1), out color))
|
if (!xmlReader.Read("//root/Colors/Player" + (i + 1), out color))
|
||||||
return false;
|
return false;
|
||||||
_PlayerColors[i] = color;
|
_PlayerColors[i] = color;
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ namespace Vocaluxe.Base.ThemeSystem
|
|||||||
foreach (string str in names)
|
foreach (string str in names)
|
||||||
{
|
{
|
||||||
SColorF color;
|
SColorF color;
|
||||||
if (!xmlReader.TryGetColorFromRGBA("//root/ColorSchemes/" + str, out color))
|
if (!xmlReader.Read("//root/ColorSchemes/" + str, out color))
|
||||||
return false;
|
return false;
|
||||||
_ColorSchemes.Add(str, color);
|
_ColorSchemes.Add(str, color);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace Vocaluxe.Base.ThemeSystem
|
|||||||
ok &= xmlReader.TryGetFloatValue("//root/Cursor/H", ref CursorTheme.H);
|
ok &= xmlReader.TryGetFloatValue("//root/Cursor/H", ref CursorTheme.H);
|
||||||
|
|
||||||
if (!xmlReader.GetValue("//root/Cursor/Color/Name", out CursorTheme.Color.Name))
|
if (!xmlReader.GetValue("//root/Cursor/Color/Name", out CursorTheme.Color.Name))
|
||||||
ok &= xmlReader.TryGetColorFromRGBA("//root/Cursor/Color/Color", out CursorTheme.Color.Color);
|
ok &= xmlReader.Read("//root/Cursor/Color/Color", out CursorTheme.Color.Color);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,17 +57,6 @@ namespace VocaluxeLib.Xml
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetColorFromRGBA(string xPath, out SColorF value)
|
|
||||||
{
|
|
||||||
value = new SColorF();
|
|
||||||
bool result = true;
|
|
||||||
result &= TryGetNormalizedFloatValue(xPath + "/R", ref value.R);
|
|
||||||
result &= TryGetNormalizedFloatValue(xPath + "/G", ref value.G);
|
|
||||||
result &= TryGetNormalizedFloatValue(xPath + "/B", ref value.B);
|
|
||||||
result &= TryGetNormalizedFloatValue(xPath + "/A", ref value.A);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool GetValue(string xPath, out string value, string defaultValue = "")
|
public override bool GetValue(string xPath, out string value, string defaultValue = "")
|
||||||
{
|
{
|
||||||
int resultCt = 0;
|
int resultCt = 0;
|
||||||
|
|||||||
@@ -77,6 +77,17 @@ namespace VocaluxeLib.Xml
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool Read(string xPath, out SColorF value)
|
||||||
|
{
|
||||||
|
value = new SColorF();
|
||||||
|
bool result = true;
|
||||||
|
result &= TryGetNormalizedFloatValue(xPath + "/R", ref value.R);
|
||||||
|
result &= TryGetNormalizedFloatValue(xPath + "/G", ref value.G);
|
||||||
|
result &= TryGetNormalizedFloatValue(xPath + "/B", ref value.B);
|
||||||
|
result &= TryGetNormalizedFloatValue(xPath + "/A", ref value.A);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public bool CheckVersion(string xPath, int reqVersion)
|
public bool CheckVersion(string xPath, int reqVersion)
|
||||||
{
|
{
|
||||||
int version = 0;
|
int version = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user