Update LoadTextures for some elements.

This commit is contained in:
Florian Küpper committed 2014-09-12 09:34:55 +02:00
1 parent e936fe4126
commit d248292fa3
4 files changed
+230 -197

No files matched your search

+167 -197
View File
@@ -78,78 +78,27 @@ namespace VocaluxeLib.Menu
[XmlElement("Text1")]
public SThemeText SText1;
[XmlIgnore]
public CText Text1;
[XmlElement("StaticCover")]
public SThemeStatic SStaticCover;
[XmlIgnore]
public CStatic StaticCover;
[XmlElement("StaticPlaylistHeader")]
public SThemeStatic SStaticPlaylistHeader;
[XmlIgnore]
public CStatic StaticPlaylistHeader;
[XmlElement("StaticPlaylistFooter")]
public SThemeStatic SStaticPlaylistFooter;
[XmlIgnore]
public CStatic StaticPlaylistFooter;
[XmlElement("ButtonPlaylistName")]
public SThemeButton SButtonPlaylistName;
[XmlIgnore]
public CButton ButtonPlaylistName;
[XmlElement("ButtonPlaylistClose")]
public SThemeButton SButtonPlaylistClose;
[XmlIgnore]
public CButton ButtonPlaylistClose;
[XmlElement("ButtonPlaylistSave")]
public SThemeButton SButtonPlaylistSave;
[XmlIgnore]
public CButton ButtonPlaylistSave;
public SThemeButton SButtonPlaylistSave;
[XmlElement("ButtonPlaylistDelete")]
public SThemeButton SButtonPlaylistDelete;
[XmlIgnore]
public CButton ButtonPlaylistDelete;
[XmlElement("ButtonPlaylistSing")]
public SThemeButton SButtonPlaylistSing;
[XmlIgnore]
public CButton ButtonPlaylistSing;
[XmlElement("SelectSlideGameMode")]
public SThemeSelectSlide SSelectSlideGameMode;
[XmlIgnore]
public CSelectSlide SelectSlideGameMode;
public SThemePlaylist(SThemePlaylist theme)
{
Name = theme.Name;
Rect = theme.Rect;
EntryHeight = theme.EntryHeight;
TextureBackgroundName = theme.TextureBackgroundName;
SelTextureBackgroundName = theme.SelTextureBackgroundName;
ColorBackground = new SThemeColor(theme.ColorBackground);
SelColorBackground = new SThemeColor(theme.SelColorBackground);
SText1 = new SThemeText(theme.SText1);
Text1 = new CText(theme.Text1);
SStaticCover = new SThemeStatic(theme.SStaticCover);
StaticCover = new CStatic(theme.StaticCover);
SStaticPlaylistHeader = new SThemeStatic(theme.SStaticPlaylistHeader);
StaticPlaylistHeader = new CStatic(theme.StaticPlaylistHeader);
SStaticPlaylistFooter = new SThemeStatic(theme.SStaticPlaylistFooter);
StaticPlaylistFooter = new CStatic(theme.StaticPlaylistFooter);
SButtonPlaylistName = new SThemeButton(theme.SButtonPlaylistName);
ButtonPlaylistName = new CButton(theme.ButtonPlaylistName);
SButtonPlaylistClose = new SThemeButton(theme.SButtonPlaylistClose);
ButtonPlaylistClose = new CButton(theme.ButtonPlaylistClose);
SButtonPlaylistSave = new SThemeButton(theme.SButtonPlaylistSave);
ButtonPlaylistSave = new CButton(theme.ButtonPlaylistSave);
SButtonPlaylistDelete = new SThemeButton(theme.SButtonPlaylistDelete);
ButtonPlaylistDelete = new CButton(theme.ButtonPlaylistDelete);
SButtonPlaylistSing = new SThemeButton(theme.SButtonPlaylistSing);
ButtonPlaylistSing = new CButton(theme.ButtonPlaylistSing);
SSelectSlideGameMode = new SThemeSelectSlide(theme.SSelectSlideGameMode);
SelectSlideGameMode = new CSelectSlide(theme.SelectSlideGameMode);
}
}
public class CPlaylist : IMenuElement
@@ -237,6 +186,17 @@ namespace VocaluxeLib.Menu
public SColorF BackgroundColor;
public SColorF BackgroundSelColor;
public CButton ButtonPlaylistName;
public CButton ButtonPlaylistClose;
public CButton ButtonPlaylistSave;
public CButton ButtonPlaylistDelete;
public CButton ButtonPlaylistSing;
public CText Text1;
public CSelectSlide SelectSlideGameMode;
public CStatic StaticCover;
public CStatic StaticPlaylistHeader;
public CStatic StaticPlaylistFooter;
public bool Visible;
private bool _Selected;
@@ -278,19 +238,17 @@ namespace VocaluxeLib.Menu
public CPlaylist(int partyModeID)
{
_PartyModeID = partyModeID;
_Theme = new SThemePlaylist
{
Text1 = new CText(_PartyModeID),
StaticCover = new CStatic(_PartyModeID),
StaticPlaylistFooter = new CStatic(_PartyModeID),
StaticPlaylistHeader = new CStatic(_PartyModeID),
ButtonPlaylistName = new CButton(_PartyModeID),
ButtonPlaylistClose = new CButton(_PartyModeID),
ButtonPlaylistDelete = new CButton(_PartyModeID),
ButtonPlaylistSave = new CButton(_PartyModeID),
ButtonPlaylistSing = new CButton(_PartyModeID),
SelectSlideGameMode = new CSelectSlide(_PartyModeID)
};
Text1 = new CText(_PartyModeID);
StaticCover = new CStatic(_PartyModeID);
StaticPlaylistFooter = new CStatic(_PartyModeID);
StaticPlaylistHeader = new CStatic(_PartyModeID);
ButtonPlaylistName = new CButton(_PartyModeID);
ButtonPlaylistClose = new CButton(_PartyModeID);
ButtonPlaylistDelete = new CButton(_PartyModeID);
ButtonPlaylistSave = new CButton(_PartyModeID);
ButtonPlaylistSing = new CButton(_PartyModeID);
SelectSlideGameMode = new CSelectSlide(_PartyModeID);
CompleteRect = new SRectF();
Rect = new SRectF();
@@ -310,7 +268,7 @@ namespace VocaluxeLib.Menu
public CPlaylist(SThemePlaylist theme, int partyModeID)
{
_PartyModeID = partyModeID;
_Theme = new SThemePlaylist(theme);
_Theme = theme;
CompleteRect = new SRectF();
_PlaylistElements = new List<CPlaylistElement>();
@@ -319,6 +277,18 @@ namespace VocaluxeLib.Menu
_Interactions = new CObjectInteractions();
_ChangeOrderElement = new CPlaylistElement();
Text1 = new CText(_Theme.SText1, _PartyModeID);
StaticCover = new CStatic(_Theme.SStaticCover, _PartyModeID);
StaticPlaylistFooter = new CStatic(_Theme.SStaticPlaylistFooter, _PartyModeID);
StaticPlaylistHeader = new CStatic(_Theme.SStaticPlaylistHeader, _PartyModeID);
ButtonPlaylistName = new CButton(_Theme.SButtonPlaylistName, _PartyModeID);
ButtonPlaylistClose = new CButton(_Theme.SButtonPlaylistClose, _PartyModeID);
ButtonPlaylistDelete = new CButton(_Theme.SButtonPlaylistDelete, _PartyModeID);
ButtonPlaylistSave = new CButton(_Theme.SButtonPlaylistSave, _PartyModeID);
ButtonPlaylistSing = new CButton(_Theme.SButtonPlaylistSing, _PartyModeID);
SelectSlideGameMode = new CSelectSlide(_Theme.SSelectSlideGameMode, _PartyModeID);
Visible = false;
Selected = false;
@@ -329,14 +299,14 @@ namespace VocaluxeLib.Menu
{
_Interactions.Clear();
_PrepareList();
_Interactions.AddStatic(_Theme.StaticCover);
_Interactions.AddStatic(_Theme.StaticPlaylistFooter);
_Interactions.AddStatic(_Theme.StaticPlaylistHeader);
_Interactions.AddButton(_Theme.ButtonPlaylistName);
_Interactions.AddButton(_Theme.ButtonPlaylistClose);
_Interactions.AddButton(_Theme.ButtonPlaylistDelete);
_Interactions.AddButton(_Theme.ButtonPlaylistSave);
_Interactions.AddButton(_Theme.ButtonPlaylistSing);
_Interactions.AddStatic(StaticCover);
_Interactions.AddStatic(StaticPlaylistFooter);
_Interactions.AddStatic(StaticPlaylistHeader);
_Interactions.AddButton(ButtonPlaylistName);
_Interactions.AddButton(ButtonPlaylistClose);
_Interactions.AddButton(ButtonPlaylistDelete);
_Interactions.AddButton(ButtonPlaylistSave);
_Interactions.AddButton(ButtonPlaylistSing);
}
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
@@ -371,19 +341,19 @@ namespace VocaluxeLib.Menu
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SBackgroundA", ref BackgroundSelColor.A);
}
_ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", xmlReader, skinIndex);
_ThemeLoaded &= Text1.LoadTheme(item, "TextPart1", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.StaticPlaylistHeader.LoadTheme(item, "StaticPlaylistHeader", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.StaticPlaylistFooter.LoadTheme(item, "StaticPlaylistFooter", xmlReader, skinIndex);
_ThemeLoaded &= StaticCover.LoadTheme(item, "StaticCover", xmlReader, skinIndex);
_ThemeLoaded &= StaticPlaylistHeader.LoadTheme(item, "StaticPlaylistHeader", xmlReader, skinIndex);
_ThemeLoaded &= StaticPlaylistFooter.LoadTheme(item, "StaticPlaylistFooter", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.ButtonPlaylistName.LoadTheme(item, "ButtonPlaylistName", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.ButtonPlaylistSing.LoadTheme(item, "ButtonPlaylistSing", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.ButtonPlaylistClose.LoadTheme(item, "ButtonPlaylistClose", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.ButtonPlaylistDelete.LoadTheme(item, "ButtonPlaylistDelete", xmlReader, skinIndex);
_ThemeLoaded &= ButtonPlaylistName.LoadTheme(item, "ButtonPlaylistName", xmlReader, skinIndex);
_ThemeLoaded &= ButtonPlaylistSing.LoadTheme(item, "ButtonPlaylistSing", xmlReader, skinIndex);
_ThemeLoaded &= ButtonPlaylistClose.LoadTheme(item, "ButtonPlaylistClose", xmlReader, skinIndex);
_ThemeLoaded &= ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", xmlReader, skinIndex);
_ThemeLoaded &= ButtonPlaylistDelete.LoadTheme(item, "ButtonPlaylistDelete", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", xmlReader, skinIndex);
_ThemeLoaded &=SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", xmlReader, skinIndex);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/EntryHeight", ref _Theme.EntryHeight);
if (_ThemeLoaded)
@@ -392,63 +362,63 @@ namespace VocaluxeLib.Menu
_Theme.Rect = Rect;
_Theme.ColorBackground.Color = BackgroundColor;
_Theme.SelColorBackground.Color = BackgroundSelColor;
_Theme.SText1 = _Theme.Text1.GetTheme();
_Theme.SStaticCover = _Theme.StaticCover.GetTheme();
_Theme.SStaticPlaylistFooter = _Theme.StaticPlaylistFooter.GetTheme();
_Theme.SStaticPlaylistHeader = _Theme.StaticPlaylistHeader.GetTheme();
_Theme.SButtonPlaylistName = _Theme.ButtonPlaylistName.GetTheme();
_Theme.SButtonPlaylistSing = _Theme.ButtonPlaylistSing.GetTheme();
_Theme.SButtonPlaylistClose = _Theme.ButtonPlaylistClose.GetTheme();
_Theme.SButtonPlaylistSave = _Theme.ButtonPlaylistSave.GetTheme();
_Theme.SButtonPlaylistDelete = _Theme.ButtonPlaylistDelete.GetTheme();
_Theme.SText1 = Text1.GetTheme();
_Theme.SStaticCover = StaticCover.GetTheme();
_Theme.SStaticPlaylistFooter = StaticPlaylistFooter.GetTheme();
_Theme.SStaticPlaylistHeader = StaticPlaylistHeader.GetTheme();
_Theme.SButtonPlaylistName =ButtonPlaylistName.GetTheme();
_Theme.SButtonPlaylistSing =ButtonPlaylistSing.GetTheme();
_Theme.SButtonPlaylistClose =ButtonPlaylistClose.GetTheme();
_Theme.SButtonPlaylistSave =ButtonPlaylistSave.GetTheme();
_Theme.SButtonPlaylistDelete =ButtonPlaylistDelete.GetTheme();
//Check for highest x/y-coords
CompleteRect = Rect;
//ButtonPlaylistClose
if (_Theme.ButtonPlaylistClose.Rect.X < CompleteRect.X)
CompleteRect.X = _Theme.ButtonPlaylistClose.Rect.X;
if (_Theme.ButtonPlaylistClose.Rect.Y < CompleteRect.Y)
CompleteRect.Y = _Theme.ButtonPlaylistClose.Rect.Y;
if (_Theme.ButtonPlaylistClose.Rect.W + _Theme.ButtonPlaylistClose.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = _Theme.ButtonPlaylistClose.Rect.W + _Theme.ButtonPlaylistClose.Rect.X - CompleteRect.X;
if (_Theme.ButtonPlaylistClose.Rect.Y + _Theme.ButtonPlaylistClose.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = _Theme.ButtonPlaylistClose.Rect.H + _Theme.ButtonPlaylistClose.Rect.Y - CompleteRect.Y;
if (ButtonPlaylistClose.Rect.X < CompleteRect.X)
CompleteRect.X = ButtonPlaylistClose.Rect.X;
if (ButtonPlaylistClose.Rect.Y < CompleteRect.Y)
CompleteRect.Y = ButtonPlaylistClose.Rect.Y;
if (ButtonPlaylistClose.Rect.W + ButtonPlaylistClose.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = ButtonPlaylistClose.Rect.W + ButtonPlaylistClose.Rect.X - CompleteRect.X;
if (ButtonPlaylistClose.Rect.Y + ButtonPlaylistClose.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = ButtonPlaylistClose.Rect.H + ButtonPlaylistClose.Rect.Y - CompleteRect.Y;
//ButtonPlaylistName
if (_Theme.ButtonPlaylistName.Rect.X < CompleteRect.X)
CompleteRect.X = _Theme.ButtonPlaylistName.Rect.X;
if (_Theme.ButtonPlaylistName.Rect.Y < CompleteRect.Y)
CompleteRect.Y = _Theme.ButtonPlaylistName.Rect.Y;
if (_Theme.ButtonPlaylistName.Rect.W + _Theme.ButtonPlaylistName.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = _Theme.ButtonPlaylistName.Rect.W + _Theme.ButtonPlaylistName.Rect.X - CompleteRect.X;
if (_Theme.ButtonPlaylistName.Rect.Y + _Theme.ButtonPlaylistName.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = _Theme.ButtonPlaylistName.Rect.H + _Theme.ButtonPlaylistName.Rect.Y - CompleteRect.Y;
if (ButtonPlaylistName.Rect.X < CompleteRect.X)
CompleteRect.X = ButtonPlaylistName.Rect.X;
if (ButtonPlaylistName.Rect.Y < CompleteRect.Y)
CompleteRect.Y = ButtonPlaylistName.Rect.Y;
if (ButtonPlaylistName.Rect.W + ButtonPlaylistName.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = ButtonPlaylistName.Rect.W + ButtonPlaylistName.Rect.X - CompleteRect.X;
if (ButtonPlaylistName.Rect.Y + ButtonPlaylistName.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = ButtonPlaylistName.Rect.H + ButtonPlaylistName.Rect.Y - CompleteRect.Y;
//ButtonPlaylistSing
if (_Theme.ButtonPlaylistSing.Rect.X < CompleteRect.X)
CompleteRect.X = _Theme.ButtonPlaylistSing.Rect.X;
if (_Theme.ButtonPlaylistSing.Rect.Y < CompleteRect.Y)
CompleteRect.Y = _Theme.ButtonPlaylistSing.Rect.Y;
if (_Theme.ButtonPlaylistSing.Rect.W + _Theme.ButtonPlaylistSing.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = _Theme.ButtonPlaylistSing.Rect.W + _Theme.ButtonPlaylistSing.Rect.X - CompleteRect.X;
if (_Theme.ButtonPlaylistSing.Rect.Y + _Theme.ButtonPlaylistSing.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = _Theme.ButtonPlaylistSing.Rect.H + _Theme.ButtonPlaylistSing.Rect.Y - CompleteRect.Y;
if (ButtonPlaylistSing.Rect.X < CompleteRect.X)
CompleteRect.X = ButtonPlaylistSing.Rect.X;
if (ButtonPlaylistSing.Rect.Y < CompleteRect.Y)
CompleteRect.Y = ButtonPlaylistSing.Rect.Y;
if (ButtonPlaylistSing.Rect.W + ButtonPlaylistSing.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = ButtonPlaylistSing.Rect.W + ButtonPlaylistSing.Rect.X - CompleteRect.X;
if (ButtonPlaylistSing.Rect.Y + ButtonPlaylistSing.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = ButtonPlaylistSing.Rect.H + ButtonPlaylistSing.Rect.Y - CompleteRect.Y;
//ButtonPlaylistSave
if (_Theme.ButtonPlaylistSave.Rect.X < CompleteRect.X)
CompleteRect.X = _Theme.ButtonPlaylistSave.Rect.X;
if (_Theme.ButtonPlaylistSave.Rect.Y < CompleteRect.Y)
CompleteRect.Y = _Theme.ButtonPlaylistSave.Rect.Y;
if (_Theme.ButtonPlaylistSave.Rect.W + _Theme.ButtonPlaylistSave.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = _Theme.ButtonPlaylistSave.Rect.W + _Theme.ButtonPlaylistSave.Rect.X - CompleteRect.X;
if (_Theme.ButtonPlaylistSave.Rect.Y + _Theme.ButtonPlaylistSave.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = _Theme.ButtonPlaylistSave.Rect.H + _Theme.ButtonPlaylistSave.Rect.Y - CompleteRect.Y;
if (ButtonPlaylistSave.Rect.X < CompleteRect.X)
CompleteRect.X = ButtonPlaylistSave.Rect.X;
if (ButtonPlaylistSave.Rect.Y < CompleteRect.Y)
CompleteRect.Y = ButtonPlaylistSave.Rect.Y;
if (ButtonPlaylistSave.Rect.W + ButtonPlaylistSave.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = ButtonPlaylistSave.Rect.W + ButtonPlaylistSave.Rect.X - CompleteRect.X;
if (ButtonPlaylistSave.Rect.Y + ButtonPlaylistSave.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = ButtonPlaylistSave.Rect.H + ButtonPlaylistSave.Rect.Y - CompleteRect.Y;
//ButtonPlaylistDelete
if (_Theme.ButtonPlaylistDelete.Rect.X < CompleteRect.X)
CompleteRect.X = _Theme.ButtonPlaylistDelete.Rect.X;
if (_Theme.ButtonPlaylistDelete.Rect.Y < CompleteRect.Y)
CompleteRect.Y = _Theme.ButtonPlaylistDelete.Rect.Y;
if (_Theme.ButtonPlaylistDelete.Rect.W + _Theme.ButtonPlaylistDelete.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = _Theme.ButtonPlaylistDelete.Rect.W + _Theme.ButtonPlaylistDelete.Rect.X - CompleteRect.X;
if (_Theme.ButtonPlaylistDelete.Rect.Y + _Theme.ButtonPlaylistDelete.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = _Theme.ButtonPlaylistDelete.Rect.H + _Theme.ButtonPlaylistDelete.Rect.Y - CompleteRect.Y;
if (ButtonPlaylistDelete.Rect.X < CompleteRect.X)
CompleteRect.X = ButtonPlaylistDelete.Rect.X;
if (ButtonPlaylistDelete.Rect.Y < CompleteRect.Y)
CompleteRect.Y = ButtonPlaylistDelete.Rect.Y;
if (ButtonPlaylistDelete.Rect.W + ButtonPlaylistDelete.Rect.X > CompleteRect.W + CompleteRect.X)
CompleteRect.W = ButtonPlaylistDelete.Rect.W + ButtonPlaylistDelete.Rect.X - CompleteRect.X;
if (ButtonPlaylistDelete.Rect.Y + ButtonPlaylistDelete.Rect.H > CompleteRect.Y + CompleteRect.H)
CompleteRect.H = ButtonPlaylistDelete.Rect.H + ButtonPlaylistDelete.Rect.Y - CompleteRect.Y;
LoadTextures();
}
return _ThemeLoaded;
@@ -501,16 +471,16 @@ namespace VocaluxeLib.Menu
writer.WriteComment("Positions of <TextPart1>, <TextPart2>, <TextPart3>, <StaticCover> and <SelectSlideGameMode> are relative to playlist-entry!");
writer.WriteComment("Use placeholders for Text of <TextPart1>, <TextPart2> and <TextPart3>: %t, %a, %l");
_Theme.Text1.SaveTheme(writer);
_Theme.StaticPlaylistFooter.SaveTheme(writer);
_Theme.StaticPlaylistHeader.SaveTheme(writer);
_Theme.StaticCover.SaveTheme(writer);
_Theme.SelectSlideGameMode.SaveTheme(writer);
_Theme.ButtonPlaylistName.SaveTheme(writer);
_Theme.ButtonPlaylistClose.SaveTheme(writer);
_Theme.ButtonPlaylistDelete.SaveTheme(writer);
_Theme.ButtonPlaylistSave.SaveTheme(writer);
_Theme.ButtonPlaylistSing.SaveTheme(writer);
Text1.SaveTheme(writer);
StaticPlaylistFooter.SaveTheme(writer);
StaticPlaylistHeader.SaveTheme(writer);
StaticCover.SaveTheme(writer);
SelectSlideGameMode.SaveTheme(writer);
ButtonPlaylistName.SaveTheme(writer);
ButtonPlaylistClose.SaveTheme(writer);
ButtonPlaylistDelete.SaveTheme(writer);
ButtonPlaylistSave.SaveTheme(writer);
ButtonPlaylistSing.SaveTheme(writer);
writer.WriteEndElement();
@@ -552,18 +522,18 @@ namespace VocaluxeLib.Menu
public void UnloadTextures()
{
_Theme.Text1.UnloadTextures();
_Theme.ButtonPlaylistClose.UnloadTextures();
_Theme.ButtonPlaylistDelete.UnloadTextures();
_Theme.ButtonPlaylistName.UnloadTextures();
_Theme.ButtonPlaylistSave.UnloadTextures();
_Theme.ButtonPlaylistSing.UnloadTextures();
Text1.UnloadTextures();
ButtonPlaylistClose.UnloadTextures();
ButtonPlaylistDelete.UnloadTextures();
ButtonPlaylistName.UnloadTextures();
ButtonPlaylistSave.UnloadTextures();
ButtonPlaylistSing.UnloadTextures();
_Theme.StaticCover.UnloadTextures();
_Theme.StaticPlaylistFooter.UnloadTextures();
_Theme.StaticPlaylistHeader.UnloadTextures();
StaticCover.UnloadTextures();
StaticPlaylistFooter.UnloadTextures();
StaticPlaylistHeader.UnloadTextures();
_Theme.SelectSlideGameMode.UnloadTextures();
SelectSlideGameMode.UnloadTextures();
}
public void LoadTextures()
@@ -574,18 +544,18 @@ namespace VocaluxeLib.Menu
if (!String.IsNullOrEmpty(_Theme.SelColorBackground.Name))
BackgroundSelColor = CBase.Theme.GetColor(_Theme.SelColorBackground.Name, _PartyModeID);
_Theme.Text1.LoadTextures();
_Theme.ButtonPlaylistClose.LoadTextures();
_Theme.ButtonPlaylistDelete.LoadTextures();
_Theme.ButtonPlaylistName.LoadTextures();
_Theme.ButtonPlaylistSave.LoadTextures();
_Theme.ButtonPlaylistSing.LoadTextures();
Text1.LoadTextures();
ButtonPlaylistClose.LoadTextures();
ButtonPlaylistDelete.LoadTextures();
ButtonPlaylistName.LoadTextures();
ButtonPlaylistSave.LoadTextures();
ButtonPlaylistSing.LoadTextures();
_Theme.StaticCover.LoadTextures();
_Theme.StaticPlaylistFooter.LoadTextures();
_Theme.StaticPlaylistHeader.LoadTextures();
StaticCover.LoadTextures();
StaticPlaylistFooter.LoadTextures();
StaticPlaylistHeader.LoadTextures();
_Theme.SelectSlideGameMode.LoadTextures();
SelectSlideGameMode.LoadTextures();
Init();
}
@@ -604,26 +574,26 @@ namespace VocaluxeLib.Menu
if (EditMode == EEditMode.PlaylistName)
{
if (keyEvent.KeyPressed && !Char.IsControl(keyEvent.Unicode))
_Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text + keyEvent.Unicode;
ButtonPlaylistName.Text.Text = ButtonPlaylistName.Text.Text + keyEvent.Unicode;
else
{
switch (keyEvent.Key)
{
case Keys.Enter:
CBase.Playlist.SetName(ActivePlaylistID, _Theme.ButtonPlaylistName.Text.Text);
CBase.Playlist.SetName(ActivePlaylistID, ButtonPlaylistName.Text.Text);
CBase.Playlist.Save(ActivePlaylistID);
EditMode = EEditMode.None;
_Theme.ButtonPlaylistName.EditMode = false;
ButtonPlaylistName.EditMode = false;
break;
case Keys.Escape:
_Theme.ButtonPlaylistName.Text.Text = CBase.Playlist.GetName(ActivePlaylistID);
ButtonPlaylistName.Text.Text = CBase.Playlist.GetName(ActivePlaylistID);
EditMode = EEditMode.None;
_Theme.ButtonPlaylistName.EditMode = false;
ButtonPlaylistName.EditMode = false;
break;
case Keys.Delete:
case Keys.Back:
if (!String.IsNullOrEmpty(_Theme.ButtonPlaylistName.Text.Text))
_Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1);
if (!String.IsNullOrEmpty(ButtonPlaylistName.Text.Text))
ButtonPlaylistName.Text.Text = ButtonPlaylistName.Text.Text.Remove(ButtonPlaylistName.Text.Text.Length - 1);
break;
}
}
@@ -856,38 +826,38 @@ namespace VocaluxeLib.Menu
switch (keyEvent.Key)
{
case Keys.Back:
if (_Theme.ButtonPlaylistName.Selected)
if (ButtonPlaylistName.Selected)
{
EditMode = EEditMode.PlaylistName;
_Theme.ButtonPlaylistName.EditMode = true;
ButtonPlaylistName.EditMode = true;
}
else
ClosePlaylist();
break;
case Keys.Enter:
if (_Theme.ButtonPlaylistClose.Selected)
if (ButtonPlaylistClose.Selected)
ClosePlaylist();
else if (_Theme.ButtonPlaylistSing.Selected)
else if (ButtonPlaylistSing.Selected)
_StartPlaylistSongs();
else if (_Theme.ButtonPlaylistSave.Selected)
else if (ButtonPlaylistSave.Selected)
CBase.Playlist.Save(ActivePlaylistID);
else if (_Theme.ButtonPlaylistDelete.Selected)
else if (ButtonPlaylistDelete.Selected)
{
CBase.Playlist.Delete(ActivePlaylistID);
ClosePlaylist();
}
else if (_Theme.ButtonPlaylistName.Selected)
else if (ButtonPlaylistName.Selected)
{
if (EditMode != EEditMode.PlaylistName)
{
EditMode = EEditMode.PlaylistName;
_Theme.ButtonPlaylistName.EditMode = true;
ButtonPlaylistName.EditMode = true;
}
else
{
EditMode = EEditMode.None;
_Theme.ButtonPlaylistName.EditMode = false;
ButtonPlaylistName.EditMode = false;
}
}
break;
@@ -1017,31 +987,31 @@ namespace VocaluxeLib.Menu
_PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[_PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection];
UpdatePlaylist();
}
if (_Theme.ButtonPlaylistClose.Selected)
if (ButtonPlaylistClose.Selected)
{
ClosePlaylist();
return true;
}
if (_Theme.ButtonPlaylistSing.Selected)
if (ButtonPlaylistSing.Selected)
{
_StartPlaylistSongs();
return true;
}
if (_Theme.ButtonPlaylistSave.Selected)
if (ButtonPlaylistSave.Selected)
{
CBase.Playlist.Save(ActivePlaylistID);
return true;
}
if (_Theme.ButtonPlaylistDelete.Selected)
if (ButtonPlaylistDelete.Selected)
{
CBase.Playlist.Delete(ActivePlaylistID);
ClosePlaylist();
return true;
}
if (_Theme.ButtonPlaylistName.Selected)
if (ButtonPlaylistName.Selected)
{
EditMode = EEditMode.PlaylistName;
_Theme.ButtonPlaylistName.EditMode = true;
ButtonPlaylistName.EditMode = true;
return true;
}
}
@@ -1129,13 +1099,13 @@ namespace VocaluxeLib.Menu
break;
case EEditMode.PlaylistName:
_Interactions.SetInteractionToButton(_Theme.ButtonPlaylistName);
_Interactions.SetInteractionToButton(ButtonPlaylistName);
CurrentPlaylistElement = -1;
if (mouseEvent.LB)
{
if (_Theme.ButtonPlaylistName.Selected)
if (ButtonPlaylistName.Selected)
{
CBase.Playlist.SetName(ActivePlaylistID, _Theme.ButtonPlaylistName.Text.Text);
CBase.Playlist.SetName(ActivePlaylistID, ButtonPlaylistName.Text.Text);
CBase.Playlist.Save(ActivePlaylistID);
EditMode = EEditMode.None;
return true;
@@ -1143,11 +1113,11 @@ namespace VocaluxeLib.Menu
}
else if (mouseEvent.RB)
{
if (_Theme.ButtonPlaylistName.Selected)
if (ButtonPlaylistName.Selected)
{
_Theme.ButtonPlaylistName.Text.Text = CBase.Playlist.GetName(ActivePlaylistID);
ButtonPlaylistName.Text.Text = CBase.Playlist.GetName(ActivePlaylistID);
EditMode = EEditMode.None;
_Theme.ButtonPlaylistName.EditMode = false;
ButtonPlaylistName.EditMode = false;
return true;
}
}
@@ -1211,17 +1181,17 @@ namespace VocaluxeLib.Menu
{
Background = new CStatic(_PartyModeID, _Theme.TextureBackgroundName, BackgroundColor,
new SRectF(Rect.X, Rect.Y + (i * _Theme.EntryHeight), Rect.W, _Theme.EntryHeight, Rect.Z)),
Cover = new CStatic(_Theme.StaticCover)
Cover = new CStatic(StaticCover)
};
en.Cover.Rect.Y += Rect.Y + (i * _Theme.EntryHeight);
en.Cover.Rect.X += Rect.X;
en.Text1 = new CText(_Theme.Text1);
en.Text1 = new CText(Text1);
en.Text1.X += Rect.X;
en.Text1.Y += Rect.Y + (i * _Theme.EntryHeight);
en.SelectSlide = new CSelectSlide(_Theme.SelectSlideGameMode);
en.SelectSlide = new CSelectSlide(SelectSlideGameMode);
en.SelectSlide.Rect.X += Rect.X;
en.SelectSlide.Rect.Y += Rect.Y + (i * _Theme.EntryHeight);
en.SelectSlide.RectArrowLeft.X += Rect.X;
@@ -1244,7 +1214,7 @@ namespace VocaluxeLib.Menu
if (!CBase.Playlist.Exists(playlistID))
return false;
ActivePlaylistID = playlistID;
_Theme.ButtonPlaylistName.Text.Text = CBase.Playlist.GetName(ActivePlaylistID);
ButtonPlaylistName.Text.Text = CBase.Playlist.GetName(ActivePlaylistID);
_PlaylistElementContents.Clear();
for (int i = 0; i < CBase.Playlist.GetSongCount(ActivePlaylistID); i++)
{
@@ -1322,7 +1292,7 @@ namespace VocaluxeLib.Menu
CPlaylistElementContent pec = _PlaylistElementContents[Offset + i];
CSong song = CBase.Songs.GetSongByID(pec.SongID);
_PlaylistElements[i].Cover.Texture = song.CoverTextureSmall;
string t1 = CBase.Language.Translate(_Theme.Text1.Text).Replace("%a", song.Artist).Replace("%t", song.Title);
string t1 = CBase.Language.Translate(Text1.Text).Replace("%a", song.Artist).Replace("%t", song.Title);
_PlaylistElements[i].Text1.Text = /*(Offset + i + 1) + ") " + */ t1; //TODO: Add text field for the number
_PlaylistElements[i].SelectSlide.Clear();
for (int g = 0; g < pec.Modes.Count; g++)
@@ -1346,7 +1316,7 @@ namespace VocaluxeLib.Menu
public SThemePlaylist GetTheme()
{
return new SThemePlaylist(_Theme);
return _Theme;
}
#region ThemeEdit
+26
View File
@@ -922,24 +922,50 @@ namespace VocaluxeLib.Menu
{
if (!String.IsNullOrEmpty(_Theme.Color.Name))
Color = CBase.Theme.GetColor(_Theme.Color.Name, _PartyModeID);
else
Color = _Theme.Color.Color;
if (!String.IsNullOrEmpty(_Theme.SColor.Name))
SelColor = CBase.Theme.GetColor(_Theme.SColor.Name, _PartyModeID);
else
SelColor = _Theme.SColor.Color;
if (!String.IsNullOrEmpty(_Theme.HColor.Name))
HighlightColor = CBase.Theme.GetColor(_Theme.HColor.Name, _PartyModeID);
else
HighlightColor = _Theme.HColor.Color;
if (!String.IsNullOrEmpty(_Theme.ArrowColor.Name))
ColorArrow = CBase.Theme.GetColor(_Theme.ArrowColor.Name, _PartyModeID);
else
ColorArrow = _Theme.ArrowColor.Color;
if (!String.IsNullOrEmpty(_Theme.ArrowSColor.Name))
SelColorArrow = CBase.Theme.GetColor(_Theme.ArrowSColor.Name, _PartyModeID);
else
SelColorArrow = _Theme.ArrowSColor.Color;
if (!String.IsNullOrEmpty(_Theme.TextColor.Name))
TextColor = CBase.Theme.GetColor(_Theme.TextColor.Name, _PartyModeID);
else
TextColor = _Theme.TextColor.Color;
if (!String.IsNullOrEmpty(_Theme.TextSColor.Name))
SelTextColor = CBase.Theme.GetColor(_Theme.TextSColor.Name, _PartyModeID);
else
SelTextColor = _Theme.TextSColor.Color;
Rect = _Theme.Rect;
RectArrowLeft = _Theme.RectArrowLeft;
RectArrowRight = _Theme.RectArrowRight;
NumVisible = _Theme.NumVisible;
TextH = _Theme.TextH;
TextRelativeX = _Theme.TextRelativeX;
TextRelativeY = _Theme.TextRelativeY;
MaxW = _Theme.TextMaxW;
}
public void ReloadTextures()
+10
View File
@@ -261,6 +261,16 @@ namespace VocaluxeLib.Menu
{
if (!String.IsNullOrEmpty(_Theme.Color.Name))
Color = CBase.Theme.GetColor(_Theme.Color.Name, _PartyModeID);
else
Color = _Theme.Color.Color;
Rect = new SRectF(_Theme.Rect);
Reflection = _Theme.Reflection.Enabled;
if (Reflection)
{
ReflectionSpace = _Theme.Reflection.Height;
ReflectionHeight = _Theme.Reflection.Space;
}
}
public void ReloadTextures()
+27
View File
@@ -36,6 +36,8 @@ namespace VocaluxeLib.Menu
public float Z;
[XmlElement("H")]
public float Height;
[XmlElement("MaxW")]
public float MaxWidth;
public SThemeColor Color;
public SThemeColor SColor; //for Buttons
[XmlElement("Align")]
@@ -57,6 +59,7 @@ namespace VocaluxeLib.Menu
Y = theme.Y;
Z = theme.Z;
Height = theme.Height;
MaxWidth = theme.MaxWidth;
Color = new SThemeColor(theme.Color);
SColor = new SThemeColor(theme.SColor);
Align = theme.Align;
@@ -423,6 +426,7 @@ namespace VocaluxeLib.Menu
_Theme.ResizeAlign = _ResizeAlign;
_Theme.SColor.Color = SelColor;
_Theme.Style = _Style;
_Theme.MaxWidth = _MaxWidth;
_Theme.X = _X;
_Theme.Y = _Y;
_Theme.Z = _Z;
@@ -588,9 +592,32 @@ namespace VocaluxeLib.Menu
{
if (!String.IsNullOrEmpty(_Theme.Color.Name))
Color = CBase.Theme.GetColor(_Theme.Color.Name, _PartyModeID);
else
Color = new SColorF(_Theme.Color.Color);
if (!String.IsNullOrEmpty(_Theme.SColor.Name))
SelColor = CBase.Theme.GetColor(_Theme.SColor.Name, _PartyModeID);
else
SelColor = new SColorF(_Theme.SColor.Color);
_X = _Theme.X;
_Y = _Theme.Y;
_Z = _Theme.Z;
_Height = _Theme.Height;
_MaxWidth = _Theme.MaxWidth;
_Align = _Theme.Align;
_ResizeAlign = _Theme.ResizeAlign;
_Style = _Theme.Style;
_Font = _Theme.Font;
if (_Theme.Reflection.Enabled)
{
ReflectionSpace = _Theme.Reflection.Space;
ReflectionHeight = _Theme.Reflection.Height;
}
Text = _Theme.Text;
Selected = false;
}
public void ReloadTextures()