From e9f9ecc5f4e327da50f8ef2dbd1f93f311c01286 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Tue, 11 Dec 2012 19:37:57 +0100 Subject: [PATCH] added party dummy screen and CMenuParty class (not finished) --- Vocaluxe/Base/CParty.cs | 23 +++- Vocaluxe/Menu/CGraphics.cs | 7 +- Vocaluxe/PartyModes/CPartyMode.cs | 6 ++ Vocaluxe/PartyModes/IPartyMode.cs | 1 + Vocaluxe/Screens/CScreenParty.cs | 4 + Vocaluxe/Screens/CScreenPartyDummy.cs | 112 ++++++++++++++++++++ Vocaluxe/Screens/CScreenSong.cs | 4 +- Vocaluxe/Screens/PartyScreens/CMenuParty.cs | 29 +++++ Vocaluxe/Vocaluxe.csproj | 2 + 9 files changed, 183 insertions(+), 5 deletions(-) create mode 100644 Vocaluxe/Screens/CScreenPartyDummy.cs create mode 100644 Vocaluxe/Screens/PartyScreens/CMenuParty.cs diff --git a/Vocaluxe/Base/CParty.cs b/Vocaluxe/Base/CParty.cs index bcda5fa8..65d13dc7 100644 --- a/Vocaluxe/Base/CParty.cs +++ b/Vocaluxe/Base/CParty.cs @@ -12,6 +12,7 @@ namespace Vocaluxe.Base private static List _PartyModes; private static int _CurrentModeNr; + #region public stuff public static int NumModes { get { return _PartyModes.Count - 1; } //first mode is the dummy normal game mode @@ -21,17 +22,26 @@ namespace Vocaluxe.Base { _PartyModes = new List(); - //add dummy normal game mode + //add dummy normal game mode and set it as default _PartyModes.Add(new CPartyModeNone()); - _CurrentModeNr = 0; - } + //load other party modes + LoadPartyModes(); + } + public static void SetNormalGameMode() { _CurrentModeNr = 0; } + public static CMenu GetNextPartyScreen() + { + return _PartyModes[_CurrentModeNr].GetNextPartyScreen(); + } + #endregion public stuff + + #region Interface public static EScreens GetStartScreen() { return _PartyModes[_CurrentModeNr].GetStartScreen(); @@ -56,5 +66,12 @@ namespace Vocaluxe.Base { _PartyModes[_CurrentModeNr].JokerUsed(TeamNr); } + #endregion Interface + + #region private stuff + private static void LoadPartyModes() + { + } + #endregion private stuff } } diff --git a/Vocaluxe/Menu/CGraphics.cs b/Vocaluxe/Menu/CGraphics.cs index d9f220ae..7c64de84 100644 --- a/Vocaluxe/Menu/CGraphics.cs +++ b/Vocaluxe/Menu/CGraphics.cs @@ -33,6 +33,7 @@ namespace Vocaluxe.Menu ScreenNames = 15, ScreenCredits = 16, ScreenParty = 17, + ScreenPartyDummy = 18, ScreenNull = -1 } @@ -245,6 +246,7 @@ namespace Vocaluxe.Menu _Screens.Add(new CScreenNames()); _Screens.Add(new CScreenCredits()); _Screens.Add(new CScreenParty()); + _Screens.Add(new CScreenPartyDummy()); _PopupScreens.Add(new CPopupScreenPlayerControl()); _PopupScreens.Add(new CPopupScreenVolumeControl()); @@ -433,9 +435,12 @@ namespace Vocaluxe.Menu public static void FadeTo(EScreens Screen) { + if (Screen == EScreens.ScreenPartyDummy) + _Screens[(int)EScreens.ScreenPartyDummy] = CParty.GetNextPartyScreen(); + _NextScreen = Screen; } - + public static void ShowPopup(EPopupScreens PopupScreen) { _PopupScreens[(int)PopupScreen].OnShow(); diff --git a/Vocaluxe/PartyModes/CPartyMode.cs b/Vocaluxe/PartyModes/CPartyMode.cs index 8ba4ee1d..d7ade268 100644 --- a/Vocaluxe/PartyModes/CPartyMode.cs +++ b/Vocaluxe/PartyModes/CPartyMode.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using Vocaluxe.Menu; +using Vocaluxe.Screens; namespace Vocaluxe.PartyModes { @@ -22,6 +23,11 @@ namespace Vocaluxe.PartyModes { } + public virtual CMenu GetNextPartyScreen() + { + return new CScreenPartyDummy(); + } + public virtual EScreens GetStartScreen() { return EScreens.ScreenSong; diff --git a/Vocaluxe/PartyModes/IPartyMode.cs b/Vocaluxe/PartyModes/IPartyMode.cs index 99179fb0..ef959509 100644 --- a/Vocaluxe/PartyModes/IPartyMode.cs +++ b/Vocaluxe/PartyModes/IPartyMode.cs @@ -54,6 +54,7 @@ namespace Vocaluxe.PartyModes { void Init(); + CMenu GetNextPartyScreen(); EScreens GetStartScreen(); EScreens GetMainScreen(); ScreenSongOptions GetScreenSongOptions(); diff --git a/Vocaluxe/Screens/CScreenParty.cs b/Vocaluxe/Screens/CScreenParty.cs index 0d397743..0d0a6d38 100644 --- a/Vocaluxe/Screens/CScreenParty.cs +++ b/Vocaluxe/Screens/CScreenParty.cs @@ -49,6 +49,10 @@ namespace Vocaluxe.Screens case Keys.Escape: CGraphics.FadeTo(EScreens.ScreenMain); break; + + case Keys.C: + //CGraphics.FadeTo(EScreens.ScreenPartyDummy); + break; case Keys.Enter: if (Buttons[htButtons(ButtonExit)].Selected) diff --git a/Vocaluxe/Screens/CScreenPartyDummy.cs b/Vocaluxe/Screens/CScreenPartyDummy.cs new file mode 100644 index 00000000..a414c419 --- /dev/null +++ b/Vocaluxe/Screens/CScreenPartyDummy.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +using Vocaluxe.Base; +using Vocaluxe.Menu; + +namespace Vocaluxe.Screens +{ + class CScreenPartyDummy : CMenu + {// Version number for theme files. Increment it, if you've changed something on the theme files! + const int ScreenVersion = 1; + + public CScreenPartyDummy() + { + Init(); + } + + protected override void Init() + { + base.Init(); + + _ThemeName = "ScreenPartyDummy"; + _ScreenVersion = ScreenVersion; + } + + public override void LoadTheme() + { + } + + public override void ReloadTheme() + { + } + + public override void ReloadTextures() + { + } + + public override void SaveTheme() + { + } + + public override void UnloadTextures() + { + } + + public override bool HandleInput(KeyEvent KeyEvent) + { + base.HandleInput(KeyEvent); + + if (KeyEvent.KeyPressed) + { + + } + else + { + switch (KeyEvent.Key) + { + case Keys.Back: + case Keys.Escape: + CGraphics.FadeTo(EScreens.ScreenParty); + break; + } + } + return true; + } + + public override bool HandleMouse(MouseEvent MouseEvent) + { + base.HandleMouse(MouseEvent); + + if (MouseEvent.LB && IsMouseOver(MouseEvent)) + { + + } + + if (MouseEvent.RB) + { + CGraphics.FadeTo(EScreens.ScreenParty); + } + + return true; + } + + public override void OnShow() + { + base.OnShow(); + } + + public override bool UpdateGame() + { + return true; + } + + public override bool Draw() + { + base.Draw(); + + CFonts.SetFont("Normal"); + CFonts.Style = EStyle.Normal; + CDraw.DrawText("SOMETHING WENT WRONG!", 150, 300, 80); + + return true; + } + + public override void OnClose() + { + base.OnClose(); + } + } +} diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 11e84a48..9325e95c 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -644,7 +644,7 @@ namespace Vocaluxe.Screens private void HandlePartySongSelection(int SongNr) { - + CGraphics.FadeTo(EScreens.ScreenPartyDummy); } private void StartSong(int SongNr) @@ -945,6 +945,7 @@ namespace Vocaluxe.Screens } } + #region Playlist Actions public void CheckPlaylist() { if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1) @@ -1075,5 +1076,6 @@ namespace Vocaluxe.Screens else SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = 0; } + #endregion Playlist Actions } } diff --git a/Vocaluxe/Screens/PartyScreens/CMenuParty.cs b/Vocaluxe/Screens/PartyScreens/CMenuParty.cs new file mode 100644 index 00000000..332f93e9 --- /dev/null +++ b/Vocaluxe/Screens/PartyScreens/CMenuParty.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using Vocaluxe.Menu; + +namespace Vocaluxe.Screens.PartyScreens +{ + abstract class CMenuParty : CMenu + { + public sealed override void LoadTheme() + { + } + + public sealed override void ReloadTextures() + { + } + + public sealed override void ReloadTheme() + { + } + + public override void UnloadTextures() + { + } + + + } +} diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 18fd9697..94b05046 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -276,6 +276,8 @@ + + Designer