Show an error if no profiles found and disable gaming

This commit is contained in:
Flamefire committed 2014-09-07 19:33:28 +02:00
1 parent 64c142345b
commit e9b584d84c
5 files changed
+106 -12

No files matched your search

+1
View File
@@ -93,6 +93,7 @@
<string name="TR_SCREENMAIN_BUTTON_PARTY">Party</string>
<string name="TR_SCREENMAIN_BUTTON_OPTIONS">Options</string>
<string name="TR_SCREENMAIN_BUTTON_PROFILES">Profiles</string>
<string name="TR_SCREENMAIN_TEXT_NOPROFILES">No profiles found!</string>
<string name="TR_SCREENPARTY_TITLE">Party Mode Selection</string>
<string name="TR_SCREENPARTY_MODES">Party Mode</string>
<string name="TR_SCREENPARTY_DESCRIPTION">Description</string>
+1
View File
@@ -92,6 +92,7 @@
<string name="TR_SCREENMAIN_BUTTON_PARTY">Party</string>
<string name="TR_SCREENMAIN_BUTTON_OPTIONS">Optionen</string>
<string name="TR_SCREENMAIN_BUTTON_PROFILES">Profile</string>
<string name="TR_SCREENMAIN_TEXT_NOPROFILES">Keine Profile gefunden!</string>
<string name="TR_SCREENPARTY_TITLE">Party-Modus Auswahl</string>
<string name="TR_SCREENPARTY_MODES">Party-Modus</string>
<string name="TR_SCREENPARTY_DESCRIPTION">Beschreibung</string>
+75 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<ScreenMain>
<ScreenVersion>1</ScreenVersion>
<ScreenVersion>2</ScreenVersion>
<Background1>
<!--<Type>: Background type: None, Color, Texture, Video-->
<Type>Video</Type>
@@ -314,5 +314,79 @@
<Height>26</Height>
</SReflection>
</ButtonExit>
<TextRelease>
<!--<X>, <Y>: Text position-->
<X>10</X>
<Y>690</Y>
<!--<Z>: Text position-->
<Z>-1</Z>
<!--<H>: Text height-->
<H>15</H>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>TextWhite</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextWhite</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Left</Align>
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
<HAlign>Center</HAlign>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Normal</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Nothing or translation tag-->
<Text />
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</TextRelease>
<StaticWarningProfiles>
<!--<Skin>: Texture name-->
<Skin>TextBG</Skin>
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
<X>150</X>
<Y>610</Y>
<Z>-1,90</Z>
<W>355</W>
<H>30</H>
<!--<Color>: Static color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticWarningColor</Color>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</StaticWarningProfiles>
<TextWarningProfiles>
<!--<X>, <Y>: Text position-->
<X>320</X>
<Y>612</Y>
<!--<Z>: Text position-->
<Z>-2,00</Z>
<!--<H>: Text height-->
<H>27</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>355</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>TextWarningColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextWarningColor</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Center</Align>
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
<HAlign>Center</HAlign>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Outline</Font>
<!--<Text>: Nothing or translation tag-->
<Text>TR_SCREENMAIN_TEXT_NOPROFILES</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</TextWarningProfiles>
</ScreenMain>
</root>
@@ -0,0 +1,10 @@
SceenMain
++++++++++
Version 2:
Add:
<StaticWarningProfiles>
<TextWarningProfiles>
<TextRelease>
+19 -11
View File
@@ -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;
}