diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml
index 535fc040..dafce832 100644
--- a/Output/Languages/Deutsch.xml
+++ b/Output/Languages/Deutsch.xml
@@ -108,6 +108,8 @@
Profile
Party-Modus Auswahl
+ Party-Modus
+ Beschreibung
Spielerauswahl
Spieler
diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml
index a6e01df6..be727435 100644
--- a/Output/Languages/English.xml
+++ b/Output/Languages/English.xml
@@ -108,6 +108,8 @@
Profiles
Party Mode Selection
+ Party Mode
+ Description
Player Selection
Player
diff --git a/Output/Languages/French.xml b/Output/Languages/French.xml
index bdcb6150..5ab7e031 100644
--- a/Output/Languages/French.xml
+++ b/Output/Languages/French.xml
@@ -108,6 +108,8 @@
Profils
TODO: Party Mode Selection
+ TODO: Party Mode
+ TODO: Description
Sélection des joueurs
Joueur
diff --git a/Output/Languages/Spanish.xml b/Output/Languages/Spanish.xml
index 219c18f3..5bbc2b02 100644
--- a/Output/Languages/Spanish.xml
+++ b/Output/Languages/Spanish.xml
@@ -102,6 +102,8 @@
Perfiles
TODO: Party Mode Selection
+ TODO: Party Mode
+ TODO: Description
Selección de Jugadores
Jugador
diff --git a/Output/PartyModes/Challenge.xml b/Output/PartyModes/Challenge.xml
index 50e404db..faf68ddd 100644
--- a/Output/PartyModes/Challenge.xml
+++ b/Output/PartyModes/Challenge.xml
@@ -2,8 +2,9 @@
1
- Challenge
+ TR_PARTYMODE_NAME
brunzel
+ TR_PARTYMODE_DESCRIPTION
Challenge
PartyModeChallenge
0
diff --git a/Output/PartyModes/Challenge/Code/PartyScreenChallengeMain.cs b/Output/PartyModes/Challenge/Code/PartyScreenChallengeMain.cs
index 37d0f8b6..df92d940 100644
--- a/Output/PartyModes/Challenge/Code/PartyScreenChallengeMain.cs
+++ b/Output/PartyModes/Challenge/Code/PartyScreenChallengeMain.cs
@@ -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);
diff --git a/Output/Themes/Ambient/Screens/ScreenParty.xml b/Output/Themes/Ambient/Screens/ScreenParty.xml
index d39aed15..0ee71709 100644
--- a/Output/Themes/Ambient/Screens/ScreenParty.xml
+++ b/Output/Themes/Ambient/Screens/ScreenParty.xml
@@ -58,7 +58,160 @@
-
+
+
+ 75
+ 105
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_MODES
+
+
+
+
+
+
+ 75
+ 165
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_DESCRIPTION
+
+
+
+
+
+
+ 850
+ 165
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ Invisible
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ 500
+ 100
+ 0,00
+ 700
+ 50
+
+ 505
+ 105
+ 0,00
+ 40
+ 40
+
+ 1170
+ 105
+ 0,00
+ 40
+ 40
+
+
+ SelectSlideColor
+
+
+ SelectSlideSColor
+
+
+ SelectSlideHColor
+
+
+ ArrowColor
+
+
+ ArrowSColor
+
+
+ TextColor
+
+
+ TextSColor
+
+ 32,00
+
+ 600
+
+ Outline
+
+ Bold
+
+ 1
+
+
Button
diff --git a/Vocaluxe/Base/CFont.cs b/Vocaluxe/Base/CFont.cs
index 20b46154..28b3d2f7 100644
--- a/Vocaluxe/Base/CFont.cs
+++ b/Vocaluxe/Base/CFont.cs
@@ -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)
diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs
index 0980107a..b618da23 100644
--- a/Vocaluxe/Base/CGraphics.cs
+++ b/Vocaluxe/Base/CGraphics.cs
@@ -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();
}
}
diff --git a/Vocaluxe/Base/CLanguage.cs b/Vocaluxe/Base/CLanguage.cs
index 40ca03a6..31689fdc 100644
--- a/Vocaluxe/Base/CLanguage.cs
+++ b/Vocaluxe/Base/CLanguage.cs
@@ -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 files = new List();
- files.AddRange(Helper.ListFiles(CSettings.sFolderLanguages, "*.xml", true, true));
+ files.AddRange(Helper.ListFiles(Path, "*.xml", true, true));
foreach (string file in files)
{
diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs
index 4e958933..fd0d08de 100644
--- a/Vocaluxe/Base/CMain.cs
+++ b/Vocaluxe/Base/CMain.cs
@@ -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);
diff --git a/Vocaluxe/Base/CParty.cs b/Vocaluxe/Base/CParty.cs
index 03b1319b..5b70b654 100644
--- a/Vocaluxe/Base/CParty.cs
+++ b/Vocaluxe/Base/CParty.cs
@@ -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 GetPartyModeInfos()
+ {
+ List infos = new List();
+
+ 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();
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
diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs
index 15e5f24d..dd9d6b15 100644
--- a/Vocaluxe/Base/CSettings.cs
+++ b/Vocaluxe/Base/CSettings.cs
@@ -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;
diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs
index 86d4a96a..ee383668 100644
--- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs
+++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs
@@ -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;
}
diff --git a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs
index 882fae0b..4f02e208 100644
--- a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs
+++ b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs
@@ -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" });
diff --git a/Vocaluxe/Screens/CScreenCredits.cs b/Vocaluxe/Screens/CScreenCredits.cs
index 95171afd..f056ccb8 100644
--- a/Vocaluxe/Screens/CScreenCredits.cs
+++ b/Vocaluxe/Screens/CScreenCredits.cs
@@ -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() {}
diff --git a/Vocaluxe/Screens/CScreenMain.cs b/Vocaluxe/Screens/CScreenMain.cs
index a9dc6cc0..79f31142 100644
--- a/Vocaluxe/Screens/CScreenMain.cs
+++ b/Vocaluxe/Screens/CScreenMain.cs
@@ -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)
diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs
index 2057049c..38cac5cd 100644
--- a/Vocaluxe/Screens/CScreenNames.cs
+++ b/Vocaluxe/Screens/CScreenNames.cs
@@ -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++)
diff --git a/Vocaluxe/Screens/CScreenOptionsGame.cs b/Vocaluxe/Screens/CScreenOptionsGame.cs
index 72d335ba..b2c597ce 100644
--- a/Vocaluxe/Screens/CScreenOptionsGame.cs
+++ b/Vocaluxe/Screens/CScreenOptionsGame.cs
@@ -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;
diff --git a/Vocaluxe/Screens/CScreenOptionsLyrics.cs b/Vocaluxe/Screens/CScreenOptionsLyrics.cs
index eef18019..302ec76d 100644
--- a/Vocaluxe/Screens/CScreenOptionsLyrics.cs
+++ b/Vocaluxe/Screens/CScreenOptionsLyrics.cs
@@ -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((int)CConfig.LyricStyle);
SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].SetValues((int)CConfig.LyricsOnTop);
}
diff --git a/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs
index 2964d0f8..3f06c4dc 100644
--- a/Vocaluxe/Screens/CScreenOptionsRecord.cs
+++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs
@@ -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)
diff --git a/Vocaluxe/Screens/CScreenOptionsSound.cs b/Vocaluxe/Screens/CScreenOptionsSound.cs
index c6c91042..e4d3ac44 100644
--- a/Vocaluxe/Screens/CScreenOptionsSound.cs
+++ b/Vocaluxe/Screens/CScreenOptionsSound.cs
@@ -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((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;
diff --git a/Vocaluxe/Screens/CScreenOptionsTheme.cs b/Vocaluxe/Screens/CScreenOptionsTheme.cs
index 8f868bc3..9b596f32 100644
--- a/Vocaluxe/Screens/CScreenOptionsTheme.cs
+++ b/Vocaluxe/Screens/CScreenOptionsTheme.cs
@@ -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();
diff --git a/Vocaluxe/Screens/CScreenOptionsVideo.cs b/Vocaluxe/Screens/CScreenOptionsVideo.cs
index 3221bdf0..d3daba86 100644
--- a/Vocaluxe/Screens/CScreenOptionsVideo.cs
+++ b/Vocaluxe/Screens/CScreenOptionsVideo.cs
@@ -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((int)CConfig.VideoBackgrounds);
SelectSlides[htSelectSlides(SelectSlideVideoPreview)].SetValues((int)CConfig.VideoPreview);
diff --git a/Vocaluxe/Screens/CScreenParty.cs b/Vocaluxe/Screens/CScreenParty.cs
index 18fea19f..e3242a4a 100644
--- a/Vocaluxe/Screens/CScreenParty.cs
+++ b/Vocaluxe/Screens/CScreenParty.cs
@@ -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 _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;
+ }
}
}
diff --git a/Vocaluxe/Screens/CScreenProfiles.cs b/Vocaluxe/Screens/CScreenProfiles.cs
index 456cd8fd..a5ed50ea 100644
--- a/Vocaluxe/Screens/CScreenProfiles.cs
+++ b/Vocaluxe/Screens/CScreenProfiles.cs
@@ -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;
diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs
index 4d4165a8..fdbd045e 100644
--- a/Vocaluxe/Screens/CScreenSing.cs
+++ b/Vocaluxe/Screens/CScreenSing.cs
@@ -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;
diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs
index 9c535570..1c6432c1 100644
--- a/Vocaluxe/Screens/CScreenSong.cs
+++ b/Vocaluxe/Screens/CScreenSong.cs
@@ -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;
diff --git a/VocaluxeLib/Menu/CMenu.cs b/VocaluxeLib/Menu/CMenu.cs
index 1bf5b0eb..76637118 100644
--- a/VocaluxeLib/Menu/CMenu.cs
+++ b/VocaluxeLib/Menu/CMenu.cs
@@ -24,6 +24,7 @@ namespace Vocaluxe.Menu
{
private List _Interactions;
private int _Selection = 0;
+ private string _ThemePath = String.Empty;
private List _Backgrounds;
private List _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
diff --git a/VocaluxeLib/Menu/CSelectSlide.cs b/VocaluxeLib/Menu/CSelectSlide.cs
index 04a1356a..6ee366da 100644
--- a/VocaluxeLib/Menu/CSelectSlide.cs
+++ b/VocaluxeLib/Menu/CSelectSlide.cs
@@ -87,6 +87,7 @@ namespace Vocaluxe.Menu
private bool _ArrowRightSelected;
private List _ValueNames;
+ private List _ValuePartyModeIDs;
private List _Textures;
private List _ValueIndexes;
@@ -164,6 +165,7 @@ namespace Vocaluxe.Menu
_Textures = new List();
_ValueIndexes = new List();
_ValueNames = new List();
+ _ValuePartyModeIDs = new List();
}
public CSelectSlide(CSelectSlide slide)
@@ -217,6 +219,7 @@ namespace Vocaluxe.Menu
_ValueIndexes = new List(slide._ValueIndexes);
_ValueNames = new List(slide._ValueNames);
_ValueBounds = new List(slide._ValueBounds);
+ _ValuePartyModeIDs = new List(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)
{
diff --git a/VocaluxeLib/Menu/CText.cs b/VocaluxeLib/Menu/CText.cs
index a924683d..df263234 100644
--- a/VocaluxeLib/Menu/CText.cs
+++ b/VocaluxeLib/Menu/CText.cs
@@ -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;
diff --git a/VocaluxeLib/Menu/IMenu.cs b/VocaluxeLib/Menu/IMenu.cs
index 3110ce41..779efcee 100644
--- a/VocaluxeLib/Menu/IMenu.cs
+++ b/VocaluxeLib/Menu/IMenu.cs
@@ -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,
diff --git a/VocaluxeLib/PartyModes/CScreenPartyDummy.cs b/VocaluxeLib/PartyModes/CScreenPartyDummy.cs
index cbe0da24..ceefffa0 100644
--- a/VocaluxeLib/PartyModes/CScreenPartyDummy.cs
+++ b/VocaluxeLib/PartyModes/CScreenPartyDummy.cs
@@ -25,7 +25,7 @@ namespace Vocaluxe.PartyModes
_ScreenVersion = ScreenVersion;
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
Warning = GetNewText();
Warning.Height = 100f;