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