diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs index c0c3169d..0980107a 100644 --- a/Vocaluxe/Base/CGraphics.cs +++ b/Vocaluxe/Base/CGraphics.cs @@ -5,39 +5,12 @@ using System.Drawing; using System.Text; using System.Windows.Forms; -using Vocaluxe.Base; -using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; +using Vocaluxe.PartyModes; using Vocaluxe.Screens; -namespace Vocaluxe.Menu +namespace Vocaluxe.Base { - enum EScreens - { - ScreenTest = 0, - ScreenLoad = 1, - ScreenMain = 2, - ScreenSong = 3, - ScreenOptions = 4, - ScreenSing = 5, - ScreenProfiles = 6, - ScreenScore = 7, - ScreenHighscore = 8, - - ScreenOptionsGame = 9, - ScreenOptionsSound = 10, - ScreenOptionsRecord = 11, - ScreenOptionsVideo = 12, - ScreenOptionsLyrics = 13, - ScreenOptionsTheme = 14, - - ScreenNames = 15, - ScreenCredits = 16, - ScreenParty = 17, - ScreenPartyDummy = 18, - - ScreenNull = -1 - } - enum EPopupScreens { PopupPlayerControl = 0, diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 294807d6..4579997b 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -357,6 +357,21 @@ namespace Vocaluxe.Base { CGraphics.ReloadTheme(); } + + public void SaveTheme() + { + CGraphics.SaveTheme(); + } + + public void FadeTo(EScreens NextScreen) + { + CGraphics.FadeTo(NextScreen); + } + + public float GetGlobalAlpha() + { + return CGraphics.GlobalAlpha; + } } class BLog : ILog diff --git a/Vocaluxe/Base/CParty.cs b/Vocaluxe/Base/CParty.cs index 2751b8a6..fe15e545 100644 --- a/Vocaluxe/Base/CParty.cs +++ b/Vocaluxe/Base/CParty.cs @@ -71,7 +71,14 @@ namespace Vocaluxe.Base public static CMenu GetNextPartyScreen() { - return _PartyModes[_CurrentModeNr].PartyMode.GetNextPartyScreen(); + CMenu NextScreen = _PartyModes[_CurrentModeNr].PartyMode.GetNextPartyScreen(); + if (NextScreen != null) + return NextScreen; + + NextScreen = new CScreenPartyDummy(); + NextScreen.Initialize(CMain.Base); + NextScreen.LoadTheme(); + return NextScreen; } #endregion public stuff diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index 576148b7..fdc66012 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -151,6 +151,12 @@ namespace Vocaluxe.Menu _ThemeEqualizers = null; _ThemePlaylists = null; } + + protected void FadeTo(EScreens NextScreen) + { + _Base.Graphics.FadeTo(NextScreen); + } + #region ThemeHandler public virtual void LoadTheme() { @@ -1048,7 +1054,7 @@ namespace Vocaluxe.Menu switch (KeyEvent.Key) { case Keys.S: - CGraphics.SaveTheme(); + _Base.Graphics.SaveTheme(); break; case Keys.R: diff --git a/Vocaluxe/Menu/CMenuParty.cs b/Vocaluxe/Menu/CMenuParty.cs index 381452a8..11131172 100644 --- a/Vocaluxe/Menu/CMenuParty.cs +++ b/Vocaluxe/Menu/CMenuParty.cs @@ -4,7 +4,7 @@ using System.Text; namespace Vocaluxe.Menu { - abstract class CMenuParty + abstract class CMenuParty : CMenu { public CMenuParty() { diff --git a/Vocaluxe/Menu/CObjectInteractions.cs b/Vocaluxe/Menu/CObjectInteractions.cs index 792aba0c..61c4277e 100644 --- a/Vocaluxe/Menu/CObjectInteractions.cs +++ b/Vocaluxe/Menu/CObjectInteractions.cs @@ -193,7 +193,7 @@ namespace Vocaluxe.Menu switch (KeyEvent.Key) { case Keys.S: - CGraphics.SaveTheme(); + _Base.Graphics.SaveTheme(); break; case Keys.Up: diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 7c832056..56bbcbd6 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -1198,7 +1198,7 @@ namespace Vocaluxe.Menu _Base.Game.AddSong(_Base.Playlist.GetPlaylistSong(ActivePlaylistID, i).SongID, _Base.Playlist.GetPlaylistSong(ActivePlaylistID, i).GameMode); } if (_Base.Game.GetNumSongs() > 0) - CGraphics.FadeTo(EScreens.ScreenNames); + _Base.Graphics.FadeTo(EScreens.ScreenNames); //TODO: What is if someone uses that in PartyMode? } } diff --git a/Vocaluxe/Menu/CText.cs b/Vocaluxe/Menu/CText.cs index daa01f7a..19f39405 100644 --- a/Vocaluxe/Menu/CText.cs +++ b/Vocaluxe/Menu/CText.cs @@ -669,7 +669,7 @@ namespace Vocaluxe.Menu if (Selected && (_Base.Settings.GetGameState() == EGameState.EditTheme)) { _Base.Drawing.DrawColor( - new SColorF(0.5f, 1f, 0.5f, 0.5f * CGraphics.GlobalAlpha), + new SColorF(0.5f, 1f, 0.5f, 0.5f * _Base.Graphics.GetGlobalAlpha()), new SRectF(_DrawPosition.X, _DrawPosition.Y, _DrawPosition.Width, _DrawPosition.Height, Z) ); } @@ -802,7 +802,7 @@ namespace Vocaluxe.Menu if (Selected && (_Base.Settings.GetGameState() == EGameState.EditTheme)) { - _Base.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f * CGraphics.GlobalAlpha), new SRectF(x, y, bounds.Width, bounds.Height, Z)); + _Base.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f * _Base.Graphics.GetGlobalAlpha()), new SRectF(x, y, bounds.Width, bounds.Height, Z)); } } diff --git a/Vocaluxe/Menu/IMenu.cs b/Vocaluxe/Menu/IMenu.cs index c9d909e5..6e6c5aa4 100644 --- a/Vocaluxe/Menu/IMenu.cs +++ b/Vocaluxe/Menu/IMenu.cs @@ -147,6 +147,10 @@ namespace Vocaluxe.Menu public interface IGraphics { void ReloadTheme(); + void SaveTheme(); + void FadeTo(EScreens NextScreen); + + float GetGlobalAlpha(); } public interface ILog @@ -791,4 +795,31 @@ namespace Vocaluxe.Menu TR_GAMEMODE_DUET, TR_GAMEMODE_SHORTSONG } + + public enum EScreens + { + ScreenTest = 0, + ScreenLoad = 1, + ScreenMain = 2, + ScreenSong = 3, + ScreenOptions = 4, + ScreenSing = 5, + ScreenProfiles = 6, + ScreenScore = 7, + ScreenHighscore = 8, + + ScreenOptionsGame = 9, + ScreenOptionsSound = 10, + ScreenOptionsRecord = 11, + ScreenOptionsVideo = 12, + ScreenOptionsLyrics = 13, + ScreenOptionsTheme = 14, + + ScreenNames = 15, + ScreenCredits = 16, + ScreenParty = 17, + ScreenPartyDummy = 18, + + ScreenNull = -1 + } } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index 6ccc8c39..85355a6f 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -371,7 +371,7 @@ namespace Vocaluxe.Menu.SongMenu } else if (MouseEvent.RB && _Base.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !SongOptions.Selection.PartyMode) { - CGraphics.FadeTo(EScreens.ScreenMain); + _Base.Graphics.FadeTo(EScreens.ScreenMain); } else if (_PreviewSelected != -1 && MouseEvent.LB && _Base.Songs.GetCurrentCategoryIndex() != -1 && !SongOptions.Selection.PartyMode) { diff --git a/Vocaluxe/PartyModes/CPartyMode.cs b/Vocaluxe/PartyModes/CPartyMode.cs index f8e47254..ee3cd4d2 100644 --- a/Vocaluxe/PartyModes/CPartyMode.cs +++ b/Vocaluxe/PartyModes/CPartyMode.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using Vocaluxe.Menu; -using Vocaluxe.Screens; namespace Vocaluxe.PartyModes { @@ -30,7 +29,7 @@ namespace Vocaluxe.PartyModes public virtual CMenu GetNextPartyScreen() { - return new CScreenPartyDummy(); + return null; } public virtual EScreens GetStartScreen() diff --git a/Vocaluxe/PartyModes/CScreenPartyDummy.cs b/Vocaluxe/PartyModes/CScreenPartyDummy.cs index a506e5cd..185ca508 100644 --- a/Vocaluxe/PartyModes/CScreenPartyDummy.cs +++ b/Vocaluxe/PartyModes/CScreenPartyDummy.cs @@ -3,14 +3,15 @@ using System.Collections.Generic; using System.Text; using System.Windows.Forms; -using Vocaluxe.Base; using Vocaluxe.Menu; -namespace Vocaluxe.Screens +namespace Vocaluxe.PartyModes { class CScreenPartyDummy : CMenu - {// Version number for theme files. Increment it, if you've changed something on the theme files! + { + // Version number for theme files. Increment it, if you've changed something on the theme files! const int ScreenVersion = 1; + private CText Warning; public CScreenPartyDummy() { @@ -26,6 +27,16 @@ namespace Vocaluxe.Screens public override void LoadTheme() { + Warning = GetNewText(); + Warning.Height = 100f; + Warning.X = 150; + Warning.Y = 300; + Warning.Fon = "Normal"; + Warning.Style = EStyle.Normal; + Warning.Color = new SColorF(1f, 0f, 0f, 1f); + Warning.SColor = new SColorF(1f, 0f, 0f, 1f); + Warning.Text = "SOMETHING WENT WRONG!"; + AddText(Warning); } public override void ReloadTheme() @@ -58,7 +69,7 @@ namespace Vocaluxe.Screens { case Keys.Back: case Keys.Escape: - CGraphics.FadeTo(EScreens.ScreenParty); + FadeTo(EScreens.ScreenParty); break; } } @@ -76,7 +87,7 @@ namespace Vocaluxe.Screens if (MouseEvent.RB) { - CGraphics.FadeTo(EScreens.ScreenParty); + FadeTo(EScreens.ScreenParty); } return true; @@ -95,11 +106,6 @@ namespace Vocaluxe.Screens public override bool Draw() { base.Draw(); - - CFonts.SetFont("Normal"); - CFonts.Style = EStyle.Normal; - CDraw.DrawText("SOMETHING WENT WRONG!", 150, 300, 80); - return true; } diff --git a/Vocaluxe/Screens/CScreenParty.cs b/Vocaluxe/Screens/CScreenParty.cs index aa003b4a..57a5a9ed 100644 --- a/Vocaluxe/Screens/CScreenParty.cs +++ b/Vocaluxe/Screens/CScreenParty.cs @@ -50,7 +50,7 @@ namespace Vocaluxe.Screens break; case Keys.C: - //CGraphics.FadeTo(EScreens.ScreenPartyDummy); + CGraphics.FadeTo(EScreens.ScreenPartyDummy); break; case Keys.Enter: