added theme loading for party screens (there is still a lot to do)

This commit is contained in:
Alexander Eckart committed 2012-12-15 16:09:32 +01:00
1 parent 41f8f9ce72
commit 9ec4c31401
33 files changed
+412 -85

No files matched your search

+2
View File
@@ -108,6 +108,8 @@
<TR_SCREENMAIN_BUTTON_PROFILES>Profile</TR_SCREENMAIN_BUTTON_PROFILES>
<!--ScreenParty-->
<TR_SCREENPARTY_TITLE>Party-Modus Auswahl</TR_SCREENPARTY_TITLE>
<TR_SCREENPARTY_MODES>Party-Modus</TR_SCREENPARTY_MODES>
<TR_SCREENPARTY_DESCRIPTION>Beschreibung</TR_SCREENPARTY_DESCRIPTION>
<!--ScreenNames-->
<TR_SCREENNAMES_MENU>Spielerauswahl</TR_SCREENNAMES_MENU>
<TR_SCREENNAMES_PLAYER>Spieler</TR_SCREENNAMES_PLAYER>
+2
View File
@@ -108,6 +108,8 @@
<TR_SCREENMAIN_BUTTON_PROFILES>Profiles</TR_SCREENMAIN_BUTTON_PROFILES>
<!--ScreenParty-->
<TR_SCREENPARTY_TITLE>Party Mode Selection</TR_SCREENPARTY_TITLE>
<TR_SCREENPARTY_MODES>Party Mode</TR_SCREENPARTY_MODES>
<TR_SCREENPARTY_DESCRIPTION>Description</TR_SCREENPARTY_DESCRIPTION>
<!--ScreenNames-->
<TR_SCREENNAMES_MENU>Player Selection</TR_SCREENNAMES_MENU>
<TR_SCREENNAMES_PLAYER>Player</TR_SCREENNAMES_PLAYER>
+2
View File
@@ -108,6 +108,8 @@
<TR_SCREENMAIN_BUTTON_PROFILES>Profils</TR_SCREENMAIN_BUTTON_PROFILES>
<!--ScreenParty-->
<TR_SCREENPARTY_TITLE>TODO: Party Mode Selection</TR_SCREENPARTY_TITLE>
<TR_SCREENPARTY_MODES>TODO: Party Mode</TR_SCREENPARTY_MODES>
<TR_SCREENPARTY_DESCRIPTION>TODO: Description</TR_SCREENPARTY_DESCRIPTION>
<!--ScreenNames-->
<TR_SCREENNAMES_MENU>Sélection des joueurs</TR_SCREENNAMES_MENU>
<TR_SCREENNAMES_PLAYER>Joueur</TR_SCREENNAMES_PLAYER>
+2
View File
@@ -102,6 +102,8 @@
<TR_SCREENMAIN_BUTTON_PROFILES>Perfiles</TR_SCREENMAIN_BUTTON_PROFILES>
<!--ScreenParty-->
<TR_SCREENPARTY_TITLE>TODO: Party Mode Selection</TR_SCREENPARTY_TITLE>
<TR_SCREENPARTY_MODES>TODO: Party Mode</TR_SCREENPARTY_MODES>
<TR_SCREENPARTY_DESCRIPTION>TODO: Description</TR_SCREENPARTY_DESCRIPTION>
<!--ScreenNames-->
<TR_SCREENNAMES_MENU>Selección de Jugadores</TR_SCREENNAMES_MENU>
<TR_SCREENNAMES_PLAYER>Jugador</TR_SCREENNAMES_PLAYER>
+2 -1
View File
@@ -2,8 +2,9 @@
<root>
<PartyModeSystemVersion>1</PartyModeSystemVersion>
<Info>
<Name>Challenge</Name>
<Name>TR_PARTYMODE_NAME</Name>
<Author>brunzel</Author>
<Description>TR_PARTYMODE_DESCRIPTION</Description>
<Folder>Challenge</Folder>
<PartyModeFile>PartyModeChallenge</PartyModeFile>
<PartyModeVersionMajor>0</PartyModeVersionMajor>
@@ -25,13 +25,15 @@ namespace Vocaluxe.PartyModes
_ScreenVersion = ScreenVersion;
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme(XmlPath);
Warning = GetNewText();
Warning.Height = 100f;
Warning.X = 150;
Warning.Y = 300;
Warning.Fon = "Normal";
Warning.Fon = "Outline";
Warning.Style = EStyle.Normal;
Warning.Color = new SColorF(1f, 0f, 0f, 1f);
Warning.SColor = new SColorF(1f, 0f, 0f, 1f);
+154 -1
View File
@@ -58,7 +58,160 @@
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text1>
<ButtonExit>
<Text2>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>105</Y>
<!--<Z>: Text position-->
<Z>0,00</Z>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Left</Align>
<!--<HAlign>: 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_SCREENPARTY_MODES</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text2>
<Text3>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>165</Y>
<!--<Z>: Text position-->
<Z>0,00</Z>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Left</Align>
<!--<HAlign>: 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_SCREENPARTY_DESCRIPTION</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text3>
<TextDescription>
<!--<X>, <Y>: Text position-->
<X>850</X>
<Y>165</Y>
<!--<Z>: Text position-->
<Z>0,00</Z>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>600</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Center</Align>
<!--<HAlign>: 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></Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</TextDescription>
<SelectSlideModes>
<!--<Skin>: Texture name-->
<Skin>Invisible</Skin>
<!--<SkinArrowLeft>: Texture name of left arrow-->
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<!--<SkinArrowRight>: Texture name of right arrow-->
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<!--<SkinSelected>: Texture name for selected SelectSlide-->
<SkinSelected>SelectSlide</SkinSelected>
<!--<SkinArrowLeftSelected>: Texture name of selected left arrow-->
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<!--<SkinArrowRightSelected>: Texture name of selected right arrow-->
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<!--<SkinHighlighted>: Texture name for highlighted SelectSlide-->
<SkinHighlighted>SelectSlide</SkinHighlighted>
<!--<X>, <Y>, <Z>, <W>, <H>: SelectSlide position, width and height-->
<X>500</X>
<Y>100</Y>
<Z>0,00</Z>
<W>700</W>
<H>50</H>
<!--<ArrowLeftX>, <ArrowLeftY>, <ArrowLeftZ>, <ArrowLeftW>, <ArrowLeftH>: Left arrow position, width and height-->
<ArrowLeftX>505</ArrowLeftX>
<ArrowLeftY>105</ArrowLeftY>
<ArrowLeftZ>0,00</ArrowLeftZ>
<ArrowLeftW>40</ArrowLeftW>
<ArrowLeftH>40</ArrowLeftH>
<!--<ArrowRightX>, <ArrowRightY>, <ArrowRightZ>, <ArrowRightW>, <ArrowRightH>: Right arrow position, width and height-->
<ArrowRightX>1170</ArrowRightX>
<ArrowRightY>105</ArrowRightY>
<ArrowRightZ>0,00</ArrowRightZ>
<ArrowRightW>40</ArrowRightW>
<ArrowRightH>40</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor>
<!--<ArrowSColor>: Selected arrow color from ColorScheme (high priority)-->
<!--or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)-->
<ArrowSColor>ArrowSColor</ArrowSColor>
<!--<TextColor>: Text color from ColorScheme (high priority)-->
<!--or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)-->
<TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor>
<!--<TextH>: Text height-->
<TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)-->
<TextMaxW>600</TextMaxW>
<!--<TextFont>: Text font name-->
<TextFont>Outline</TextFont>
<!--<TextStyle>: Text style: Normal, Italic, Bold, BoldItalic-->
<TextStyle>Bold</TextStyle>
<!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>1</NumVisible>
</SelectSlideModes>
<ButtonExit>
<!--<Skin>: Texture name-->
<Skin>Button</Skin>
<!--<SkinSelected>: Texture name for selected button-->
+1 -1
View File
@@ -608,7 +608,7 @@ namespace Vocaluxe.Base
public static RectangleF GetTextBounds(CText text, float height)
{
Height = height;
return new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text)), GetTextHeight(CLanguage.Translate(text.Text)));
return new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text, text.PartyModeID)), GetTextHeight(CLanguage.Translate(text.Text, text.PartyModeID)));
}
public static float GetTextWidth(string text)
+4 -4
View File
@@ -253,14 +253,14 @@ namespace Vocaluxe.Base
{
CLog.StartBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
_Screens[i].Initialize(CMain.Base);
_Screens[i].LoadTheme();
_Screens[i].LoadTheme(CTheme.GetThemeScreensPath());
CLog.StopBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
}
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].Initialize(CMain.Base);
_PopupScreens[i].LoadTheme();
_PopupScreens[i].LoadTheme(CTheme.GetThemeScreensPath());
}
}
@@ -274,7 +274,7 @@ namespace Vocaluxe.Base
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].ReloadTheme();
_PopupScreens[i].ReloadTheme();
}
}
@@ -302,7 +302,7 @@ namespace Vocaluxe.Base
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].SaveTheme();
_PopupScreens[i].SaveTheme();
}
}
+45 -17
View File
@@ -94,9 +94,11 @@ namespace Vocaluxe.Base
public static string Translate(string KeyWord)
{
if (KeyWord == null)
return null;
return Translate(KeyWord, -1);
}
public static string Translate(string KeyWord, int PartyModeID)
{
if (KeyWord.Length < 3)
return KeyWord;
@@ -104,14 +106,38 @@ namespace Vocaluxe.Base
if (tag != "TR_")
return KeyWord;
string result = String.Empty;
try
string result = null;
int PartyModeNr = GetPartyModeNr(PartyModeID, _CurrentLanguage);
if (PartyModeID != -1)
{
result = (string)_Languages[_CurrentLanguage].Texts[KeyWord];
if (PartyModeNr != -1)
{
try
{
result = (string)_Languages[_CurrentLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
}
catch { }
}
if (result == null && (PartyModeNr = GetPartyModeNr(PartyModeID, _FallbackLanguage)) != -1)
{
try
{
result = (string)_Languages[_FallbackLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
}
catch { }
}
}
catch (Exception)
if (result == null)
{
;
try
{
result = (string)_Languages[_CurrentLanguage].Texts[KeyWord];
}
catch { }
}
if (result == null)
@@ -121,10 +147,7 @@ namespace Vocaluxe.Base
{
result = (string)_Languages[_FallbackLanguage].Texts[KeyWord];
}
catch (Exception)
{
;
}
catch { }
if (result == null)
return KeyWord;
@@ -134,6 +157,11 @@ namespace Vocaluxe.Base
}
public static bool TranslationExists(string KeyWord)
{
return TranslationExists(KeyWord, -1);
}
public static bool TranslationExists(string KeyWord, int PartyModeID)
{
if (KeyWord.Length < 3)
return false;
@@ -144,23 +172,23 @@ namespace Vocaluxe.Base
string result = String.Empty;
int PartyModeNr = GetPartyModeNr(CFonts.PartyModeID, _CurrentLanguage);
if (CFonts.PartyModeID != -1)
int PartyModeNr = GetPartyModeNr(PartyModeID, _CurrentLanguage);
if (PartyModeID != -1)
{
if (PartyModeNr != -1)
{
try
{
result = (string)_Languages[_CurrentLanguage].PartyModeTexts[CFonts.PartyModeID].Texts[KeyWord];
result = (string)_Languages[_CurrentLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
}
catch { }
}
if (result == null && (PartyModeNr = GetPartyModeNr(CFonts.PartyModeID, _FallbackLanguage)) != -1)
if (result == null && (PartyModeNr = GetPartyModeNr(PartyModeID, _FallbackLanguage)) != -1)
{
try
{
result = (string)_Languages[_FallbackLanguage].PartyModeTexts[CFonts.PartyModeID].Texts[KeyWord];
result = (string)_Languages[_FallbackLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
}
catch { }
}
@@ -195,7 +223,7 @@ namespace Vocaluxe.Base
public static bool LoadPartyLanguageFiles(int PartyModeID, string Path)
{
List<string> files = new List<string>();
files.AddRange(Helper.ListFiles(CSettings.sFolderLanguages, "*.xml", true, true));
files.AddRange(Helper.ListFiles(Path, "*.xml", true, true));
foreach (string file in files)
{
+5
View File
@@ -437,6 +437,11 @@ namespace Vocaluxe.Base
return CLanguage.Translate(KeyWord);
}
public string Translate(string KeyWord, int PartyModeID)
{
return CLanguage.Translate(KeyWord, PartyModeID);
}
public bool TranslationExists(string KeyWord)
{
return CLanguage.TranslationExists(KeyWord);
+60 -15
View File
@@ -18,6 +18,7 @@ namespace Vocaluxe.Base
public int PartyModeID;
public int PartyModeSystemVersion;
public string Name;
public string Description;
public string Author;
public string Folder;
public string PartyModeFile;
@@ -41,17 +42,7 @@ namespace Vocaluxe.Base
private static int _NormalGameModeID;
private static SPartyMode _CurrentPartyMode;
public static int CurrentPartyModeID
{
get { return _CurrentPartyMode.PartyModeID; }
}
#region public stuff
public static int NumModes
{
get { return 0 ; } //first mode is the dummy normal game mode
}
public static void Init()
{
Helper = new CHelper();
@@ -74,6 +65,53 @@ namespace Vocaluxe.Base
//load other party modes
LoadPartyModes();
}
public static int CurrentPartyModeID
{
get
{
if (_CurrentPartyMode.PartyModeID != _NormalGameModeID)
return _CurrentPartyMode.PartyModeID;
return -1;
}
}
public static int NumModes
{
get { return _PartyModes.Count; }
}
public static List<SPartyModeInfos> GetPartyModeInfos()
{
List<SPartyModeInfos> infos = new List<SPartyModeInfos>();
int[] UsedKeys = new int[_PartyModes.Count];
_PartyModes.Keys.CopyTo(UsedKeys, 0);
for (int i = 0; i < UsedKeys.Length; i++)
{
if (UsedKeys[i] != _NormalGameModeID)
{
SPartyMode mode = new SPartyMode();
_PartyModes.TryGetValue(UsedKeys[i], out mode);
if (mode.PartyMode != null)
{
SPartyModeInfos info = new SPartyModeInfos();
info.Author = mode.Author;
info.Description = mode.Description;
info.Name = mode.Name;
info.PartyModeID = mode.PartyModeID;
info.Playable = mode.NoErrors;
infos.Add(info);
}
}
}
return infos;
}
public static void SetNormalGameMode()
{
@@ -94,7 +132,7 @@ namespace Vocaluxe.Base
NextScreen = new CScreenPartyDummy();
NextScreen.Initialize(CMain.Base);
NextScreen.LoadTheme();
NextScreen.LoadTheme(String.Empty);
return NextScreen;
}
#endregion public stuff
@@ -135,7 +173,6 @@ namespace Vocaluxe.Base
foreach (string file in files)
{
SPartyMode pm = LoadPartyMode(file);
pm.PartyModeID = _IDs.Dequeue();
_PartyModes.Add(pm.PartyModeID, pm);
}
}
@@ -143,6 +180,7 @@ namespace Vocaluxe.Base
private static SPartyMode LoadPartyMode(string file)
{
SPartyMode pm = new SPartyMode();
pm.PartyModeID = _IDs.Dequeue();
pm.ScreenFiles = new List<string>();
pm.NoErrors = false;
@@ -172,6 +210,7 @@ namespace Vocaluxe.Base
{
loaded &= CHelper.TryGetIntValueFromXML("//root/PartyModeSystemVersion", navigator, ref pm.PartyModeSystemVersion);
loaded &= CHelper.GetValueFromXML("//root/Info/Name", navigator, ref pm.Name, "ERROR Name");
loaded &= CHelper.GetValueFromXML("//root/Info/Description", navigator, ref pm.Description, "ERROR Description");
loaded &= CHelper.GetValueFromXML("//root/Info/Author", navigator, ref pm.Author, "ERROR Author");
loaded &= CHelper.GetValueFromXML("//root/Info/Folder", navigator, ref pm.Folder, "ERROR Folder");
loaded &= CHelper.GetValueFromXML("//root/Info/PartyModeFile", navigator, ref pm.PartyModeFile, "ERROR PartyModeFile");
@@ -227,12 +266,18 @@ namespace Vocaluxe.Base
foreach (string screenfile in pm.ScreenFiles)
{
CMenuParty Screen = GetPartyScreenInstance(Output, screenfile);
CMenuParty Screen = GetPartyScreenInstance(Output, screenfile, Path.Combine(Path.Combine(CSettings.sFolderPartyModes, pm.Folder), CSettings.sFolderPartyModeScreens));
if (Screen != null)
pm.PartyMode.AddScreen(Screen, screenfile);
else
return pm;
}
if (!CLanguage.LoadPartyLanguageFiles(pm.PartyModeID, Path.Combine(Path.Combine(CSettings.sFolderPartyModes, pm.Folder), CSettings.sFolderPartyModeLanguages)))
{
CLog.LogError("Error loading language files for PartyMode: " + file);
return pm;
}
pm.NoErrors = true;
return pm;
@@ -278,7 +323,7 @@ namespace Vocaluxe.Base
return CompileResult.CompiledAssembly;
}
private static CMenuParty GetPartyScreenInstance(Assembly Assembly, string ScreenName)
private static CMenuParty GetPartyScreenInstance(Assembly Assembly, string ScreenName, string XmlPath)
{
if (Assembly == null)
return null;
@@ -301,7 +346,7 @@ namespace Vocaluxe.Base
return null;
}
Screen.Initialize(CMain.Base);
Screen.LoadTheme();
Screen.LoadTheme(XmlPath);
return Screen;
}
#endregion private stuff
+1
View File
@@ -95,6 +95,7 @@ namespace Vocaluxe.Base
public static string sFolderPartyModes = "PartyModes";
public const string sFolderPartyModeCode = "Code";
public const string sFolderPartyModeScreens = "Screens";
public const string sFolderPartyModeLanguages = "Languages";
//public const String[] ToneStrings = new String[]{ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
public const int ToneMin = -36;
@@ -100,9 +100,9 @@ namespace Vocaluxe.Screens
_ThemeButtons = buttons.ToArray();
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
}
@@ -38,9 +38,9 @@ namespace Vocaluxe.Screens
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
SelectSlides[htSelectSlides(SelectSlideVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
+3 -3
View File
@@ -106,7 +106,7 @@ namespace Vocaluxe.Screens
paragraphs.Add(words);
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
//Vocaluxe-Logo
CDataBase.GetCreditsRessource("Logo_voc.png", ref _TexLogo);
@@ -174,9 +174,9 @@ namespace Vocaluxe.Screens
}
public override void ReloadTheme() {}
public override void ReloadTheme() { }
public override void SaveTheme() {}
public override void SaveTheme() { }
public override void UnloadTextures() {}
+2 -2
View File
@@ -40,9 +40,9 @@ namespace Vocaluxe.Screens
_ThemeButtons = new string[] { ButtonSing, ButtonParty, ButtonOptions, ButtonProfiles, ButtonExit };
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
}
public override bool HandleInput(KeyEvent KeyEvent)
+2 -2
View File
@@ -95,9 +95,9 @@ namespace Vocaluxe.Screens
chooseAvatarStatic.Visible = false;
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
_PlayerNr = new int[CSettings.MaxNumPlayer];
for (int i = 0; i < _PlayerNr.Length; i++)
+2 -2
View File
@@ -54,9 +54,9 @@ namespace Vocaluxe.Screens
}
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideLanguage)].AddValues(_Languages);
SelectSlides[htSelectSlides(SelectSlideLanguage)].Selection = _CurrentLang;
+2 -2
View File
@@ -33,9 +33,9 @@ namespace Vocaluxe.Screens
_ThemeSelectSlides = new string[] { SelectSlideLyricStyle, SelectSlideLyricsOnTop };
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideLyricStyle)].SetValues<ELyricStyle>((int)CConfig.LyricStyle);
SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].SetValues<EOffOn>((int)CConfig.LyricsOnTop);
}
+2 -2
View File
@@ -76,9 +76,9 @@ namespace Vocaluxe.Screens
_ThemeEqualizers = new string[] { EqualizerChannel1, EqualizerChannel2 };
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
int max = CSettings.MaxNumPlayer + 1;
if (max > 7)
+2 -2
View File
@@ -40,9 +40,9 @@ namespace Vocaluxe.Screens
_ThemeSelectSlides = new string[] { SelectSlideBackgroundMusic, SelectSlideBackgroundMusicVolume, SelectSlideBackgroundMusicSource, SelectSlidePreviewMusicVolume, SelectSlideGameMusicVolume };
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].SetValues<EOffOn>((int)CConfig.BackgroundMusic);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100"});
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection = CConfig.BackgroundMusicVolume / 5;
+2 -2
View File
@@ -54,9 +54,9 @@ namespace Vocaluxe.Screens
};
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideTheme)].AddValues(CTheme.ThemeNames);
SelectSlides[htSelectSlides(SelectSlideTheme)].Selection = CTheme.GetThemeIndex();
+2 -2
View File
@@ -47,9 +47,9 @@ namespace Vocaluxe.Screens
_ThemeSelectSlides = new string[] { SelectSlideVideoBackgrounds, SelectSlideVideoPreview, SelectSlideVideosInSongs, SelectSlideVideosToBackground, SelectSlideWebcamDevices, SelectSlideWebcamCapabilities };
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].SetValues<EOffOn>((int)CConfig.VideoBackgrounds);
SelectSlides[htSelectSlides(SelectSlideVideoPreview)].SetValues<EOffOn>((int)CConfig.VideoPreview);
+37 -5
View File
@@ -9,10 +9,15 @@ using Vocaluxe.Menu;
namespace Vocaluxe.Screens
{
class CScreenParty : CMenu
{// Version number for theme files. Increment it, if you've changed something on the theme files!
{
// Version number for theme files. Increment it, if you've changed something on the theme files!
const int ScreenVersion = 1;
const string TextDescription = "TextDescription";
const string ButtonExit = "ButtonExit";
const string SelectSlideModes = "SelectSlideModes";
private List<SPartyModeInfos> _PartyModeInfos;
public CScreenParty()
{
@@ -24,12 +29,14 @@ namespace Vocaluxe.Screens
_ThemeName = "ScreenParty";
_ScreenVersion = ScreenVersion;
_ThemeTexts = new string[] { TextDescription };
_ThemeButtons = new string[] { ButtonExit };
_ThemeSelectSlides = new string[] { SelectSlideModes };
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
}
public override bool HandleInput(KeyEvent KeyEvent)
@@ -72,6 +79,9 @@ namespace Vocaluxe.Screens
if (Buttons[htButtons(ButtonExit)].Selected)
CGraphics.FadeTo(EScreens.ScreenMain);
if (SelectSlides[htSelectSlides(SelectSlideModes)].Selected)
UpdateSelection();
}
if (MouseEvent.RB)
@@ -85,6 +95,16 @@ namespace Vocaluxe.Screens
public override void OnShow()
{
base.OnShow();
_PartyModeInfos = CParty.GetPartyModeInfos();
SelectSlides[htSelectSlides(SelectSlideModes)].Clear();
foreach (SPartyModeInfos info in _PartyModeInfos)
{
SelectSlides[htSelectSlides(SelectSlideModes)].AddValue(info.Name, info.PartyModeID);
}
SelectSlides[htSelectSlides(SelectSlideModes)].Selection = 0;
UpdateSelection();
}
public override bool UpdateGame()
@@ -94,8 +114,7 @@ namespace Vocaluxe.Screens
public override bool Draw()
{
base.DrawBG();
base.DrawFG();
base.Draw();
return true;
}
@@ -104,5 +123,18 @@ namespace Vocaluxe.Screens
{
base.OnClose();
}
private void UpdateSelection()
{
if (_PartyModeInfos.Count == 0)
return;
int index = SelectSlides[htSelectSlides(SelectSlideModes)].Selection;
if (index >= _PartyModeInfos.Count)
return;
Texts[htTexts(TextDescription)].PartyModeID = _PartyModeInfos[index].PartyModeID;
Texts[htTexts(TextDescription)].Text = _PartyModeInfos[index].Description;
}
}
}
+2 -2
View File
@@ -61,9 +61,9 @@ namespace Vocaluxe.Screens
_EditMode = EEditMode.None;
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
Buttons[htButtons(ButtonSaveSnapshot)].Visible = false;
Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false;
+2 -2
View File
@@ -147,9 +147,9 @@ namespace Vocaluxe.Screens
_TimerDuetText2 = new Stopwatch();
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
Statics[htStatics(StaticTimeLine)].Visible = false;
Statics[htStatics(StaticTimeLineExpandedNormal)].Visible = false;
+2 -2
View File
@@ -84,9 +84,9 @@ namespace Vocaluxe.Screens
_ThemePlaylists = new string[] { Playlist };
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
base.LoadTheme();
base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
+13 -5
View File
@@ -24,6 +24,7 @@ namespace Vocaluxe.Menu
{
private List<CInteraction> _Interactions;
private int _Selection = 0;
private string _ThemePath = String.Empty;
private List<CBackground> _Backgrounds;
private List<CButton> _Buttons;
@@ -158,9 +159,9 @@ namespace Vocaluxe.Menu
}
#region ThemeHandler
public virtual void LoadTheme()
public virtual void LoadTheme(string XmlPath)
{
string file = Path.Combine(_Base.Theme.GetThemeScreensPath(), _ThemeName + ".xml");
string file = Path.Combine(XmlPath, _ThemeName + ".xml");
XPathDocument xPathDoc = null;
XPathNavigator navigator = null;
@@ -192,6 +193,7 @@ namespace Vocaluxe.Menu
if (loaded && VersionCheck && SkinIndex != -1)
{
_ThemePath = XmlPath;
LoadThemeBasics(navigator, SkinIndex);
if (_ThemeBackgrounds != null)
@@ -378,12 +380,15 @@ namespace Vocaluxe.Menu
public virtual void SaveTheme()
{
if (_ThemePath == String.Empty)
return;
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.Encoding = Encoding.UTF8;
settings.ConformanceLevel = ConformanceLevel.Document;
string file = Path.Combine(_Base.Theme.GetThemeScreensPath(), _ThemeName + ".xml");
string file = Path.Combine(_ThemePath, _ThemeName + ".xml");
XmlWriter writer = XmlWriter.Create(file, settings);
writer.WriteStartDocument();
@@ -584,9 +589,12 @@ namespace Vocaluxe.Menu
public virtual void ReloadTheme()
{
if (_ThemePath == String.Empty)
return;
UnloadTextures();
Init();
LoadTheme();
Init();
LoadTheme(_ThemePath);
}
#endregion ThemeHandler
+18 -2
View File
@@ -87,6 +87,7 @@ namespace Vocaluxe.Menu
private bool _ArrowRightSelected;
private List<string> _ValueNames;
private List<int> _ValuePartyModeIDs;
private List<STexture> _Textures;
private List<int> _ValueIndexes;
@@ -164,6 +165,7 @@ namespace Vocaluxe.Menu
_Textures = new List<STexture>();
_ValueIndexes = new List<int>();
_ValueNames = new List<string>();
_ValuePartyModeIDs = new List<int>();
}
public CSelectSlide(CSelectSlide slide)
@@ -217,6 +219,7 @@ namespace Vocaluxe.Menu
_ValueIndexes = new List<int>(slide._ValueIndexes);
_ValueNames = new List<string>(slide._ValueNames);
_ValueBounds = new List<SRectF>(slide._ValueBounds);
_ValuePartyModeIDs = new List<int>(slide._ValuePartyModeIDs);
_Selection = slide._Selection;
_NumVisible = slide._NumVisible;
@@ -540,7 +543,11 @@ namespace Vocaluxe.Menu
public void AddValue(string value)
{
AddValue(value, new STexture(-1));
_ValueBounds.Clear();
}
public void AddValue(string value, int PartyModeID)
{
AddValue(value, new STexture(-1), _ValueIndexes.Count, PartyModeID);
}
public void AddValue(string value, STexture texture)
@@ -549,10 +556,16 @@ namespace Vocaluxe.Menu
}
public void AddValue(string value, STexture texture, int valueIndex)
{
AddValue(value, texture, valueIndex, -1);
}
public void AddValue(string value, STexture texture, int valueIndex, int PartyModeID)
{
_ValueNames.Add(value);
_Textures.Add(texture);
_ValueIndexes.Add(valueIndex);
_ValuePartyModeIDs.Add(PartyModeID);
if (Selection == -1)
Selection = 0;
@@ -763,7 +776,10 @@ namespace Vocaluxe.Menu
_ValueBounds.Clear();
for (int i = 0; i < numvis; i++)
{
CText Text = new CText(_Base, 0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, _ValueNames[i + offset]);
CText Text = new CText(_Base, 0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, String.Empty);
Text.PartyModeID = _ValuePartyModeIDs[i + offset];
Text.Text = _ValueNames[i + offset];
SColorF Alpha = new SColorF(1f, 1f, 1f, 0.35f);
if (i + offset == _Selection)
{
+19 -1
View File
@@ -39,6 +39,7 @@ namespace Vocaluxe.Menu
private Basic _Base;
private SThemeText _Theme;
private bool _ThemeLoaded;
private int _PartyModeID;
public string GetThemeName()
{
@@ -203,7 +204,7 @@ namespace Vocaluxe.Menu
get { return _Theme.Text; }
set
{
string translation = _Base.Language.Translate(value);
string translation = _Base.Language.Translate(value, _PartyModeID);
if (_Theme.Text != value || translation != _Text)
{
_Theme.Text = value;
@@ -213,6 +214,17 @@ namespace Vocaluxe.Menu
}
}
public int PartyModeID
{
get { return _PartyModeID; }
set
{
_Text = _Base.Language.Translate(_Text, value);
_PositionNeedsUpdate = true;
_PartyModeID = value;
}
}
public bool Selected;
public bool Visible = true;
public bool EditMode = false;
@@ -225,6 +237,7 @@ namespace Vocaluxe.Menu
_Theme = new SThemeText();
_ThemeLoaded = false;
_ButtonText = false;
_PartyModeID = -1;
X = 0f;
Y = 0f;
@@ -255,6 +268,7 @@ namespace Vocaluxe.Menu
_Theme = new SThemeText();
_ThemeLoaded = false;
_ButtonText = false;
_PartyModeID = text._PartyModeID;
X = text._X;
Y = text._Y;
@@ -287,6 +301,7 @@ namespace Vocaluxe.Menu
_Theme = new SThemeText();
_ThemeLoaded = false;
_ButtonText = false;
_PartyModeID = -1;
X = x;
Y = y;
@@ -325,6 +340,7 @@ namespace Vocaluxe.Menu
_Theme = new SThemeText();
_ThemeLoaded = false;
_ButtonText = false;
_PartyModeID = -1;
X = x;
Y = y;
@@ -361,6 +377,7 @@ namespace Vocaluxe.Menu
_Theme = new SThemeText();
_ThemeLoaded = false;
_ButtonText = false;
_PartyModeID = -1;
X = x;
Y = y;
@@ -399,6 +416,7 @@ namespace Vocaluxe.Menu
_Theme = new SThemeText();
_ThemeLoaded = false;
_ButtonText = false;
_PartyModeID = -1;
X = x;
Y = y;
+11 -1
View File
@@ -13,7 +13,7 @@ namespace Vocaluxe.Menu
{
void Initialize(Basic Base);
void LoadTheme();
void LoadTheme(string XmlPath);
void SaveTheme();
void ReloadTextures();
void UnloadTextures();
@@ -176,6 +176,7 @@ namespace Vocaluxe.Menu
public interface ILanguage
{
string Translate(string KeyWord);
string Translate(string KeyWord, int PartyModeID);
bool TranslationExists(string KeyWord);
}
@@ -799,6 +800,15 @@ namespace Vocaluxe.Menu
TR_GAMEMODE_SHORTSONG
}
public struct SPartyModeInfos
{
public int PartyModeID;
public string Name;
public string Description;
public string Author;
public bool Playable;
}
public enum EScreens
{
ScreenTest = 0,
+1 -1
View File
@@ -25,7 +25,7 @@ namespace Vocaluxe.PartyModes
_ScreenVersion = ScreenVersion;
}
public override void LoadTheme()
public override void LoadTheme(string XmlPath)
{
Warning = GetNewText();
Warning.Height = 100f;