Make partymodes reload their themes

Move PartyModeIds into Partymodes
Fix bug where wrong text size is used (CalculatedFont is now used)
Fix bug where text of the main table in partymodes is displayed wrong
This commit is contained in:
Flamefire committed 2014-10-15 17:25:37 +02:00
1 parent 5d28b19066
commit aa0579a4f1
16 files changed
+194 -113

No files matched your search

+33 -5
View File
@@ -24,22 +24,50 @@ namespace VocaluxeLib.PartyModes
public abstract class CPartyMode : IPartyMode
{
private readonly string _Folder;
protected SScreenSongOptions _ScreenSongOptions;
protected readonly Dictionary<string, CMenuParty> _Screens;
public int ID { get; private set; }
protected SScreenSongOptions _ScreenSongOptions = new SScreenSongOptions { Selection = new SSelectionOptions(), Sorting = new SSortingOptions() };
protected readonly Dictionary<string, CMenuParty> _Screens = new Dictionary<string, CMenuParty>();
protected CPartyMode(string folder)
protected CPartyMode(int id,string folder)
{
_Screens = new Dictionary<string, CMenuParty>();
_ScreenSongOptions = new SScreenSongOptions {Selection = new SSelectionOptions(), Sorting = new SSortingOptions()};
ID = id;
_Folder = folder;
}
#region Implementation
public virtual bool Init()
{
return false;
}
public void LoadTheme()
{
string xmlPath = CBase.Themes.GetThemeScreensPath(ID);
foreach (CMenuParty menu in _Screens.Values)
{
menu.Init();
menu.LoadTheme(xmlPath);
}
}
public void ReloadTextures()
{
foreach (CMenuParty menu in _Screens.Values)
{
menu.ReloadTextures();
}
}
public void ReloadTheme()
{
string xmlPath = CBase.Themes.GetThemeScreensPath(ID);
foreach (CMenuParty menu in _Screens.Values)
{
menu.ReloadTheme(xmlPath);
}
}
public void AddScreen(CMenuParty screen, string screenName)
{
_Screens.Add(screenName, screen);
+2 -2
View File
@@ -22,8 +22,8 @@ namespace VocaluxeLib.PartyModes
public class CPartyModeNone : CPartyMode
{
//just a dummy for normal game mode
public CPartyModeNone(string folder)
: base(folder)
public CPartyModeNone(int id, string folder)
: base(id, folder)
{
_ScreenSongOptions.Selection.RandomOnly = false;
_ScreenSongOptions.Selection.PartyMode = false;
+6
View File
@@ -82,7 +82,13 @@ namespace VocaluxeLib.PartyModes
public interface IPartyMode
{
int ID { get; }
bool Init();
void LoadTheme();
void ReloadTextures();
void ReloadTheme();
void AddScreen(CMenuParty screen, string screenName);
void SaveScreens();
void DataFromScreen(string screenName, Object data);