fixed text translation handling
This commit is contained in:
1 parent
8c5f4bf7c9
commit
6a51bdac4c
3 files changed
+32
-8
No files matched your search
@@ -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, text.PartyModeID)), GetTextHeight(CLanguage.Translate(text.Text, text.PartyModeID)));
|
||||
return new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text, text.TranslationID)), GetTextHeight(CLanguage.Translate(text.Text, text.TranslationID)));
|
||||
}
|
||||
|
||||
public static float GetTextWidth(string text)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
public override void LoadTheme(string XmlPath)
|
||||
{
|
||||
base.LoadTheme(XmlPath);
|
||||
base.LoadTheme(XmlPath);
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent KeyEvent)
|
||||
@@ -146,12 +146,14 @@ namespace Vocaluxe.Screens
|
||||
if (index >= _PartyModeInfos.Count)
|
||||
return;
|
||||
|
||||
//Description
|
||||
Texts[htTexts(TextDescription)].PartyModeID = _PartyModeInfos[index].PartyModeID;
|
||||
//Description
|
||||
Texts[htTexts(TextDescription)].Text = _PartyModeInfos[index].Description;
|
||||
Texts[htTexts(TextDescription)].TranslationID = _PartyModeInfos[index].PartyModeID;
|
||||
|
||||
//TargetAudience
|
||||
Texts[htTexts(TextTargetAudience)].PartyModeID = _PartyModeInfos[index].PartyModeID;
|
||||
Texts[htTexts(TextTargetAudience)].TranslationID = _PartyModeInfos[index].PartyModeID;
|
||||
Texts[htTexts(TextTargetAudience)].Text = _PartyModeInfos[index].TargetAudience;
|
||||
|
||||
//NumTeams
|
||||
if (_PartyModeInfos[index].MaxTeams == 0)
|
||||
Texts[htTexts(TextNumTeams)].Text = "TR_SCREENPARTY_NOTEAMS";
|
||||
@@ -159,17 +161,20 @@ namespace Vocaluxe.Screens
|
||||
Texts[htTexts(TextNumTeams)].Text = _PartyModeInfos[index].MaxTeams.ToString();
|
||||
else if (_PartyModeInfos[index].MaxTeams > _PartyModeInfos[index].MinTeams)
|
||||
Texts[htTexts(TextNumTeams)].Text = _PartyModeInfos[index].MinTeams + " - " + _PartyModeInfos[index].MaxTeams;
|
||||
|
||||
//NumPlayers
|
||||
if (_PartyModeInfos[index].MaxPlayers == _PartyModeInfos[index].MinPlayers)
|
||||
Texts[htTexts(TextNumPlayers)].Text = _PartyModeInfos[index].MaxTeams.ToString();
|
||||
else if (_PartyModeInfos[index].MaxPlayers > _PartyModeInfos[index].MinPlayers)
|
||||
Texts[htTexts(TextNumPlayers)].Text = _PartyModeInfos[index].MinPlayers + " - " + _PartyModeInfos[index].MaxPlayers;
|
||||
|
||||
//Author
|
||||
Texts[htTexts(TextAuthor)].Text = _PartyModeInfos[index].Author;
|
||||
Texts[htTexts(TextAuthor)].PartyModeID = _PartyModeInfos[index].PartyModeID;
|
||||
Texts[htTexts(TextAuthor)].TranslationID = _PartyModeInfos[index].PartyModeID;
|
||||
|
||||
//Version
|
||||
Texts[htTexts(TextVersion)].Text = _PartyModeInfos[index].VersionMajor + "." + _PartyModeInfos[index].VersionMinor;
|
||||
Texts[htTexts(TextVersion)].PartyModeID = _PartyModeInfos[index].PartyModeID;
|
||||
Texts[htTexts(TextVersion)].TranslationID = _PartyModeInfos[index].PartyModeID;
|
||||
|
||||
if (!_PartyModeInfos[index].Playable)
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace Vocaluxe.Menu
|
||||
private SThemeText _Theme;
|
||||
private bool _ThemeLoaded;
|
||||
private int _PartyModeID;
|
||||
private int _TranslationID;
|
||||
|
||||
public string GetThemeName()
|
||||
{
|
||||
@@ -209,7 +210,7 @@ namespace Vocaluxe.Menu
|
||||
get { return _Theme.Text; }
|
||||
set
|
||||
{
|
||||
string translation = _Base.Language.Translate(value, _PartyModeID);
|
||||
string translation = _Base.Language.Translate(value, _TranslationID);
|
||||
if (_Theme.Text != value || translation != _Text)
|
||||
{
|
||||
_Theme.Text = value;
|
||||
@@ -227,6 +228,18 @@ namespace Vocaluxe.Menu
|
||||
_Text = _Base.Language.Translate(_Text, value);
|
||||
_PositionNeedsUpdate = true;
|
||||
_PartyModeID = value;
|
||||
_TranslationID = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int TranslationID
|
||||
{
|
||||
get { return _TranslationID; }
|
||||
set
|
||||
{
|
||||
_Text = _Base.Language.Translate(_Text, value);
|
||||
_PositionNeedsUpdate = true;
|
||||
_TranslationID = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,6 +256,7 @@ namespace Vocaluxe.Menu
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = PartyModeID;
|
||||
_TranslationID = _PartyModeID;
|
||||
|
||||
X = 0f;
|
||||
Y = 0f;
|
||||
@@ -274,6 +288,7 @@ namespace Vocaluxe.Menu
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = text._PartyModeID;
|
||||
_TranslationID = text._TranslationID;
|
||||
|
||||
X = text._X;
|
||||
Y = text._Y;
|
||||
@@ -307,6 +322,7 @@ namespace Vocaluxe.Menu
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = -1;
|
||||
_TranslationID = -1;
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
@@ -346,6 +362,7 @@ namespace Vocaluxe.Menu
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = -1;
|
||||
_TranslationID = -1;
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
@@ -383,6 +400,7 @@ namespace Vocaluxe.Menu
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = -1;
|
||||
_TranslationID = -1;
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
@@ -422,6 +440,7 @@ namespace Vocaluxe.Menu
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = -1;
|
||||
_TranslationID = -1;
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
|
||||
Reference in new issue
Block a user