Fixed string comparisons
Added CCursor.ReloadTextures without position flickering
This commit is contained in:
1 parent
a2c1ee67ad
commit
7f5cbbf686
16 files changed
+90
-126
No files matched your search
@@ -186,7 +186,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
SCoverTheme coverTheme = _CoverTheme(coverThemeName);
|
||||
|
||||
if (coverTheme.Name == "")
|
||||
if (String.IsNullOrEmpty(coverTheme.Name))
|
||||
return;
|
||||
CXMLReader xmlReader = CXMLReader.OpenFile(Path.Combine(CSettings.FolderCover, coverTheme.File));
|
||||
|
||||
|
||||
+24
-59
@@ -32,29 +32,26 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
class CCursor
|
||||
{
|
||||
private readonly Stopwatch _CursorFadingTimer;
|
||||
private float _CursorTargetAlpha;
|
||||
private readonly Stopwatch _CursorFadingTimer = new Stopwatch();
|
||||
private float _CursorTargetAlpha = 1f;
|
||||
private float _CursorStartAlpha;
|
||||
private float _CursorFadingTime;
|
||||
private float _CursorFadingTime = 0.5f;
|
||||
private CTexture _Cursor;
|
||||
private readonly string _CursorName = String.Empty;
|
||||
|
||||
private readonly Stopwatch _Movetimer;
|
||||
private readonly Stopwatch _Movetimer = new Stopwatch();
|
||||
|
||||
public bool ShowCursor;
|
||||
public bool ShowCursor = true;
|
||||
public bool Visible = true;
|
||||
public bool CursorVisible = true;
|
||||
|
||||
public int X
|
||||
{
|
||||
get { return (int)_Cursor.Rect.X; }
|
||||
set { UpdatePosition(value, (int)_Cursor.Rect.Y); }
|
||||
}
|
||||
|
||||
public int Y
|
||||
{
|
||||
get { return (int)_Cursor.Rect.Y; }
|
||||
set { UpdatePosition((int)_Cursor.Rect.X, value); }
|
||||
}
|
||||
|
||||
public bool IsActive
|
||||
@@ -62,25 +59,6 @@ namespace Vocaluxe.Base
|
||||
get { return _Movetimer.IsRunning; }
|
||||
}
|
||||
|
||||
public CCursor(string textureName, SColorF color, float w, float h, float z)
|
||||
{
|
||||
_CursorFadingTimer = new Stopwatch();
|
||||
ShowCursor = true;
|
||||
_CursorTargetAlpha = 1f;
|
||||
_CursorStartAlpha = 0f;
|
||||
_CursorFadingTime = 0.5f;
|
||||
|
||||
_CursorName = textureName;
|
||||
_Cursor = CDraw.AddTexture(CTheme.GetSkinFilePath(_CursorName, -1));
|
||||
|
||||
_Cursor.Color = color;
|
||||
_Cursor.Rect.W = w;
|
||||
_Cursor.Rect.H = h;
|
||||
_Cursor.Rect.Z = z;
|
||||
|
||||
_Movetimer = new Stopwatch();
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (_Movetimer.IsRunning && _Movetimer.ElapsedMilliseconds / 1000f > CSettings.MouseMoveOffTime)
|
||||
@@ -128,6 +106,17 @@ namespace Vocaluxe.Base
|
||||
_Cursor.Rect.Y = y;
|
||||
}
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
_Cursor = CDraw.AddTexture(CTheme.GetSkinFilePath(CTheme.Cursor.SkinName, -1));
|
||||
|
||||
_Cursor.Color = !String.IsNullOrEmpty(CTheme.Cursor.Color)
|
||||
? CTheme.GetColor(CTheme.Cursor.Color, -1) : new SColorF(CTheme.Cursor.R, CTheme.Cursor.G, CTheme.Cursor.B, CTheme.Cursor.A);
|
||||
_Cursor.Rect.W = CTheme.Cursor.W;
|
||||
_Cursor.Rect.H = CTheme.Cursor.H;
|
||||
_Cursor.Rect.Z = CSettings.ZNear;
|
||||
}
|
||||
|
||||
public void UnloadTextures()
|
||||
{
|
||||
CDraw.RemoveTexture(ref _Cursor);
|
||||
@@ -135,9 +124,11 @@ namespace Vocaluxe.Base
|
||||
|
||||
public void ReloadTextures()
|
||||
{
|
||||
int x = X;
|
||||
int y = Y;
|
||||
UnloadTextures();
|
||||
|
||||
_Cursor = CDraw.AddTexture(CTheme.GetSkinFilePath(_CursorName, -1));
|
||||
LoadTextures();
|
||||
UpdatePosition(x, y);
|
||||
}
|
||||
|
||||
public void FadeOut()
|
||||
@@ -175,7 +166,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
private static bool _Fading;
|
||||
private static Stopwatch _FadingTimer;
|
||||
private static CCursor _Cursor;
|
||||
private static readonly CCursor _Cursor = new CCursor();
|
||||
private static float _GlobalAlpha;
|
||||
private static float _ZOffset;
|
||||
|
||||
@@ -252,12 +243,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void LoadTheme()
|
||||
{
|
||||
_Cursor = new CCursor(
|
||||
CTheme.Cursor.SkinName,
|
||||
new SColorF(CTheme.Cursor.R, CTheme.Cursor.G, CTheme.Cursor.B, CTheme.Cursor.A),
|
||||
CTheme.Cursor.W,
|
||||
CTheme.Cursor.H,
|
||||
CSettings.ZNear);
|
||||
_Cursor.LoadTextures();
|
||||
|
||||
for (int i = 0; i < _Screens.Count; i++)
|
||||
{
|
||||
@@ -276,7 +262,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void ReloadTheme()
|
||||
{
|
||||
_ReloadCursor();
|
||||
_Cursor.ReloadTextures();
|
||||
foreach (IMenu screen in _Screens)
|
||||
screen.ReloadTheme(CTheme.GetThemeScreensPath(-1));
|
||||
|
||||
@@ -286,7 +272,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void ReloadSkin()
|
||||
{
|
||||
_ReloadCursor();
|
||||
_Cursor.ReloadTextures();
|
||||
foreach (IMenu menu in _Screens)
|
||||
menu.ReloadTextures();
|
||||
|
||||
@@ -782,27 +768,6 @@ namespace Vocaluxe.Base
|
||||
y += rect.Height;
|
||||
}
|
||||
}
|
||||
|
||||
private static void _ReloadCursor()
|
||||
{
|
||||
_Cursor.UnloadTextures();
|
||||
|
||||
if (CTheme.Cursor.Color != "")
|
||||
{
|
||||
SColorF color = CTheme.GetColor(CTheme.Cursor.Color, -1);
|
||||
CTheme.Cursor.R = color.R;
|
||||
CTheme.Cursor.G = color.G;
|
||||
CTheme.Cursor.B = color.B;
|
||||
CTheme.Cursor.A = color.A;
|
||||
}
|
||||
|
||||
_Cursor = new CCursor(
|
||||
CTheme.Cursor.SkinName,
|
||||
new SColorF(CTheme.Cursor.R, CTheme.Cursor.G, CTheme.Cursor.B, CTheme.Cursor.A),
|
||||
CTheme.Cursor.W,
|
||||
CTheme.Cursor.H,
|
||||
CSettings.ZNear);
|
||||
}
|
||||
#endregion private stuff
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ namespace Vocaluxe.Base
|
||||
return String.Empty;
|
||||
|
||||
SProfile profile = _Profiles[profileID];
|
||||
if (profile.PlayerName != "")
|
||||
if (!String.IsNullOrEmpty(profile.PlayerName))
|
||||
profile.PlayerName = profile.PlayerName.Remove(profile.PlayerName.Length - 1);
|
||||
_Profiles[profileID] = profile;
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
if (_Profiles[profileID].ProfileFile == "")
|
||||
if (String.IsNullOrEmpty(_Profiles[profileID].ProfileFile))
|
||||
return;
|
||||
try
|
||||
{
|
||||
@@ -311,9 +311,9 @@ namespace Vocaluxe.Base
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
if (_Profiles[profileID].ProfileFile == "")
|
||||
if (String.IsNullOrEmpty(_Profiles[profileID].ProfileFile))
|
||||
{
|
||||
string filename = string.Empty;
|
||||
string filename = "";
|
||||
foreach (char chr in _Profiles[profileID].PlayerName)
|
||||
{
|
||||
if (char.IsLetter(chr))
|
||||
|
||||
@@ -809,7 +809,7 @@ namespace Vocaluxe.Base
|
||||
writer.WriteElementString("W", Cursor.W.ToString("#0.000"));
|
||||
writer.WriteElementString("H", Cursor.H.ToString("#0.000"));
|
||||
|
||||
if (Cursor.Color != "")
|
||||
if (!String.IsNullOrEmpty(Cursor.Color))
|
||||
writer.WriteElementString("Color", Cursor.Color);
|
||||
else
|
||||
{
|
||||
@@ -871,7 +871,7 @@ namespace Vocaluxe.Base
|
||||
public static SColorF GetPlayerColor(string playerNrString, int skinIndex, out bool success)
|
||||
{
|
||||
int selection = 0;
|
||||
if (playerNrString.StartsWith("Player"))
|
||||
if (playerNrString != null && playerNrString.StartsWith("Player"))
|
||||
int.TryParse(playerNrString.Substring(6), out selection);
|
||||
|
||||
return GetPlayerColor(selection, skinIndex, out success);
|
||||
@@ -885,13 +885,12 @@ namespace Vocaluxe.Base
|
||||
public static SColorF GetPlayerColor(int playerNr, int skinIndex, out bool success)
|
||||
{
|
||||
success = false;
|
||||
SColorF color = new SColorF(1f, 1f, 1f, 1f);
|
||||
|
||||
if (_Skins[skinIndex].PartyModeID != -1)
|
||||
skinIndex = GetSkinIndex(-1);
|
||||
|
||||
if (_Skins[skinIndex].ThemeColors.Player.Length < playerNr || playerNr < 1)
|
||||
return color;
|
||||
return new SColorF(1f, 1f, 1f, 1f);
|
||||
|
||||
success = true;
|
||||
return _Skins[skinIndex].ThemeColors.Player[playerNr - 1];
|
||||
|
||||
@@ -614,7 +614,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
CDraw.RemoveTexture(ref _CurrentVideoTexture);
|
||||
|
||||
if (song.VideoFileName != "")
|
||||
if (!String.IsNullOrEmpty(song.VideoFileName))
|
||||
{
|
||||
_CurrentVideo = CVideo.Load(Path.Combine(song.Folder, song.VideoFileName));
|
||||
CVideo.Skip(_CurrentVideo, song.Start, song.VideoGap);
|
||||
@@ -622,7 +622,7 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
|
||||
CDraw.RemoveTexture(ref _Background);
|
||||
if (song.BackgroundFileName != "")
|
||||
if (!String.IsNullOrEmpty(song.BackgroundFileName))
|
||||
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
|
||||
|
||||
_SingNotes[_SingBars].Reset();
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -140,13 +140,13 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void Resume()
|
||||
{
|
||||
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName != "" && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
if (_Theme.Type == EBackgroundTypes.Video && !String.IsNullOrEmpty(_Theme.VideoName) && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
CBase.Theme.SkinVideoResume(_Theme.VideoName, _PartyModeID);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
if (_Theme.VideoName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.VideoName))
|
||||
CBase.Theme.SkinVideoPause(_Theme.VideoName, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace VocaluxeLib.Menu
|
||||
ok = _DrawVideo();
|
||||
}
|
||||
|
||||
if (_Theme.TextureName != "" &&
|
||||
if (!String.IsNullOrEmpty(_Theme.TextureName) &&
|
||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
|
||||
ok = _DrawTexture();
|
||||
@@ -182,7 +182,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -233,7 +233,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -341,10 +341,10 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
Text.LoadTextures();
|
||||
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Equalizer color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -186,7 +186,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
writer.WriteComment("<MaxColor>: Equalizer color for maximal volume from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <MaxR>, <MaxG>, <MaxB>, <MaxA> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("MaxColor", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -274,10 +274,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.MaxColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.MaxColorName))
|
||||
MaxColor = CBase.Theme.GetColor(_Theme.MaxColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Lyric text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -184,7 +184,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Highlighted lyric color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -521,10 +521,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
_ColorProcessed = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ColorEmptyTile>: Static color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorEmptyTileName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorEmptyTileName))
|
||||
writer.WriteElementString("ColorEmptyTile", _Theme.ColorEmptyTileName);
|
||||
else
|
||||
{
|
||||
@@ -224,7 +224,7 @@ namespace VocaluxeLib.Menu
|
||||
writer.WriteComment("<Font>: Text font name");
|
||||
writer.WriteElementString("Font", _Theme.NameFont);
|
||||
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
|
||||
if (_Theme.NameColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.NameColorName))
|
||||
writer.WriteElementString("Color", _Theme.NameColorName);
|
||||
else
|
||||
{
|
||||
@@ -464,10 +464,10 @@ namespace VocaluxeLib.Menu
|
||||
_TextureEmptyTile = CBase.Theme.GetSkinTexture(_Theme.TextureEmptyTileName, _PartyModeID);
|
||||
_TextureTileSelected = CBase.Theme.GetSkinTexture(_Theme.TextureTileSelectedName, _PartyModeID);
|
||||
|
||||
if (_Theme.ColorEmptyTileName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorEmptyTileName))
|
||||
ColorEmptyTile = CBase.Theme.GetColor(_Theme.ColorEmptyTileName, _PartyModeID);
|
||||
|
||||
if (_Theme.NameColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.NameColorName))
|
||||
_Theme.NameColor = CBase.Theme.GetColor(_Theme.NameColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace VocaluxeLib.Menu
|
||||
public void Draw()
|
||||
{
|
||||
// ReSharper disable ConvertIfStatementToConditionalTernaryExpression
|
||||
if (_TextureName != "")
|
||||
if (!String.IsNullOrEmpty(_TextureName))
|
||||
// ReSharper restore ConvertIfStatementToConditionalTernaryExpression
|
||||
CBase.Drawing.DrawTexture(CBase.Theme.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
|
||||
else
|
||||
@@ -424,7 +424,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: ParticleEffect color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -535,7 +535,7 @@ namespace VocaluxeLib.Menu
|
||||
h = 0;
|
||||
|
||||
CParticle star;
|
||||
if (_Theme.TextureName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.TextureName))
|
||||
{
|
||||
star = new CParticle(_PartyModeID, _Theme.TextureName, Color,
|
||||
CBase.Game.GetRandom(w) + Rect.X - size / 4f,
|
||||
@@ -596,9 +596,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
if (_Theme.TextureName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.TextureName))
|
||||
Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ColorBackground>: Button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <BackgroundR>, <BackgroundG>, <BackgroundB>, <BackgroundA> (lower priority)");
|
||||
if (_Theme.ColorBackgroundName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorBackgroundName))
|
||||
writer.WriteElementString("ColorBackground", _Theme.ColorBackgroundName);
|
||||
else
|
||||
{
|
||||
@@ -384,7 +384,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColorBackground>: Selected paylist-entry color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SBackgroundR>, <SBackgroundG>, <SBackgroundB>, <SBackgroundA> (lower priority)");
|
||||
if (_Theme.SelColorBackgroundName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorBackgroundName))
|
||||
writer.WriteElementString("SColorBackground", _Theme.SelColorBackgroundName);
|
||||
else
|
||||
{
|
||||
@@ -463,10 +463,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorBackgroundName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorBackgroundName))
|
||||
BackgroundColor = CBase.Theme.GetColor(_Theme.ColorBackgroundName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorBackgroundName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorBackgroundName))
|
||||
BackgroundSelColor = CBase.Theme.GetColor(_Theme.SelColorBackgroundName, _PartyModeID);
|
||||
|
||||
_Theme.Text1.LoadTextures();
|
||||
@@ -517,7 +517,7 @@ namespace VocaluxeLib.Menu
|
||||
break;
|
||||
case Keys.Delete:
|
||||
case Keys.Back:
|
||||
if (_Theme.ButtonPlaylistName.Text.Text != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ButtonPlaylistName.Text.Text))
|
||||
_Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -424,7 +424,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -436,7 +436,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <HR>, <HG>, <HB>, <HA> (lower priority)");
|
||||
if (_Theme.HighlightColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.HighlightColorName))
|
||||
writer.WriteElementString("HColor", _Theme.HighlightColorName);
|
||||
else
|
||||
{
|
||||
@@ -448,7 +448,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ArrowColor>: Arrow color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)");
|
||||
if (_Theme.ArrowColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ArrowColorName))
|
||||
writer.WriteElementString("ArrowColor", _Theme.ArrowColorName);
|
||||
else
|
||||
{
|
||||
@@ -460,7 +460,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ArrowSColor>: Selected arrow color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)");
|
||||
if (_Theme.SelArrowColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelArrowColorName))
|
||||
writer.WriteElementString("ArrowSColor", _Theme.SelArrowColorName);
|
||||
else
|
||||
{
|
||||
@@ -472,7 +472,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<TextColor>: Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)");
|
||||
if (_Theme.TextColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.TextColorName))
|
||||
writer.WriteElementString("TextColor", _Theme.TextColorName);
|
||||
else
|
||||
{
|
||||
@@ -484,7 +484,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<TextSColor>: Selected text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)");
|
||||
if (_Theme.SelTextColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelTextColorName))
|
||||
writer.WriteElementString("TextSColor", _Theme.SelTextColorName);
|
||||
else
|
||||
{
|
||||
@@ -787,25 +787,25 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.HighlightColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.HighlightColorName))
|
||||
HighlightColor = CBase.Theme.GetColor(_Theme.HighlightColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.ArrowColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ArrowColorName))
|
||||
ColorArrow = CBase.Theme.GetColor(_Theme.ArrowColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelArrowColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelArrowColorName))
|
||||
SelColorArrow = CBase.Theme.GetColor(_Theme.SelArrowColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.TextColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.TextColorName))
|
||||
TextColor = CBase.Theme.GetColor(_Theme.TextColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
SelTextColor = CBase.Theme.GetColor(_Theme.SelTextColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace VocaluxeLib.Menu
|
||||
private CTexture _Texture;
|
||||
public CTexture Texture
|
||||
{
|
||||
get { return _Texture?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
|
||||
get { return _Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
|
||||
|
||||
set { _Texture = value; }
|
||||
}
|
||||
@@ -59,9 +59,9 @@ namespace VocaluxeLib.Menu
|
||||
public float ReflectionHeight;
|
||||
|
||||
public bool Selected;
|
||||
public bool Visible=true;
|
||||
public bool Visible = true;
|
||||
|
||||
public float Alpha=1;
|
||||
public float Alpha = 1;
|
||||
|
||||
public EAspect Aspect = EAspect.Stretch;
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Static color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -244,7 +244,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -408,7 +408,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -521,10 +521,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.SelColorName))
|
||||
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -548,7 +548,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
Init();
|
||||
|
||||
if (_Theme.ColorName != "")
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user