Draw background like all other elements

Few fixes
This commit is contained in:
Flamefire committed 2014-10-22 13:47:26 +02:00
1 parent 8c3a50c18f
commit 67d081d1c1
5 files changed
+29 -56

No files matched your search

+4 -23
View File
@@ -149,9 +149,7 @@ namespace Vocaluxe.Screens
_BuildStaticStrings(ref statics); _BuildStaticStrings(ref statics);
_ThemeStatics = statics.ToArray(); _ThemeStatics = statics.ToArray();
var buttons = new List<string> {_ButtonCancel, _ButtonContinue, _ButtonSkip}; _ThemeButtons = new string[] {_ButtonCancel, _ButtonContinue, _ButtonSkip};
_ThemeButtons = buttons.ToArray();
_ThemeLyrics = new string[] {_LyricMain, _LyricSub, _LyricMainDuet, _LyricSubDuet, _LyricMainTop, _LyricSubTop}; _ThemeLyrics = new string[] {_LyricMain, _LyricSub, _LyricMainDuet, _LyricSubDuet, _LyricMainTop, _LyricSubTop};
_ThemeSingNotes = new string[] {_SingBars}; _ThemeSingNotes = new string[] {_SingBars};
@@ -161,23 +159,6 @@ namespace Vocaluxe.Screens
_TimerDuetText2 = new Stopwatch(); _TimerDuetText2 = new Stopwatch();
} }
public override void LoadTheme(string xmlPath)
{
base.LoadTheme(xmlPath);
_Statics[_StaticTimeLine].Visible = false;
_Statics[_StaticTimeLineExpandedNormal].Visible = false;
_Statics[_StaticTimeLineExpandedHighlighted].Visible = false;
_Statics[_StaticPauseBG].Visible = false;
_Texts[_TextPause].Visible = false;
_Statics[_StaticPauseBG].Visible = false;
_Texts[_TextPause].Visible = false;
_Buttons[_ButtonCancel].Visible = false;
_Buttons[_ButtonContinue].Visible = false;
}
public override bool HandleInput(SKeyEvent keyEvent) public override bool HandleInput(SKeyEvent keyEvent)
{ {
base.HandleInput(keyEvent); base.HandleInput(keyEvent);
@@ -189,13 +170,13 @@ namespace Vocaluxe.Screens
case Keys.Escape: case Keys.Escape:
_TogglePause(); _TogglePause();
if (_Pause) if (_Pause)
_SetInteractionToButton(_Buttons[_ButtonCancel]); _SelectElement(_Buttons[_ButtonCancel]);
break; break;
case Keys.P: case Keys.P:
_TogglePause(); _TogglePause();
if (_Pause) if (_Pause)
_SetInteractionToButton(_Buttons[_ButtonContinue]); _SelectElement(_Buttons[_ButtonContinue]);
break; break;
case Keys.T: case Keys.T:
@@ -297,7 +278,7 @@ namespace Vocaluxe.Screens
{ {
_TogglePause(); _TogglePause();
if (_Pause) if (_Pause)
_SetInteractionToButton(_Buttons[_ButtonContinue]); _SelectElement(_Buttons[_ButtonContinue]);
} }
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent) && _Pause) if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent) && _Pause)
-1
View File
@@ -17,7 +17,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization;
namespace VocaluxeLib namespace VocaluxeLib
{ {
+24 -10
View File
@@ -231,16 +231,30 @@ namespace VocaluxeLib.Menu
#endregion public #endregion public
#region internal #region internal
private static SRectF _GetDrawRect() public override float X
{ {
SRectF rect = CBase.Settings.GetRenderRect(); get { return 0; }
rect.Z = CBase.Settings.GetZFar() / 4; }
return rect; public override float Y
{
get { return 0; }
}
public override float Z
{
get { return CBase.Settings.GetZFar() / 4; }
}
public override float W
{
get { return CBase.Settings.GetRenderW(); }
}
public override float H
{
get { return CBase.Settings.GetRenderH(); }
} }
private void _DrawColor() private void _DrawColor()
{ {
CBase.Drawing.DrawRect(Color, _GetDrawRect()); CBase.Drawing.DrawRect(Color, Rect);
} }
private bool _DrawTexture() private bool _DrawTexture()
@@ -248,7 +262,7 @@ namespace VocaluxeLib.Menu
CTextureRef texture = CBase.Themes.GetSkinTexture(_Theme.Skin, _PartyModeID); CTextureRef texture = CBase.Themes.GetSkinTexture(_Theme.Skin, _PartyModeID);
if (texture != null) if (texture != null)
{ {
CBase.Drawing.DrawTexture(texture, _GetDrawRect(), EAspect.Crop); CBase.Drawing.DrawTexture(texture, Rect, EAspect.Crop);
return true; return true;
} }
return false; return false;
@@ -278,7 +292,7 @@ namespace VocaluxeLib.Menu
if (texture == null) if (texture == null)
return false; return false;
CBase.Drawing.DrawTexture(texture, _GetDrawRect(), EAspect.Crop); CBase.Drawing.DrawTexture(texture, Rect, EAspect.Crop);
if (_SlideShowTimer.ElapsedMilliseconds >= CBase.Settings.GetSlideShowImageTime()) if (_SlideShowTimer.ElapsedMilliseconds >= CBase.Settings.GetSlideShowImageTime())
{ {
@@ -293,7 +307,7 @@ namespace VocaluxeLib.Menu
{ {
SColorF color = texture.Color; SColorF color = texture.Color;
color.A = (_SlideShowTimer.ElapsedMilliseconds - CBase.Settings.GetSlideShowImageTime()) / CBase.Settings.GetSlideShowFadeTime(); color.A = (_SlideShowTimer.ElapsedMilliseconds - CBase.Settings.GetSlideShowImageTime()) / CBase.Settings.GetSlideShowFadeTime();
CBase.Drawing.DrawTexture(texture, _GetDrawRect(), EAspect.Crop, color); CBase.Drawing.DrawTexture(texture, Rect, EAspect.Crop, color);
} }
} }
@@ -307,7 +321,7 @@ namespace VocaluxeLib.Menu
CBase.Video.GetFrame(_VideoStream, _VideoStream.VideoTime); CBase.Video.GetFrame(_VideoStream, _VideoStream.VideoTime);
if (_VideoStream.Texture != null) if (_VideoStream.Texture != null)
{ {
CBase.Drawing.DrawTexture(_VideoStream.Texture, _GetDrawRect(), EAspect.Crop); CBase.Drawing.DrawTexture(_VideoStream.Texture, Rect, EAspect.Crop);
return true; return true;
} }
return false; return false;
@@ -318,7 +332,7 @@ namespace VocaluxeLib.Menu
CTextureRef videoTexture = CBase.BackgroundMusic.GetVideoTexture(); CTextureRef videoTexture = CBase.BackgroundMusic.GetVideoTexture();
if (videoTexture != null) if (videoTexture != null)
{ {
CBase.Drawing.DrawTexture(videoTexture, _GetDrawRect(), EAspect.Crop); CBase.Drawing.DrawTexture(videoTexture, Rect, EAspect.Crop);
return true; return true;
} }
return false; return false;
-21
View File
@@ -38,27 +38,6 @@ namespace VocaluxeLib.Menu
public readonly int Num; public readonly int Num;
public readonly EType Type; public readonly EType Type;
public bool ThemeEditorOnly
{
get
{
return Type == EType.Background ||
Type == EType.NameSelection ||
Type == EType.Text ||
Type == EType.Static ||
Type == EType.SongMenu ||
Type == EType.Lyric ||
Type == EType.SingNote ||
Type == EType.Equalizer ||
Type == EType.Playlist;
}
}
public bool DrawAsForeground
{
get { return Type != EType.Background && Type != EType.SingNote; }
}
public CInteraction(int num, EType type) public CInteraction(int num, EType type)
{ {
Num = num; Num = num;
+1 -1
View File
@@ -33,7 +33,7 @@ namespace VocaluxeLib.Menu
public virtual float Y { get; set; } public virtual float Y { get; set; }
public virtual float Z { get; set; } public virtual float Z { get; set; }
public virtual float W { get; set; } public virtual float W { get; set; }
public float H { get; set; } public virtual float H { get; set; }
public virtual SRectF MaxRect public virtual SRectF MaxRect
{ {