some data handling between challenge main screen and challenge game mode
This commit is contained in:
1 parent
99875f4293
commit
bad4b3a5aa
6 files changed
+126
-14
No files matched your search
@@ -52,6 +52,7 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
public struct FromScreenMain
|
public struct FromScreenMain
|
||||||
{
|
{
|
||||||
|
public bool FadeToSongSelection;
|
||||||
}
|
}
|
||||||
#endregion FromScreen
|
#endregion FromScreen
|
||||||
#endregion Communication
|
#endregion Communication
|
||||||
@@ -93,9 +94,9 @@ namespace Vocaluxe.PartyModes
|
|||||||
public PartyModeChallenge()
|
public PartyModeChallenge()
|
||||||
{
|
{
|
||||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||||
_ScreenSongOptions.Selection.PartyMode = false;
|
_ScreenSongOptions.Selection.PartyMode = true;
|
||||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||||
_ScreenSongOptions.Selection.NumJokers = null;
|
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
||||||
|
|
||||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||||
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
||||||
@@ -164,8 +165,20 @@ namespace Vocaluxe.PartyModes
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "PartyScreenChallengeMain":
|
case "PartyScreenChallengeMain":
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = (DataFromScreen)Data;
|
||||||
|
if (data.ScreenMain.FadeToSongSelection)
|
||||||
_Stage = EStage.Singing;
|
_Stage = EStage.Singing;
|
||||||
_Base.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_Base.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (_Stage == EStage.Singing)
|
||||||
|
StartNextRound();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -269,5 +282,11 @@ namespace Vocaluxe.PartyModes
|
|||||||
{
|
{
|
||||||
return MaxNumRounds;
|
return MaxNumRounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StartNextRound()
|
||||||
|
{
|
||||||
|
|
||||||
|
_Base.Graphics.FadeTo(EScreens.ScreenSong);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,12 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
const string ButtonNextRound = "ButtonNextRound";
|
const string ButtonNextRound = "ButtonNextRound";
|
||||||
|
|
||||||
|
private DataFromScreen Data;
|
||||||
|
|
||||||
public PartyScreenChallengeMain()
|
public PartyScreenChallengeMain()
|
||||||
{
|
{
|
||||||
|
Data = new DataFromScreen();
|
||||||
|
Data.ScreenMain = new FromScreenMain();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Init()
|
protected override void Init()
|
||||||
@@ -32,6 +36,22 @@ namespace Vocaluxe.PartyModes
|
|||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void DataToScreen(object ReceivedData)
|
||||||
|
{
|
||||||
|
DataToScreenMain data = new DataToScreenMain();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = (DataToScreenMain)ReceivedData;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_Base.Log.LogError("Error in party mode screen challenge main. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
@@ -46,7 +66,12 @@ namespace Vocaluxe.PartyModes
|
|||||||
{
|
{
|
||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
FadeTo(EScreens.ScreenParty);
|
EndParty();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Keys.Enter:
|
||||||
|
if (Buttons[htButtons(ButtonNextRound)].Selected)
|
||||||
|
NextRound();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,12 +84,13 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
if (MouseEvent.LB && IsMouseOver(MouseEvent))
|
if (MouseEvent.LB && IsMouseOver(MouseEvent))
|
||||||
{
|
{
|
||||||
|
if (Buttons[htButtons(ButtonNextRound)].Selected)
|
||||||
|
NextRound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
{
|
||||||
FadeTo(EScreens.ScreenParty);
|
EndParty();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -90,5 +116,16 @@ namespace Vocaluxe.PartyModes
|
|||||||
{
|
{
|
||||||
base.OnClose();
|
base.OnClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void NextRound()
|
||||||
|
{
|
||||||
|
Data.ScreenMain.FadeToSongSelection = true;
|
||||||
|
_PartyMode.DataFromScreen(_ThemeName, Data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndParty()
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace Vocaluxe.PartyModes
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_Base.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
|
_Base.Log.LogError("Error in party mode screen challenge names. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
public struct FromScreenMain
|
public struct FromScreenMain
|
||||||
{
|
{
|
||||||
|
public bool FadeToSongSelection;
|
||||||
}
|
}
|
||||||
#endregion FromScreen
|
#endregion FromScreen
|
||||||
#endregion Communication
|
#endregion Communication
|
||||||
@@ -93,9 +94,9 @@ namespace Vocaluxe.PartyModes
|
|||||||
public PartyModeChallenge()
|
public PartyModeChallenge()
|
||||||
{
|
{
|
||||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||||
_ScreenSongOptions.Selection.PartyMode = false;
|
_ScreenSongOptions.Selection.PartyMode = true;
|
||||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||||
_ScreenSongOptions.Selection.NumJokers = null;
|
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
||||||
|
|
||||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||||
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
||||||
@@ -164,8 +165,20 @@ namespace Vocaluxe.PartyModes
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "PartyScreenChallengeMain":
|
case "PartyScreenChallengeMain":
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = (DataFromScreen)Data;
|
||||||
|
if (data.ScreenMain.FadeToSongSelection)
|
||||||
_Stage = EStage.Singing;
|
_Stage = EStage.Singing;
|
||||||
_Base.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_Base.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (_Stage == EStage.Singing)
|
||||||
|
StartNextRound();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -269,5 +282,11 @@ namespace Vocaluxe.PartyModes
|
|||||||
{
|
{
|
||||||
return MaxNumRounds;
|
return MaxNumRounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StartNextRound()
|
||||||
|
{
|
||||||
|
|
||||||
|
_Base.Graphics.FadeTo(EScreens.ScreenSong);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,12 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
const string ButtonNextRound = "ButtonNextRound";
|
const string ButtonNextRound = "ButtonNextRound";
|
||||||
|
|
||||||
|
private DataFromScreen Data;
|
||||||
|
|
||||||
public PartyScreenChallengeMain()
|
public PartyScreenChallengeMain()
|
||||||
{
|
{
|
||||||
|
Data = new DataFromScreen();
|
||||||
|
Data.ScreenMain = new FromScreenMain();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Init()
|
protected override void Init()
|
||||||
@@ -32,6 +36,22 @@ namespace Vocaluxe.PartyModes
|
|||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void DataToScreen(object ReceivedData)
|
||||||
|
{
|
||||||
|
DataToScreenMain data = new DataToScreenMain();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = (DataToScreenMain)ReceivedData;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_Base.Log.LogError("Error in party mode screen challenge main. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
@@ -46,7 +66,12 @@ namespace Vocaluxe.PartyModes
|
|||||||
{
|
{
|
||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
FadeTo(EScreens.ScreenParty);
|
EndParty();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Keys.Enter:
|
||||||
|
if (Buttons[htButtons(ButtonNextRound)].Selected)
|
||||||
|
NextRound();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,12 +84,13 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
if (MouseEvent.LB && IsMouseOver(MouseEvent))
|
if (MouseEvent.LB && IsMouseOver(MouseEvent))
|
||||||
{
|
{
|
||||||
|
if (Buttons[htButtons(ButtonNextRound)].Selected)
|
||||||
|
NextRound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
{
|
||||||
FadeTo(EScreens.ScreenParty);
|
EndParty();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -90,5 +116,16 @@ namespace Vocaluxe.PartyModes
|
|||||||
{
|
{
|
||||||
base.OnClose();
|
base.OnClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void NextRound()
|
||||||
|
{
|
||||||
|
Data.ScreenMain.FadeToSongSelection = true;
|
||||||
|
_PartyMode.DataFromScreen(_ThemeName, Data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndParty()
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace Vocaluxe.PartyModes
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_Base.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
|
_Base.Log.LogError("Error in party mode screen challenge names. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user