Usegeneric song config in challenge mode, closes #222

This commit is contained in:
Florian Küpper committed 2017-09-12 09:53:07 +02:00
1 parent 7ce9798e2a
commit fc8b56076c
7 files changed
+647 -28

No files matched your search

+1
View File
@@ -15,5 +15,6 @@
<ScreenFile>CPartyScreenChallengeMain</ScreenFile> <ScreenFile>CPartyScreenChallengeMain</ScreenFile>
<ScreenFile>CPartyScreenChallengeConfig</ScreenFile> <ScreenFile>CPartyScreenChallengeConfig</ScreenFile>
<ScreenFile>CPartyScreenChallengeNames</ScreenFile> <ScreenFile>CPartyScreenChallengeNames</ScreenFile>
<ScreenFile>CPartyScreenChallengeSongs</ScreenFile>
</PartyScreens> </PartyScreens>
</root> </root>
@@ -0,0 +1,407 @@
<?xml version="1.0" encoding="utf-8"?>
<Screen xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Informations>
<ScreenName>PartyScreenChallengeSongs</ScreenName>
<ScreenVersion>1</ScreenVersion>
</Informations>
<Backgrounds>
<Background Name="Background1">
<Type>Video</Type>
<SlideShowTextures />
<Video>BG_Video</Video>
<Skin>BG_Default</Skin>
<Color Name="BackgroundColor" />
</Background>
</Backgrounds>
<Statics>
<Static Name="StaticMenuBar">
<Skin />
<Color Name="BackgroundColorAlpha" />
<Rect>
<X>0</X>
<Y>40</Y>
<W>1280</W>
<H>45</H>
<Z>1</Z>
</Rect>
</Static>
</Statics>
<Texts>
<Text Name="TextTitle">
<X>640</X>
<Y>50</Y>
<Z>0</Z>
<H>27</H>
<MaxW>0</MaxW>
<Color Name="TextColor" />
<SelColor Name="TextSelColor" />
<Align>Center</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Bold</Style>
<Font>Outline</Font>
<Text>TR_SCREENCONFIG_TITLE</Text>
</Text>
<Text Name="TextSource">
<X>75</X>
<Y>105</Y>
<Z>0</Z>
<H>27</H>
<MaxW>0</MaxW>
<Color Name="TextColor" />
<SelColor Name="TextSelColor" />
<Align>Left</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Bold</Style>
<Font>Outline</Font>
<Text>TR_SCREENCONFIG_SONGSOURCE</Text>
</Text>
<Text Name="TextSongMode">
<X>75</X>
<Y>290</Y>
<Z>0</Z>
<H>27</H>
<MaxW>0</MaxW>
<Color Name="TextColor" />
<SelColor Name="TextSelColor" />
<Align>Left</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Bold</Style>
<Font>Outline</Font>
<Text>TR_SCREENCONFIG_GAMEMODE</Text>
</Text>
</Texts>
<Buttons>
<Button Name="ButtonNext">
<Skin>Button</Skin>
<SkinSelected>Button</SkinSelected>
<Rect>
<X>985</X>
<Y>600</Y>
<W>150</W>
<H>50</H>
<Z>0</Z>
</Rect>
<Color Name="ButtonColor" />
<SelColor Name="ButtonSelColor" />
<Text Name="Text">
<X>75</X>
<Y>12</Y>
<Z>0</Z>
<H>27</H>
<MaxW>142</MaxW>
<Color Name="ButtonTextColor" />
<SelColor Name="ButtonTextSelColor" />
<Align>Center</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Bold</Style>
<Font>Outline</Font>
<Text>TR_BUTTON_NEXT</Text>
</Text>
<Reflection>
<Height>26</Height>
<Space>10</Space>
</Reflection>
<SelReflection>
<Height>26</Height>
<Space>10</Space>
</SelReflection>
</Button>
<Button Name="ButtonBack">
<Skin>Button</Skin>
<SkinSelected>Button</SkinSelected>
<Rect>
<X>145</X>
<Y>600</Y>
<W>150</W>
<H>50</H>
<Z>0</Z>
</Rect>
<Color Name="ButtonColor" />
<SelColor Name="ButtonSelColor" />
<Text Name="Text">
<X>75</X>
<Y>12</Y>
<Z>0</Z>
<H>27</H>
<MaxW>142</MaxW>
<Color Name="ButtonTextColor" />
<SelColor Name="ButtonTextSelColor" />
<Align>Center</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Bold</Style>
<Font>Outline</Font>
<Text>TR_BUTTON_BACK</Text>
</Text>
<Reflection>
<Height>26</Height>
<Space>10</Space>
</Reflection>
<SelReflection>
<Height>26</Height>
<Space>10</Space>
</SelReflection>
</Button>
</Buttons>
<SongMenus />
<Lyrics />
<SelectSlides>
<SelectSlide Name="SelectSlideSource">
<Skin/>
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<SkinSelected>SelectSlide</SkinSelected>
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<Rect>
<X>500</X>
<Y>100</Y>
<W>700</W>
<H>50</H>
<Z>0</Z>
</Rect>
<RectArrowLeft>
<X>505</X>
<Y>105</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowLeft>
<RectArrowRight>
<X>1155</X>
<Y>105</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowRight>
<Color Name="SelectSlideColor" />
<SelColor Name="SelectSlideSelColor" />
<ArrowColor Name="ArrowColor" />
<ArrowSelColor Name="ArrowSelColor" />
<TextColor Name="TextColorAlpha" />
<TextSelColor Name="TextSelColor" />
<TextH>27</TextH>
<TextRelativeX>50</TextRelativeX>
<TextRelativeY>0</TextRelativeY>
<TextMaxW>205.33</TextMaxW>
<TextFont>Outline</TextFont>
<TextStyle>Bold</TextStyle>
<NumVisible>3</NumVisible>
</SelectSlide>
<SelectSlide Name="SelectSlidePlaylist">
<Skin/>
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<SkinSelected>SelectSlide</SkinSelected>
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<Rect>
<X>500</X>
<Y>160</Y>
<W>700</W>
<H>50</H>
<Z>0</Z>
</Rect>
<RectArrowLeft>
<X>505</X>
<Y>165</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowLeft>
<RectArrowRight>
<X>1155</X>
<Y>165</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowRight>
<Color Name="SelectSlideColor" />
<SelColor Name="SelectSlideSelColor" />
<ArrowColor Name="ArrowColor" />
<ArrowSelColor Name="ArrowSelColor" />
<TextColor Name="TextColorAlpha" />
<TextSelColor Name="TextSelColor" />
<TextH>27</TextH>
<TextRelativeX>50</TextRelativeX>
<TextRelativeY>0</TextRelativeY>
<TextMaxW>600</TextMaxW>
<TextFont>Outline</TextFont>
<TextStyle>Bold</TextStyle>
<NumVisible>3</NumVisible>
</SelectSlide>
<SelectSlide Name="SelectSlideSorting">
<Skin/>
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<SkinSelected>SelectSlide</SkinSelected>
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<Rect>
<X>500</X>
<Y>160</Y>
<W>700</W>
<H>50</H>
<Z>0</Z>
</Rect>
<RectArrowLeft>
<X>505</X>
<Y>165</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowLeft>
<RectArrowRight>
<X>1155</X>
<Y>165</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowRight>
<Color Name="SelectSlideColor" />
<SelColor Name="SelectSlideSelColor" />
<ArrowColor Name="ArrowColor" />
<ArrowSelColor Name="ArrowSelColor" />
<TextColor Name="TextColorAlpha" />
<TextSelColor Name="TextSelColor" />
<TextH>27</TextH>
<TextRelativeX>50</TextRelativeX>
<TextRelativeY>0</TextRelativeY>
<TextMaxW>600</TextMaxW>
<TextFont>Outline</TextFont>
<TextStyle>Bold</TextStyle>
<NumVisible>3</NumVisible>
</SelectSlide>
<SelectSlide Name="SelectSlideCategory">
<Skin/>
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<SkinSelected>SelectSlide</SkinSelected>
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<Rect>
<X>500</X>
<Y>220</Y>
<W>700</W>
<H>50</H>
<Z>0</Z>
</Rect>
<RectArrowLeft>
<X>505</X>
<Y>225</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowLeft>
<RectArrowRight>
<X>1155</X>
<Y>225</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowRight>
<Color Name="SelectSlideColor" />
<SelColor Name="SelectSlideSelColor" />
<ArrowColor Name="ArrowColor" />
<ArrowSelColor Name="ArrowSelColor" />
<TextColor Name="TextColorAlpha" />
<TextSelColor Name="TextSelColor" />
<TextH>27</TextH>
<TextRelativeX>50</TextRelativeX>
<TextRelativeY>0</TextRelativeY>
<TextMaxW>600</TextMaxW>
<TextFont>Outline</TextFont>
<TextStyle>Bold</TextStyle>
<NumVisible>1</NumVisible>
</SelectSlide>
<SelectSlide Name="SelectSlideSongMode">
<Skin/>
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<SkinSelected>SelectSlide</SkinSelected>
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<Rect>
<X>500</X>
<Y>290</Y>
<W>700</W>
<H>50</H>
<Z>0</Z>
</Rect>
<RectArrowLeft>
<X>505</X>
<Y>295</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowLeft>
<RectArrowRight>
<X>1155</X>
<Y>295</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowRight>
<Color Name="SelectSlideColor" />
<SelColor Name="SelectSlideSelColor" />
<ArrowColor Name="ArrowColor" />
<ArrowSelColor Name="ArrowSelColor" />
<TextColor Name="TextColorAlpha" />
<TextSelColor Name="TextSelColor" />
<TextH>27</TextH>
<TextRelativeX>50</TextRelativeX>
<TextRelativeY>0</TextRelativeY>
<TextMaxW>205.33</TextMaxW>
<TextFont>Outline</TextFont>
<TextStyle>Bold</TextStyle>
<NumVisible>2</NumVisible>
</SelectSlide>
<SelectSlide Name="SelectSlideNumMedleySongs">
<Skin/>
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<SkinSelected>SelectSlide</SkinSelected>
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<Rect>
<X>500</X>
<Y>360</Y>
<W>700</W>
<H>50</H>
<Z>0</Z>
</Rect>
<RectArrowLeft>
<X>505</X>
<Y>365</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowLeft>
<RectArrowRight>
<X>1155</X>
<Y>365</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowRight>
<Color Name="SelectSlideColor" />
<SelColor Name="SelectSlideSelColor" />
<ArrowColor Name="ArrowColor" />
<ArrowSelColor Name="ArrowSelColor" />
<TextColor Name="TextColorAlpha" />
<TextSelColor Name="TextSelColor" />
<TextH>27</TextH>
<TextRelativeX>50</TextRelativeX>
<TextRelativeY>0</TextRelativeY>
<TextMaxW>205.33</TextMaxW>
<TextFont>Outline</TextFont>
<TextStyle>Bold</TextStyle>
<NumVisible>5</NumVisible>
</SelectSlide>
</SelectSlides>
<SingNotes />
<NameSelections />
<Equalizers />
<Playlists />
<ParticleEffects />
<ScreenSettings />
</Screen>
@@ -17,8 +17,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using VocaluxeLib.Menu; using VocaluxeLib.Menu;
using VocaluxeLib.Songs;
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
@@ -103,9 +106,11 @@ namespace VocaluxeLib.PartyModes.Challenge
private enum EStage private enum EStage
{ {
Config, Config,
Songs,
Names, Names,
Main, Main,
Singing Singing,
MedleySinging
} }
public struct SData public struct SData
@@ -118,6 +123,14 @@ namespace VocaluxeLib.PartyModes.Challenge
public int[] Jokers; public int[] Jokers;
public List<int> ProfileIDs; public List<int> ProfileIDs;
public ESongSource SongSource;
public ESongSorting Sorting;
public int CategoryIndex;
public int PlaylistID;
public EGameMode GameMode;
public int NumMedleySongs;
public CChallengeRounds Rounds; public CChallengeRounds Rounds;
public List<CResultTableRow> ResultTable; public List<CResultTableRow> ResultTable;
public int[,] Results; public int[,] Results;
@@ -125,6 +138,7 @@ namespace VocaluxeLib.PartyModes.Challenge
public int CurrentRoundNr; public int CurrentRoundNr;
public int[] CatSongIndices; public int[] CatSongIndices;
public List<int> Songs;
} }
private struct SStats private struct SStats
@@ -151,7 +165,25 @@ namespace VocaluxeLib.PartyModes.Challenge
_ScreenSongOptions.Sorting.DuetOptions = EDuetOptions.NoDuets; _ScreenSongOptions.Sorting.DuetOptions = EDuetOptions.NoDuets;
_ScreenSongOptions.Sorting.FilterPlaylistID = -1; _ScreenSongOptions.Sorting.FilterPlaylistID = -1;
GameData = new SData {NumPlayer = 4, NumPlayerAtOnce = 2, NumRounds = 12, NumJokers = 5, RefillJokers = true, CurrentRoundNr = 1, ProfileIDs = new List<int>(), CatSongIndices = null, Results = null}; GameData = new SData
{
NumPlayer = 4,
NumPlayerAtOnce = 2,
NumRounds = 12,
NumJokers = 5,
RefillJokers = true,
CurrentRoundNr = 1,
ProfileIDs = new List<int>(),
Sorting = CBase.Config.GetSongSorting(),
SongSource = ESongSource.TR_ALLSONGS,
PlaylistID = 0,
CategoryIndex = 0,
GameMode = EGameMode.TR_GAMEMODE_NORMAL,
NumMedleySongs = 5,
CatSongIndices = null,
Results = null,
Songs = new List<int>()
};
} }
public override void SetDefaults() public override void SetDefaults()
@@ -194,12 +226,16 @@ namespace VocaluxeLib.PartyModes.Challenge
{ {
case EStage.Config: case EStage.Config:
return _Screens["CPartyScreenChallengeConfig"]; return _Screens["CPartyScreenChallengeConfig"];
case EStage.Songs:
return _Screens["CPartyScreenChallengeSongs"];
case EStage.Names: case EStage.Names:
return _Screens["CPartyScreenChallengeNames"]; return _Screens["CPartyScreenChallengeNames"];
case EStage.Main: case EStage.Main:
return _Screens["CPartyScreenChallengeMain"]; return _Screens["CPartyScreenChallengeMain"];
case EStage.Singing: case EStage.Singing:
return CBase.Graphics.GetScreen(EScreen.Song); return CBase.Graphics.GetScreen(EScreen.Song);
case EStage.MedleySinging:
return CBase.Graphics.GetScreen(EScreen.Sing);
default: default:
throw new ArgumentException("Invalid stage: " + _Stage); throw new ArgumentException("Invalid stage: " + _Stage);
} }
@@ -215,6 +251,9 @@ namespace VocaluxeLib.PartyModes.Challenge
switch (_Stage) switch (_Stage)
{ {
case EStage.Config: case EStage.Config:
_Stage = EStage.Songs;
break;
case EStage.Songs:
_Stage = EStage.Names; _Stage = EStage.Names;
break; break;
case EStage.Names: case EStage.Names:
@@ -226,9 +265,13 @@ namespace VocaluxeLib.PartyModes.Challenge
GameData.Jokers = null; GameData.Jokers = null;
break; break;
case EStage.Main: case EStage.Main:
if (GameData.GameMode == EGameMode.TR_GAMEMODE_MEDLEY)
_Stage = EStage.MedleySinging;
else
_Stage = EStage.Singing; _Stage = EStage.Singing;
_StartNextRound(); _StartNextRound();
break; break;
case EStage.MedleySinging:
case EStage.Singing: case EStage.Singing:
_Stage = EStage.Main; _Stage = EStage.Main;
_UpdateScores(); _UpdateScores();
@@ -246,9 +289,12 @@ namespace VocaluxeLib.PartyModes.Challenge
case EStage.Config: case EStage.Config:
CBase.Graphics.FadeTo(EScreen.Party); CBase.Graphics.FadeTo(EScreen.Party);
return; return;
case EStage.Names: case EStage.Songs:
_Stage = EStage.Config; _Stage = EStage.Config;
break; break;
case EStage.Names:
_Stage = EStage.Songs;
break;
case EStage.Main: case EStage.Main:
_Stage = EStage.Names; _Stage = EStage.Names;
break; break;
@@ -265,8 +311,38 @@ namespace VocaluxeLib.PartyModes.Challenge
public override SScreenSongOptions GetScreenSongOptions() public override SScreenSongOptions GetScreenSongOptions()
{ {
switch(GameData.SongSource)
{
case ESongSource.TR_ALLSONGS:
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting(); _ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
_ScreenSongOptions.Sorting.Tabs = CBase.Config.GetTabs(); _ScreenSongOptions.Sorting.Tabs = CBase.Config.GetTabs();
_ScreenSongOptions.Sorting.FilterPlaylistID = -1;
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
break;
case ESongSource.TR_CATEGORY:
_ScreenSongOptions.Sorting.SongSorting = GameData.Sorting;
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
_ScreenSongOptions.Sorting.FilterPlaylistID = -1;
if (GameData.CatSongIndices == null)
_CreateCatSongIndices();
_ScreenSongOptions.Selection.SongIndex = GameData.CatSongIndices[GameData.CategoryIndex];
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
break;
case ESongSource.TR_PLAYLIST:
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_OFF;
_ScreenSongOptions.Sorting.FilterPlaylistID = GameData.PlaylistID;
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
break;
}
_ScreenSongOptions.Sorting.IgnoreArticles = CBase.Config.GetIgnoreArticles(); _ScreenSongOptions.Sorting.IgnoreArticles = CBase.Config.GetIgnoreArticles();
return _ScreenSongOptions; return _ScreenSongOptions;
@@ -343,30 +419,7 @@ namespace VocaluxeLib.PartyModes.Challenge
public override void SongSelected(int songID) public override void SongSelected(int songID)
{ {
const EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; _PrepareGame(new int[] { songID });
CBase.Game.Reset();
CBase.Game.ClearSongs();
CBase.Game.AddSong(songID, gm);
CBase.Game.SetNumPlayer(GameData.NumPlayerAtOnce);
SPlayer[] players = CBase.Game.GetPlayers();
if (players == null)
return;
if (players.Length < GameData.NumPlayerAtOnce)
return;
CRound c = GameData.Rounds[GameData.CurrentRoundNr - 1];
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
{
//try to fill with the right data
if (c != null)
players[i].ProfileID = GameData.ProfileIDs[c.Players[i]];
else
players[i].ProfileID = -1;
}
CBase.Graphics.FadeTo(EScreen.Sing); CBase.Graphics.FadeTo(EScreen.Sing);
} }
@@ -379,13 +432,65 @@ namespace VocaluxeLib.PartyModes.Challenge
} }
private void _StartNextRound() private void _StartNextRound()
{
if (GameData.GameMode == EGameMode.TR_GAMEMODE_MEDLEY)
{
int[] songIDs = new int[GameData.NumMedleySongs];
for (int i = 0; i < GameData.NumMedleySongs; i++)
{
if (GameData.Songs.Count == 0)
_UpdateSongList();
songIDs[i] = GameData.Songs[0];
GameData.Songs.RemoveAt(0);
}
_PrepareGame(songIDs);
}
else
{ {
_ScreenSongOptions.Selection.RandomOnly = _ScreenSongOptions.Sorting.Tabs != EOffOn.TR_CONFIG_ON; _ScreenSongOptions.Selection.RandomOnly = _ScreenSongOptions.Sorting.Tabs != EOffOn.TR_CONFIG_ON;
_ScreenSongOptions.Selection.CategoryChangeAllowed = _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON; _ScreenSongOptions.Selection.CategoryChangeAllowed = false;
_SetNumJokers(); _SetNumJokers();
_SetTeamNames(); _SetTeamNames();
GameData.CatSongIndices = null; GameData.CatSongIndices = null;
} }
}
private bool _PrepareGame(int[] songIDs)
{
CBase.Game.Reset();
CBase.Game.ClearSongs();
#region PlayerNames
CBase.Game.SetNumPlayer(GameData.NumPlayerAtOnce);
SPlayer[] players = CBase.Game.GetPlayers();
if (players == null)
return false;
if (players.Length < GameData.NumPlayerAtOnce)
return false;
CRound c = GameData.Rounds[GameData.CurrentRoundNr - 1];
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
{
//try to fill with the right data
if (c != null)
players[i].ProfileID = GameData.ProfileIDs[c.Players[i]];
else
players[i].ProfileID = -1;
}
#endregion PlayerNames
#region SongQueue
for (int i = 0; i < songIDs.Length; i++)
CBase.Game.AddSong(songIDs[i], GameData.GameMode);
#endregion SongQueue
return true;
}
private void _SetNumJokers() private void _SetNumJokers()
{ {
@@ -429,6 +534,38 @@ namespace VocaluxeLib.PartyModes.Challenge
_ScreenSongOptions.Selection.TeamNames[i] = CBase.Profiles.GetPlayerName(GameData.ProfileIDs[c.Players[i]]); _ScreenSongOptions.Selection.TeamNames[i] = CBase.Profiles.GetPlayerName(GameData.ProfileIDs[c.Players[i]]);
} }
private void _UpdateSongList()
{
if (GameData.Songs.Count > 0)
return;
switch (GameData.SongSource)
{
case ESongSource.TR_PLAYLIST:
for (int i = 0; i < CBase.Playlist.GetSongCount(GameData.PlaylistID); i++)
{
int id = CBase.Playlist.GetSong(GameData.PlaylistID, i).SongID;
if (CBase.Songs.GetSongByID(id).AvailableGameModes.Contains(EGameMode.TR_GAMEMODE_MEDLEY))
GameData.Songs.Add(id);
}
break;
case ESongSource.TR_ALLSONGS:
ReadOnlyCollection<CSong> avSongs = CBase.Songs.GetSongs();
GameData.Songs.AddRange(avSongs.Where(song => song.AvailableGameModes.Contains(EGameMode.TR_GAMEMODE_MEDLEY)).Select(song => song.ID));
break;
case ESongSource.TR_CATEGORY:
CBase.Songs.SetCategory(GameData.CategoryIndex);
avSongs = CBase.Songs.GetVisibleSongs();
GameData.Songs.AddRange(avSongs.Where(song => song.AvailableGameModes.Contains(EGameMode.TR_GAMEMODE_MEDLEY)).Select(song => song.ID));
CBase.Songs.SetCategory(-1);
break;
}
GameData.Songs.Shuffle();
}
private void _UpdateScores() private void _UpdateScores()
{ {
if (GameData.ResultTable.Count == 0) if (GameData.ResultTable.Count == 0)
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VocaluxeLib.Menu;
namespace VocaluxeLib.PartyModes.Challenge
{
class CPartyScreenChallengeSongs : CMenuPartySongSelection
{
protected override int _ScreenVersion
{
get { return 1; }
}
private new CPartyModeChallenge _PartyMode;
public override void Init()
{
base.Init();
_PartyMode = (CPartyModeChallenge)base._PartyMode;
}
public override void OnShow()
{
Source = _PartyMode.GameData.SongSource;
Sorting = _PartyMode.GameData.Sorting;
Category = _PartyMode.GameData.CategoryIndex;
Playlist = _PartyMode.GameData.PlaylistID;
SongMode = _PartyMode.GameData.GameMode;
NumMedleySongs = _PartyMode.GameData.NumMedleySongs;
base.OnShow();
}
public override void Back()
{
_SaveConfig();
_PartyMode.Back();
}
public override void Next()
{
_SaveConfig();
_PartyMode.Next();
}
public override bool UpdateGame()
{
return true;
}
private void _SaveConfig()
{
_PartyMode.GameData.SongSource = Source;
_PartyMode.GameData.Sorting = Sorting;
_PartyMode.GameData.CategoryIndex = Category;
_PartyMode.GameData.PlaylistID = Playlist;
_PartyMode.GameData.GameMode = SongMode;
_PartyMode.GameData.NumMedleySongs = NumMedleySongs;
}
}
}
@@ -71,6 +71,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CChallengeRounds.cs" /> <Compile Include="CChallengeRounds.cs" />
<Compile Include="CPartyScreenChallengeSongs.cs" />
<Compile Include="GlobalSuppressions.cs" /> <Compile Include="GlobalSuppressions.cs" />
<Compile Include="CPartyModeChallenge.cs" /> <Compile Include="CPartyModeChallenge.cs" />
<Compile Include="CPartyScreenChallengeConfig.cs" /> <Compile Include="CPartyScreenChallengeConfig.cs" />
+5
View File
@@ -644,6 +644,11 @@ namespace Vocaluxe.Screens
_Sso = CParty.GetSongSelectionOptions(); _Sso = CParty.GetSongSelectionOptions();
CSongs.Sort(_Sso.Sorting.SongSorting, _Sso.Sorting.Tabs, _Sso.Sorting.IgnoreArticles, _Sso.Sorting.SearchString, _Sso.Sorting.DuetOptions, _Sso.Sorting.FilterPlaylistID); CSongs.Sort(_Sso.Sorting.SongSorting, _Sso.Sorting.Tabs, _Sso.Sorting.IgnoreArticles, _Sso.Sorting.SearchString, _Sso.Sorting.DuetOptions, _Sso.Sorting.FilterPlaylistID);
if (_Sso.Selection.CategoryIndex != CBase.Songs.GetCurrentCategoryIndex())
{
_SelectedCategoryIndex = _Sso.Selection.CategoryIndex;
_SongMenu.EnterSelectedCategory();
}
_SearchActive = _Sso.Sorting.SearchActive; _SearchActive = _Sso.Sorting.SearchActive;
_SearchText = _Sso.Sorting.SearchString; _SearchText = _Sso.Sorting.SearchString;
+5
View File
@@ -48,6 +48,11 @@ namespace VocaluxeLib.PartyModes
/// </summary> /// </summary>
public int SongIndex; public int SongIndex;
/// <summary>
/// If != -1, the SongMenu should enter show category based on provided category index if possible
/// </summary>
public int CategoryIndex;
/// <summary> /// <summary>
/// If true, the SongMenu should perform the select random song method /// If true, the SongMenu should perform the select random song method
/// </summary> /// </summary>