diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs index b228a042..bab0a646 100644 --- a/Vocaluxe/Base/CGraphics.cs +++ b/Vocaluxe/Base/CGraphics.cs @@ -22,6 +22,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; +using Vocaluxe.Base.Font; using Vocaluxe.Screens; using VocaluxeLib.Menu; using VocaluxeLib.PartyModes; diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 4e9b3521..84ee348e 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; using VocaluxeLib.Menu.SongMenu; diff --git a/Vocaluxe/Base/CTheme.cs b/Vocaluxe/Base/CTheme.cs index c730d1d4..30ce2f20 100644 --- a/Vocaluxe/Base/CTheme.cs +++ b/Vocaluxe/Base/CTheme.cs @@ -23,6 +23,7 @@ using System.IO; using System.Text; using System.Windows.Forms; using System.Xml; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; namespace Vocaluxe.Base diff --git a/Vocaluxe/Base/Font/CFont.cs b/Vocaluxe/Base/Font/CFont.cs new file mode 100644 index 00000000..fb4fc0ee --- /dev/null +++ b/Vocaluxe/Base/Font/CFont.cs @@ -0,0 +1,193 @@ +#region license +// /* +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +// */ +#endregion + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Text; +using VocaluxeLib.Menu; + +namespace Vocaluxe.Base.Font +{ + class CFont : IDisposable + { + private readonly Dictionary _Glyphs; + private PrivateFontCollection _Fonts; + private FontFamily _Family; + private readonly float _Sizeh; + + public readonly string FilePath; + + public CFont(string file) + { + FilePath = file; + + _Glyphs = new Dictionary(); + + switch (CConfig.TextureQuality) + { + case ETextureQuality.TR_CONFIG_TEXTURE_LOWEST: + _Sizeh = 25f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_LOW: + _Sizeh = 50f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_MEDIUM: + _Sizeh = 100f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_HIGH: + _Sizeh = 200f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_HIGHEST: + _Sizeh = 400f; + break; + default: + _Sizeh = 100f; + break; + } + } + + public System.Drawing.Font GetFont() + { + if (_Fonts == null) + { + _Fonts = new PrivateFontCollection(); + try + { + _Fonts.AddFontFile(FilePath); + _Family = _Fonts.Families[0]; + } + catch (Exception e) + { + CLog.LogError("Error opening font file " + FilePath + ": " + e.Message); + } + } + + return new System.Drawing.Font(_Family, CFonts.Height, CFonts.GetFontStyle(), GraphicsUnit.Pixel); + } + + public void DrawGlyph(char chr, float x, float y, float h, float z, SColorF color) + { + STexture texture; + SRectF rect; + _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); + CDraw.DrawTexture(texture, rect, color); + } + + public void DrawGlyph(char chr, float x, float y, float h, float z, SColorF color, float begin, float end) + { + STexture texture; + SRectF rect; + _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); + CDraw.DrawTexture(texture, rect, color, begin, end); + } + + public void DrawGlyphReflection(char chr, float x, float y, float h, float z, SColorF color, float rspace, float rheight) + { + STexture texture; + SRectF rect; + _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); + CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight); + } + + private void _GetGlyphTextureAndRect(char chr, float x, float y, float z, float h, out STexture texture, out SRectF rect) + { + AddGlyph(chr); + + CFonts.Height = h; + CGlyph glyph = _Glyphs[chr]; + texture = glyph.Texture; + float factor = h / texture.Height; + float width = texture.Width * factor; + float d = glyph.Sizeh / 5f * factor; + rect = new SRectF(x - d, y, width, h, z); + } + + public float GetWidth(char chr) + { + AddGlyph(chr); + + CGlyph glyph = _Glyphs[chr]; + float factor = CFonts.Height / glyph.Texture.Height; + return glyph.Width * factor; + } + + public float GetHeight(char chr) + { + return CFonts.Height; + /*WTF??? + AddGlyph(chr); + + CGlyph glyph = _Glyphs[chr]; + float factor = CFonts.Height / glyph.Texture.height; + return glyph.Texture.height * factor;*/ + } + + public void AddGlyph(char chr) + { + if (_Glyphs.ContainsKey(chr)) + return; + + float h = CFonts.Height; + _Glyphs.Add(chr, new CGlyph(chr, _Sizeh)); + CFonts.Height = h; + } + + public void UnloadAllGlyphs() + { + foreach (CGlyph glyph in _Glyphs.Values) + glyph.UnloadTexture(); + _Glyphs.Clear(); + } + + public void Dispose() + { + if (_Fonts != null) + { + _Fonts.Dispose(); + _Fonts = null; + UnloadAllGlyphs(); + } + GC.SuppressFinalize(this); + } + } + + struct SFont + { + public string Name; + + public bool IsThemeFont; + public int PartyModeID; + public string ThemeName; + + public string Folder; + public string FileNormal; + public string FileItalic; + public string FileBold; + public string FileBoldItalic; + + public float Outline; //0..1, 0=not outline 1=100% outline + public SColorF OutlineColor; + + public CFont Normal; + public CFont Italic; + public CFont Bold; + public CFont BoldItalic; + } +} \ No newline at end of file diff --git a/Vocaluxe/Base/CFont.cs b/Vocaluxe/Base/Font/CFonts.cs similarity index 60% rename from Vocaluxe/Base/CFont.cs rename to Vocaluxe/Base/Font/CFonts.cs index 7b9b8cf0..8012af02 100644 --- a/Vocaluxe/Base/CFont.cs +++ b/Vocaluxe/Base/Font/CFonts.cs @@ -1,321 +1,13 @@ -#region license -// /* -// This file is part of Vocaluxe. -// -// Vocaluxe is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Vocaluxe is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Vocaluxe. If not, see . -// */ -#endregion - -using System; using System.Collections.Generic; using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; using System.IO; using System.Linq; using System.Text; -using System.Windows.Forms; using System.Xml; using VocaluxeLib.Menu; -namespace Vocaluxe.Base +namespace Vocaluxe.Base.Font { - class CGlyph - { - private readonly float _Sizeh = 50f; - public float Sizeh - { - get { return _Sizeh; } - } - - public STexture Texture; - public readonly int Width; - - public CGlyph(char chr, float maxHigh) - { - _Sizeh = maxHigh; - - float outline = CFonts.Outline; - const TextFormatFlags flags = TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix; - - float factor = _GetFactor(chr, flags); - CFonts.Height = Sizeh * factor; - Font fo; - Size sizeB; - SizeF size; - using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) - { - fo = CFonts.GetFont(); - sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags); - - size = g.MeasureString(chr.ToString(), fo); - } - - using (Bitmap bmp = new Bitmap((int)(sizeB.Width * 2f), sizeB.Height)) - { - Graphics g = Graphics.FromImage(bmp); - g.Clear(Color.Transparent); - - g.SmoothingMode = SmoothingMode.AntiAlias; - g.InterpolationMode = InterpolationMode.HighQualityBicubic; - g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - CFonts.Height = Sizeh; - fo = CFonts.GetFont(); - - PointF point = new PointF( - outline * Math.Abs(sizeB.Width - size.Width) + (sizeB.Width - size.Width) / 2f + Sizeh / 5f, - (sizeB.Height - size.Height - (size.Height + Sizeh / 4f) * (1f - factor)) / 2f); - - using (GraphicsPath path = new GraphicsPath()) - { - path.AddString( - chr.ToString(), - fo.FontFamily, - (int)fo.Style, - Sizeh, - point, - new StringFormat()); - - using (Pen pen = new Pen( - Color.FromArgb( - (int)CFonts.OutlineColor.A * 255, - (int)CFonts.OutlineColor.R * 255, - (int)CFonts.OutlineColor.G * 255, - (int)CFonts.OutlineColor.B * 255), - Sizeh * outline)) - { - pen.LineJoin = LineJoin.Round; - g.DrawPath(pen, path); - g.FillPath(Brushes.White, path); - } - } - - /* - g.DrawString( - chr.ToString(), - fo, - Brushes.White, - point); - * */ - Texture = CDraw.AddTexture(bmp); - //bmp.Save("test.png", ImageFormat.Png); - Width = (int)((1f + outline / 2f) * sizeB.Width * Texture.Width / factor / bmp.Width); - g.Dispose(); - } - fo.Dispose(); - } - - public void UnloadTexture() - { - CDraw.RemoveTexture(ref Texture); - } - - private float _GetFactor(char chr, TextFormatFlags flags) - { - if (CFonts.Style == EStyle.Normal) - return 1f; - - EStyle style = CFonts.Style; - - CFonts.Style = EStyle.Normal; - CFonts.Height = Sizeh; - float hStyle, hNormal; - using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) - { - Font fo = CFonts.GetFont(); - Size sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags); - //SizeF size = g.MeasureString(chr.ToString(), fo); - hNormal = sizeB.Height; - } - CFonts.Style = style; - using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) - { - Font fo = CFonts.GetFont(); - Size sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags); - //size = g.MeasureString(chr.ToString(), fo); - hStyle = sizeB.Height; - } - return hNormal / hStyle; - } - } - - class CFont : IDisposable - { - private readonly Dictionary _Glyphs; - private PrivateFontCollection _Fonts; - private FontFamily _Family; - private readonly float _Sizeh; - - public readonly string FilePath; - - public CFont(string file) - { - FilePath = file; - - _Glyphs = new Dictionary(); - - switch (CConfig.TextureQuality) - { - case ETextureQuality.TR_CONFIG_TEXTURE_LOWEST: - _Sizeh = 25f; - break; - case ETextureQuality.TR_CONFIG_TEXTURE_LOW: - _Sizeh = 50f; - break; - case ETextureQuality.TR_CONFIG_TEXTURE_MEDIUM: - _Sizeh = 100f; - break; - case ETextureQuality.TR_CONFIG_TEXTURE_HIGH: - _Sizeh = 200f; - break; - case ETextureQuality.TR_CONFIG_TEXTURE_HIGHEST: - _Sizeh = 400f; - break; - default: - _Sizeh = 100f; - break; - } - } - - public Font GetFont() - { - if (_Fonts == null) - { - _Fonts = new PrivateFontCollection(); - try - { - _Fonts.AddFontFile(FilePath); - _Family = _Fonts.Families[0]; - } - catch (Exception e) - { - CLog.LogError("Error opening font file " + FilePath + ": " + e.Message); - } - } - - return new Font(_Family, CFonts.Height, CFonts.GetFontStyle(), GraphicsUnit.Pixel); - } - - public void DrawGlyph(char chr, float x, float y, float h, float z, SColorF color) - { - STexture texture; - SRectF rect; - _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); - CDraw.DrawTexture(texture, rect, color); - } - - public void DrawGlyph(char chr, float x, float y, float h, float z, SColorF color, float begin, float end) - { - STexture texture; - SRectF rect; - _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); - CDraw.DrawTexture(texture, rect, color, begin, end); - } - - public void DrawGlyphReflection(char chr, float x, float y, float h, float z, SColorF color, float rspace, float rheight) - { - STexture texture; - SRectF rect; - _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); - CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight); - } - - private void _GetGlyphTextureAndRect(char chr, float x, float y, float z, float h, out STexture texture, out SRectF rect) - { - AddGlyph(chr); - - CFonts.Height = h; - CGlyph glyph = _Glyphs[chr]; - texture = glyph.Texture; - float factor = h / texture.Height; - float width = texture.Width * factor; - float d = glyph.Sizeh / 5f * factor; - rect = new SRectF(x - d, y, width, h, z); - } - - public float GetWidth(char chr) - { - AddGlyph(chr); - - CGlyph glyph = _Glyphs[chr]; - float factor = CFonts.Height / glyph.Texture.Height; - return glyph.Width * factor; - } - - public float GetHeight(char chr) - { - return CFonts.Height; - /*WTF??? - AddGlyph(chr); - - CGlyph glyph = _Glyphs[chr]; - float factor = CFonts.Height / glyph.Texture.height; - return glyph.Texture.height * factor;*/ - } - - public void AddGlyph(char chr) - { - if (_Glyphs.ContainsKey(chr)) - return; - - float h = CFonts.Height; - _Glyphs.Add(chr, new CGlyph(chr, _Sizeh)); - CFonts.Height = h; - } - - public void UnloadAllGlyphs() - { - foreach (CGlyph glyph in _Glyphs.Values) - glyph.UnloadTexture(); - _Glyphs.Clear(); - } - - public void Dispose() - { - if (_Fonts != null) - { - _Fonts.Dispose(); - _Fonts = null; - UnloadAllGlyphs(); - } - GC.SuppressFinalize(this); - } - } - - struct SFont - { - public string Name; - - public bool IsThemeFont; - public int PartyModeID; - public string ThemeName; - - public string Folder; - public string FileNormal; - public string FileItalic; - public string FileBold; - public string FileBoldItalic; - - public float Outline; //0..1, 0=not outline 1=100% outline - public SColorF OutlineColor; - - public CFont Normal; - public CFont Italic; - public CFont Bold; - public CFont BoldItalic; - } - static class CFonts { private static readonly XmlWriterSettings _Settings = new XmlWriterSettings(); @@ -372,7 +64,7 @@ namespace Vocaluxe.Base _LoadFontList(); } - public static Font GetFont() + public static System.Drawing.Font GetFont() { return _GetCurrentFont().GetFont(); } diff --git a/Vocaluxe/Base/Font/CGlyph.cs b/Vocaluxe/Base/Font/CGlyph.cs new file mode 100644 index 00000000..0eb61054 --- /dev/null +++ b/Vocaluxe/Base/Font/CGlyph.cs @@ -0,0 +1,128 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Windows.Forms; +using VocaluxeLib.Menu; + +namespace Vocaluxe.Base.Font +{ + class CGlyph + { + private readonly float _Sizeh = 50f; + public float Sizeh + { + get { return _Sizeh; } + } + + public STexture Texture; + public readonly int Width; + + public CGlyph(char chr, float maxHigh) + { + _Sizeh = maxHigh; + + float outline = CFonts.Outline; + const TextFormatFlags flags = TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix; + + float factor = _GetFactor(chr, flags); + CFonts.Height = Sizeh * factor; + System.Drawing.Font fo; + Size sizeB; + SizeF size; + using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) + { + fo = CFonts.GetFont(); + sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags); + + size = g.MeasureString(chr.ToString(), fo); + } + + using (Bitmap bmp = new Bitmap((int)(sizeB.Width * 2f), sizeB.Height)) + { + Graphics g = Graphics.FromImage(bmp); + g.Clear(Color.Transparent); + + g.SmoothingMode = SmoothingMode.AntiAlias; + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + CFonts.Height = Sizeh; + fo = CFonts.GetFont(); + + PointF point = new PointF( + outline * Math.Abs(sizeB.Width - size.Width) + (sizeB.Width - size.Width) / 2f + Sizeh / 5f, + (sizeB.Height - size.Height - (size.Height + Sizeh / 4f) * (1f - factor)) / 2f); + + using (GraphicsPath path = new GraphicsPath()) + { + path.AddString( + chr.ToString(), + fo.FontFamily, + (int)fo.Style, + Sizeh, + point, + new StringFormat()); + + using (Pen pen = new Pen( + Color.FromArgb( + (int)CFonts.OutlineColor.A * 255, + (int)CFonts.OutlineColor.R * 255, + (int)CFonts.OutlineColor.G * 255, + (int)CFonts.OutlineColor.B * 255), + Sizeh * outline)) + { + pen.LineJoin = LineJoin.Round; + g.DrawPath(pen, path); + g.FillPath(Brushes.White, path); + } + } + + /* + g.DrawString( + chr.ToString(), + fo, + Brushes.White, + point); + * */ + Texture = CDraw.AddTexture(bmp); + //bmp.Save("test.png", ImageFormat.Png); + Width = (int)((1f + outline / 2f) * sizeB.Width * Texture.Width / factor / bmp.Width); + g.Dispose(); + } + fo.Dispose(); + } + + public void UnloadTexture() + { + CDraw.RemoveTexture(ref Texture); + } + + private float _GetFactor(char chr, TextFormatFlags flags) + { + if (CFonts.Style == EStyle.Normal) + return 1f; + + EStyle style = CFonts.Style; + + CFonts.Style = EStyle.Normal; + CFonts.Height = Sizeh; + float hStyle, hNormal; + using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) + { + System.Drawing.Font fo = CFonts.GetFont(); + Size sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags); + //SizeF size = g.MeasureString(chr.ToString(), fo); + hNormal = sizeB.Height; + } + CFonts.Style = style; + using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) + { + System.Drawing.Font fo = CFonts.GetFont(); + Size sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags); + //size = g.MeasureString(chr.ToString(), fo); + hStyle = sizeB.Height; + } + return hNormal / hStyle; + } + } +} \ No newline at end of file diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 7a084bca..1d4974d2 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -31,6 +31,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; using SlimDX.Windows; using Vocaluxe.Base; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; namespace Vocaluxe.Lib.Draw diff --git a/Vocaluxe/Lib/Draw/CDrawWinForm.cs b/Vocaluxe/Lib/Draw/CDrawWinForm.cs index cb79cbc2..55a26fe5 100644 --- a/Vocaluxe/Lib/Draw/CDrawWinForm.cs +++ b/Vocaluxe/Lib/Draw/CDrawWinForm.cs @@ -27,6 +27,7 @@ using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; using Vocaluxe.Base; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; namespace Vocaluxe.Lib.Draw diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 13ee6f35..87042f2d 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -30,6 +30,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Windows.Forms; using Vocaluxe.Base; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; namespace Vocaluxe.Lib.Draw diff --git a/Vocaluxe/Program.cs b/Vocaluxe/Program.cs index 34c5f627..04c0b881 100644 --- a/Vocaluxe/Program.cs +++ b/Vocaluxe/Program.cs @@ -25,6 +25,7 @@ using System.Reflection; using System.Windows.Forms; using Vocaluxe.Base; using System.Runtime.ExceptionServices; +using Vocaluxe.Base.Font; namespace Vocaluxe { diff --git a/Vocaluxe/Screens/CScreenMain.cs b/Vocaluxe/Screens/CScreenMain.cs index 807ec508..977cb417 100644 --- a/Vocaluxe/Screens/CScreenMain.cs +++ b/Vocaluxe/Screens/CScreenMain.cs @@ -19,6 +19,7 @@ using System.Windows.Forms; using Vocaluxe.Base; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; namespace Vocaluxe.Screens diff --git a/Vocaluxe/Screens/CScreenOptionsTheme.cs b/Vocaluxe/Screens/CScreenOptionsTheme.cs index 5beca6e7..1ba85dd1 100644 --- a/Vocaluxe/Screens/CScreenOptionsTheme.cs +++ b/Vocaluxe/Screens/CScreenOptionsTheme.cs @@ -20,6 +20,7 @@ using System; using System.Windows.Forms; using Vocaluxe.Base; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; namespace Vocaluxe.Screens diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 42eb3de7..21aff197 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -25,6 +25,7 @@ using System.IO; using System.Linq; using System.Windows.Forms; using Vocaluxe.Base; +using Vocaluxe.Base.Font; using VocaluxeLib.Menu; using VocaluxeLib.Menu.SingNotes; using VocaluxeLib.Menu.SongMenu; @@ -522,8 +523,8 @@ namespace Vocaluxe.Screens if (_Pause) { - _Statics[_StaticPauseBG].ForceDraw(); - _Texts[_TextPause].ForceDraw(); + _Statics[_StaticPauseBG].Draw(true); + _Texts[_TextPause].Draw(true); foreach (CButton button in _Buttons) button.Draw(); diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index e77012f6..1d1164c9 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -176,7 +176,7 @@ - + @@ -195,6 +195,8 @@ + + Form diff --git a/VocaluxeLib/Menu/CStatic.cs b/VocaluxeLib/Menu/CStatic.cs index 78827930..8dfa8d07 100644 --- a/VocaluxeLib/Menu/CStatic.cs +++ b/VocaluxeLib/Menu/CStatic.cs @@ -221,27 +221,22 @@ namespace VocaluxeLib.Menu return false; } - public void Draw() + public void Draw(bool forceDraw = false) { - Draw(1f, Rect.Z, Aspect, false); + Draw(1f, Rect.Z, Aspect, forceDraw); } public void Draw(EAspect aspect) { - Draw(1f, Rect.Z, aspect, false); + Draw(1f, Rect.Z, aspect); } public void Draw(float scale, EAspect aspect) { - Draw(scale, Rect.Z, aspect, false); + Draw(scale, Rect.Z, aspect); } - public void ForceDraw() - { - Draw(1f, Rect.Z, Aspect, true); - } - - public void Draw(float scale, float z, EAspect aspect, bool forceDraw) + public void Draw(float scale, float z, EAspect aspect, bool forceDraw = false) { STexture texture = _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); diff --git a/VocaluxeLib/Menu/CText.cs b/VocaluxeLib/Menu/CText.cs index ea864d79..c164bfba 100644 --- a/VocaluxeLib/Menu/CText.cs +++ b/VocaluxeLib/Menu/CText.cs @@ -601,11 +601,6 @@ namespace VocaluxeLib.Menu return false; } - public void ForceDraw() - { - Draw(true); - } - public void Draw(bool forceDraw = false) { if (!forceDraw && !Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)