Show an error if no profiles found and disable gaming
This commit is contained in:
1 parent
64c142345b
commit
e9b584d84c
5 files changed
+106
-12
No files matched your search
@@ -27,7 +27,7 @@ namespace Vocaluxe.Screens
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
{
|
||||
get { return 1; }
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
private const string _ButtonSing = "ButtonSing";
|
||||
@@ -35,23 +35,30 @@ namespace Vocaluxe.Screens
|
||||
private const string _ButtonOptions = "ButtonOptions";
|
||||
private const string _ButtonProfiles = "ButtonProfiles";
|
||||
private const string _ButtonExit = "ButtonExit";
|
||||
|
||||
private CText _ReleaseText;
|
||||
private const string _StaticWarningProfiles = "StaticWarningProfiles";
|
||||
private const string _TextWarningProfiles = "TextWarningProfiles";
|
||||
private const string _TextRelease = "TextRelease";
|
||||
|
||||
//CParticleEffect Snowflakes;
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_ThemeStatics = new string[] {"StaticMenuBar"};
|
||||
_ThemeStatics = new string[] {"StaticMenuBar", _StaticWarningProfiles};
|
||||
_ThemeButtons = new string[] {_ButtonSing, _ButtonParty, _ButtonOptions, _ButtonProfiles, _ButtonExit};
|
||||
_ThemeTexts = new string[] {_TextRelease, _TextWarningProfiles};
|
||||
}
|
||||
|
||||
public override void LoadTheme(string xmlPath)
|
||||
{
|
||||
base.LoadTheme(xmlPath);
|
||||
|
||||
_ReleaseText = GetNewText(10, 690, -1, 15, -1, EAlignment.Left, EStyle.Normal, "Normal", new SColorF(1f, 1f, 1f, 1f), CSettings.GetFullVersionText());
|
||||
_Texts[_TextRelease].Text = CSettings.GetFullVersionText();
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
_Texts[_TextRelease].Visible = CSettings.VersionRevision != ERevision.Release;
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
_Statics[_StaticWarningProfiles].Visible = false;
|
||||
_Texts[_TextWarningProfiles].Visible = false;
|
||||
}
|
||||
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
@@ -68,7 +75,8 @@ namespace Vocaluxe.Screens
|
||||
break;
|
||||
|
||||
case Keys.S:
|
||||
CGraphics.FadeTo(EScreens.ScreenSong);
|
||||
if (CProfiles.NumProfiles > 0)
|
||||
CGraphics.FadeTo(EScreens.ScreenSong);
|
||||
break;
|
||||
|
||||
case Keys.C:
|
||||
@@ -145,6 +153,11 @@ namespace Vocaluxe.Screens
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
bool profileOK = CProfiles.NumProfiles > 0;
|
||||
_Statics[_StaticWarningProfiles].Visible = !profileOK;
|
||||
_Texts[_TextWarningProfiles].Visible = !profileOK;
|
||||
_Buttons[_ButtonSing].Enabled = profileOK;
|
||||
_Buttons[_ButtonParty].Enabled = profileOK;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -159,11 +172,6 @@ namespace Vocaluxe.Screens
|
||||
//Snowflakes.Draw();
|
||||
_DrawFG();
|
||||
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
if (CSettings.VersionRevision != ERevision.Release)
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
_ReleaseText.Draw();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user