Merge branch 'develop' of github.com:Vocaluxe/Vocaluxe into develop
Conflicts: Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs
This commit is contained in:
commit
1e2c58fd24
6 files changed
+69
-12
No files matched your search
@@ -123,6 +123,11 @@ namespace Vocaluxe.Base
|
||||
fo.Dispose();
|
||||
}
|
||||
|
||||
public void UnloadTexture()
|
||||
{
|
||||
CDraw.RemoveTexture(ref Texture);
|
||||
}
|
||||
|
||||
private float GetFactor(char chr, TextFormatFlags flags)
|
||||
{
|
||||
if (CFonts.Style == EStyle.Normal)
|
||||
@@ -277,6 +282,15 @@ namespace Vocaluxe.Base
|
||||
_htGlyphs.Add(chr, _Glyphs.Count - 1);
|
||||
CFonts.Height = h;
|
||||
}
|
||||
|
||||
public void UnloadAllGlyphs()
|
||||
{
|
||||
foreach (CGlyph glyph in _Glyphs)
|
||||
{
|
||||
glyph.UnloadTexture();
|
||||
}
|
||||
_Glyphs.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
struct SFont
|
||||
@@ -854,6 +868,27 @@ namespace Vocaluxe.Base
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
public static void UnloadThemeFonts(string ThemeName)
|
||||
{
|
||||
if (_Fonts.Count == 0)
|
||||
return;
|
||||
|
||||
int Index = 0;
|
||||
while (Index < _Fonts.Count)
|
||||
{
|
||||
if (_Fonts[Index].IsThemeFont && _Fonts[Index].ThemeName == ThemeName)
|
||||
{
|
||||
_Fonts[Index].Normal.UnloadAllGlyphs();
|
||||
_Fonts[Index].Italic.UnloadAllGlyphs();
|
||||
_Fonts[Index].Bold.UnloadAllGlyphs();
|
||||
_Fonts[Index].BoldItalic.UnloadAllGlyphs();
|
||||
_Fonts.RemoveAt(Index);
|
||||
}
|
||||
else
|
||||
Index++;
|
||||
}
|
||||
}
|
||||
|
||||
private static int GetFontIndex(string ThemeName, string FontName)
|
||||
{
|
||||
if (ThemeName == String.Empty || FontName == String.Empty)
|
||||
|
||||
@@ -928,6 +928,18 @@ namespace Vocaluxe.Menu
|
||||
CConfig.BackgroundMusicVolume = 0;
|
||||
CConfig.SaveConfig();
|
||||
}
|
||||
else if (KeyEvent.Key == Keys.MediaNextTrack)
|
||||
CBackgroundMusic.Next();
|
||||
else if (KeyEvent.Key == Keys.MediaPreviousTrack)
|
||||
CBackgroundMusic.Previous();
|
||||
else if (KeyEvent.Key == Keys.MediaPlayPause)
|
||||
{
|
||||
if (CBackgroundMusic.Playing)
|
||||
CBackgroundMusic.Pause();
|
||||
else
|
||||
CBackgroundMusic.Play();
|
||||
}
|
||||
|
||||
CBackgroundMusic.ApplyVolume();
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public float Alpha;
|
||||
|
||||
public EAspect Aspect = EAspect.Stretch;
|
||||
|
||||
public CStatic()
|
||||
{
|
||||
_Theme = new SThemeStatic();
|
||||
@@ -213,25 +215,25 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
Draw(1f, Rect.Z, false, false);
|
||||
Draw(1f, Rect.Z, Aspect, false);
|
||||
}
|
||||
|
||||
public void Draw(bool aspect)
|
||||
public void Draw(EAspect aspect)
|
||||
{
|
||||
Draw(1f, Rect.Z, aspect, false);
|
||||
}
|
||||
|
||||
public void Draw(float scale, bool aspect)
|
||||
public void Draw(float scale, EAspect aspect)
|
||||
{
|
||||
Draw(scale, Rect.Z, aspect, false);
|
||||
}
|
||||
|
||||
public void ForceDraw()
|
||||
{
|
||||
Draw(1f, Rect.Z, false, true);
|
||||
Draw(1f, Rect.Z, Aspect, true);
|
||||
}
|
||||
|
||||
public void Draw(float scale, float z, bool aspect, bool ForceDraw)
|
||||
public void Draw(float scale, float z, EAspect aspect, bool ForceDraw)
|
||||
{
|
||||
STexture texture;
|
||||
if (_Texture.index != -1)
|
||||
@@ -248,11 +250,11 @@ namespace Vocaluxe.Menu
|
||||
|
||||
SRectF rect = bounds;
|
||||
|
||||
if (aspect)
|
||||
if (aspect != EAspect.Stretch)
|
||||
{
|
||||
RectangleF bounds2 = new RectangleF(bounds.X, bounds.Y, bounds.W, bounds.H);
|
||||
RectangleF rect2 = new RectangleF(0f, 0f, texture.width, texture.height);
|
||||
CHelper.SetRect(bounds2, ref rect2, texture.width / texture.height, EAspect.Crop);
|
||||
CHelper.SetRect(bounds2, ref rect2, texture.width / texture.height, aspect);
|
||||
|
||||
rect.X = rect2.X;
|
||||
rect.Y = rect2.Y;
|
||||
|
||||
@@ -408,13 +408,13 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
foreach (CStatic tile in _Tiles)
|
||||
{
|
||||
if (tile.Selected && _Active)
|
||||
tile.Draw(1.2f, tile.Rect.Z - 0.1f, true, false);
|
||||
tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false);
|
||||
else
|
||||
{
|
||||
if (tile.Texture.index != _CoverTexture.index)
|
||||
tile.Draw(1f, tile.Rect.Z, true, false);
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false);
|
||||
else
|
||||
tile.Draw(1f, tile.Rect.Z, false, false);
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,9 +467,9 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
|
||||
_TextBG.Draw();
|
||||
|
||||
_CoverBig.Draw(1f, true);
|
||||
_CoverBig.Draw(1f, EAspect.Crop);
|
||||
if (_vidtex.color.A < 1)
|
||||
_CoverBig.Draw(1f, true);
|
||||
_CoverBig.Draw(1f, EAspect.Crop);
|
||||
|
||||
if (_vidtex.index != -1 && _Video != -1)
|
||||
{
|
||||
|
||||
@@ -183,6 +183,7 @@ namespace Vocaluxe.Screens
|
||||
_OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection;
|
||||
|
||||
CTheme.UnloadSkins();
|
||||
CFonts.UnloadThemeFonts(CConfig.Theme);
|
||||
CTheme.ListSkins();
|
||||
CConfig.Skin = CTheme.SkinNames[0];
|
||||
_OldSkin = 0;
|
||||
@@ -205,6 +206,7 @@ namespace Vocaluxe.Screens
|
||||
_OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection;
|
||||
|
||||
CTheme.UnloadSkins();
|
||||
CFonts.UnloadThemeFonts(CConfig.Theme);
|
||||
CTheme.ListSkins();
|
||||
CConfig.Skin = CTheme.SkinNames[0];
|
||||
_OldSkin = 0;
|
||||
|
||||
@@ -151,6 +151,7 @@ namespace Vocaluxe.Screens
|
||||
public override void LoadTheme()
|
||||
{
|
||||
base.LoadTheme();
|
||||
|
||||
Statics[htStatics(StaticTimeLine)].Visible = false;
|
||||
Statics[htStatics(StaticTimeLineExpandedNormal)].Visible = false;
|
||||
Statics[htStatics(StaticTimeLineExpandedHighlighted)].Visible = false;
|
||||
@@ -427,6 +428,11 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
Lyrics[i].LyricStyle = CConfig.LyricStyle;
|
||||
}
|
||||
|
||||
for (int p = 0; p < CGame.NumPlayer; p++)
|
||||
{
|
||||
Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Aspect = EAspect.Crop;
|
||||
}
|
||||
SetVisuability();
|
||||
|
||||
UpdateAvatars();
|
||||
|
||||
Reference in new issue
Block a user