Added dynamic Glyph resizing
Show Program name on loading screen when videos disabled
This commit is contained in:
1 parent
9aafd6f82c
commit
507df651c0
5 files changed
+57
-39
No files matched your search
@@ -63,6 +63,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
_MaxGlyphHeight = 100f;
|
||||
break;
|
||||
}
|
||||
_MaxGlyphHeight = 50;
|
||||
}
|
||||
|
||||
public Font GetFont()
|
||||
@@ -125,6 +126,12 @@ namespace Vocaluxe.Base.Fonts
|
||||
glyph = new CGlyph(chr, _MaxGlyphHeight);
|
||||
_Glyphs.Add(chr, glyph);
|
||||
}
|
||||
if (glyph.MaxHeight + 50 < CFonts.Height)
|
||||
{
|
||||
glyph.UnloadTexture();
|
||||
glyph = new CGlyph(chr, (float)Math.Round(CFonts.Height / 50) * 50);
|
||||
_Glyphs[chr] = glyph;
|
||||
}
|
||||
return glyph;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
private STexture _Texture;
|
||||
private readonly SizeF _BoundingBox;
|
||||
private readonly RectangleF _DrawBounding;
|
||||
public readonly float MaxHeight;
|
||||
|
||||
public float Width
|
||||
{
|
||||
@@ -45,6 +46,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
|
||||
public CGlyph(char chr, float maxHeight)
|
||||
{
|
||||
MaxHeight = maxHeight;
|
||||
float oldHeight = CFonts.Height;
|
||||
float outline = CFonts.Outline;
|
||||
float outlineSize = outline * maxHeight;
|
||||
|
||||
@@ -30,10 +30,11 @@ 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 _TextStatus = "TextStatus";
|
||||
private const string _TextProgramName = "TextProgramName";
|
||||
|
||||
private readonly string[] _IntroVideo = new string[] {"IntroIn", "IntroMid", "IntroOut"};
|
||||
|
||||
@@ -44,13 +45,13 @@ namespace Vocaluxe.Screens
|
||||
private bool _IntroOutPlayed;
|
||||
private CVideoPlayer[] _Intros;
|
||||
|
||||
private bool _BGMusicStartet;
|
||||
private bool _BGMusicStarted;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_ThemeTexts = new string[] {_TextStatus};
|
||||
_ThemeTexts = new string[] {_TextStatus, _TextProgramName};
|
||||
_Intros = new CVideoPlayer[_IntroVideo.Length];
|
||||
for (int i = 0; i < _Intros.Length; i++)
|
||||
_Intros[i] = new CVideoPlayer();
|
||||
@@ -116,9 +117,10 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
for (int i = 0; i < _Intros.Length; i++)
|
||||
_Intros[i].Load(_IntroVideo[i]);
|
||||
_Texts[_TextProgramName].Visible = false;
|
||||
}
|
||||
|
||||
_BGMusicStartet = false;
|
||||
_BGMusicStarted = false;
|
||||
}
|
||||
|
||||
public override void OnShowFinish()
|
||||
@@ -137,14 +139,14 @@ namespace Vocaluxe.Screens
|
||||
_Timer.Start();
|
||||
|
||||
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON &&
|
||||
CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStartet)
|
||||
CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStarted)
|
||||
{
|
||||
CBackgroundMusic.AddOwnMusic();
|
||||
|
||||
if (!CBackgroundMusic.IsPlaying)
|
||||
CBackgroundMusic.Next();
|
||||
|
||||
_BGMusicStartet = true;
|
||||
_BGMusicStarted = true;
|
||||
}
|
||||
|
||||
CBackgroundMusic.CanSing = false;
|
||||
@@ -173,14 +175,14 @@ namespace Vocaluxe.Screens
|
||||
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
|
||||
|
||||
if (CSongs.SongsLoaded && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON &&
|
||||
CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStartet)
|
||||
CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStarted)
|
||||
{
|
||||
CBackgroundMusic.AddOwnMusic();
|
||||
|
||||
if (!CBackgroundMusic.IsPlaying)
|
||||
CBackgroundMusic.Next();
|
||||
|
||||
_BGMusicStartet = true;
|
||||
_BGMusicStarted = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user