Fix blank screen issue
Also fix some other bugs and improvements (easier party modes, volume fixes, new fields for screens to control volume and popups)
This commit is contained in:
1 parent
36b81e8c1f
commit
26484ad137
62 files changed
+1160
-1964
No files matched your search
@@ -15,14 +15,12 @@
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenChallengeConfig : CMenuParty
|
||||
public class CPartyScreenChallengeConfig : CPartyScreenChallenge
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
@@ -41,33 +39,12 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
private int _MaxNumRounds = 100;
|
||||
private int _RoundSteps = 1;
|
||||
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_ThemeSelectSlides = new string[] {_SelectSlideNumPlayers, _SelectSlideNumMics, _SelectSlideNumRounds};
|
||||
_ThemeButtons = new string[] {_ButtonNext, _ButtonBack};
|
||||
|
||||
_Data = new SDataFromScreen();
|
||||
SFromScreenConfig config = new SFromScreenConfig {NumPlayer = 4, NumPlayerAtOnce = 2, NumRounds = 12};
|
||||
_Data.ScreenConfig = config;
|
||||
}
|
||||
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
try
|
||||
{
|
||||
SDataToScreenConfig config = (SDataToScreenConfig)receivedData;
|
||||
_Data.ScreenConfig.NumPlayer = config.NumPlayer;
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = config.NumPlayerAtOnce;
|
||||
_Data.ScreenConfig.NumRounds = config.NumRounds;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
@@ -81,17 +58,17 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
case Keys.Back:
|
||||
case Keys.Escape:
|
||||
_Back();
|
||||
_PartyMode.Back();
|
||||
break;
|
||||
|
||||
case Keys.Enter:
|
||||
_UpdateSlides();
|
||||
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
_PartyMode.Back();
|
||||
|
||||
if (_Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
_PartyMode.Next();
|
||||
break;
|
||||
|
||||
case Keys.Left:
|
||||
@@ -114,14 +91,14 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
_UpdateSlides();
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
_PartyMode.Back();
|
||||
|
||||
if (_Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
_PartyMode.Next();
|
||||
}
|
||||
|
||||
if (mouseEvent.RB)
|
||||
_Back();
|
||||
_PartyMode.Back();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -150,7 +127,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_SelectSlides[_SelectSlideNumPlayers].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
|
||||
_SelectSlides[_SelectSlideNumPlayers].AddValue(i.ToString());
|
||||
_SelectSlides[_SelectSlideNumPlayers].Selection = _Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
||||
_SelectSlides[_SelectSlideNumPlayers].Selection = _PartyMode.GameData.NumPlayer - _PartyMode.GetMinPlayer();
|
||||
|
||||
_UpdateMicsAtOnce();
|
||||
_SetRoundSteps();
|
||||
@@ -159,21 +136,21 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
private void _UpdateSlides()
|
||||
{
|
||||
int player = _Data.ScreenConfig.NumPlayer;
|
||||
int mics = _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
_Data.ScreenConfig.NumPlayer = _SelectSlides[_SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = _SelectSlides[_SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
|
||||
_Data.ScreenConfig.NumRounds = (_SelectSlides[_SelectSlideNumRounds].Selection + 1) * _RoundSteps;
|
||||
int player = _PartyMode.GameData.NumPlayer;
|
||||
int mics = _PartyMode.GameData.NumPlayerAtOnce;
|
||||
_PartyMode.GameData.NumPlayer = _SelectSlides[_SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
|
||||
_PartyMode.GameData.NumPlayerAtOnce = _SelectSlides[_SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
|
||||
_PartyMode.GameData.NumRounds = (_SelectSlides[_SelectSlideNumRounds].Selection + 1) * _RoundSteps;
|
||||
|
||||
_UpdateMicsAtOnce();
|
||||
_SetRoundSteps();
|
||||
|
||||
if (player != _Data.ScreenConfig.NumPlayer || mics != _Data.ScreenConfig.NumPlayerAtOnce)
|
||||
if (player != _PartyMode.GameData.NumPlayer || mics != _PartyMode.GameData.NumPlayerAtOnce)
|
||||
{
|
||||
int num = CHelper.CombinationCount(_Data.ScreenConfig.NumPlayer, _Data.ScreenConfig.NumPlayerAtOnce);
|
||||
int num = CHelper.CombinationCount(_PartyMode.GameData.NumPlayer, _PartyMode.GameData.NumPlayerAtOnce);
|
||||
while (num > _MaxNumRounds)
|
||||
num -= _RoundSteps;
|
||||
_Data.ScreenConfig.NumRounds = num;
|
||||
_PartyMode.GameData.NumRounds = num;
|
||||
}
|
||||
|
||||
_UpdateSlideRounds();
|
||||
@@ -181,19 +158,18 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
private void _UpdateMicsAtOnce()
|
||||
{
|
||||
//Data.ScreenConfig.NumPlayerAtOnce
|
||||
int maxNum = _MaxNumMics;
|
||||
if (_Data.ScreenConfig.NumPlayer < _MaxNumMics)
|
||||
maxNum = _Data.ScreenConfig.NumPlayer;
|
||||
if (_PartyMode.GameData.NumPlayer < _MaxNumMics)
|
||||
maxNum = _PartyMode.GameData.NumPlayer;
|
||||
|
||||
if (_Data.ScreenConfig.NumPlayerAtOnce > maxNum)
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = maxNum;
|
||||
if (_PartyMode.GameData.NumPlayerAtOnce > maxNum)
|
||||
_PartyMode.GameData.NumPlayerAtOnce = maxNum;
|
||||
|
||||
// build mics at once slide
|
||||
_SelectSlides[_SelectSlideNumMics].Clear();
|
||||
for (int i = 1; i <= maxNum; i++)
|
||||
_SelectSlides[_SelectSlideNumMics].AddValue(i.ToString());
|
||||
_SelectSlides[_SelectSlideNumMics].Selection = _Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||
_SelectSlides[_SelectSlideNumMics].Selection = _PartyMode.GameData.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||
}
|
||||
|
||||
private void _UpdateSlideRounds()
|
||||
@@ -202,31 +178,21 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_SelectSlides[_SelectSlideNumRounds].Clear();
|
||||
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
|
||||
_SelectSlides[_SelectSlideNumRounds].AddValue(i.ToString());
|
||||
_SelectSlides[_SelectSlideNumRounds].Selection = _Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
||||
_SelectSlides[_SelectSlideNumRounds].Selection = _PartyMode.GameData.NumRounds / _RoundSteps - 1;
|
||||
}
|
||||
|
||||
private void _SetRoundSteps()
|
||||
{
|
||||
if (_Data.ScreenConfig.NumPlayerAtOnce < 1 || _Data.ScreenConfig.NumPlayer < 1 || _Data.ScreenConfig.NumPlayerAtOnce > _Data.ScreenConfig.NumPlayer)
|
||||
if (_PartyMode.GameData.NumPlayerAtOnce < 1 || _PartyMode.GameData.NumPlayer < 1 || _PartyMode.GameData.NumPlayerAtOnce > _PartyMode.GameData.NumPlayer)
|
||||
{
|
||||
_RoundSteps = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
int res = _Data.ScreenConfig.NumPlayer / _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int mod = _Data.ScreenConfig.NumPlayer % _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int res = _PartyMode.GameData.NumPlayer / _PartyMode.GameData.NumPlayerAtOnce;
|
||||
int mod = _PartyMode.GameData.NumPlayer % _PartyMode.GameData.NumPlayerAtOnce;
|
||||
|
||||
_RoundSteps = mod == 0 ? res : _Data.ScreenConfig.NumPlayer;
|
||||
}
|
||||
|
||||
private void _Back()
|
||||
{
|
||||
_FadeTo(EScreens.ScreenParty);
|
||||
}
|
||||
|
||||
private void _Next()
|
||||
{
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
_RoundSteps = mod == 0 ? res : _PartyMode.GameData.NumPlayer;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user