Usegeneric song config in challenge mode, closes #222
This commit is contained in:
1 parent
7ce9798e2a
commit
fc8b56076c
7 files changed
+655
-36
No files matched your search
@@ -15,5 +15,6 @@
|
||||
<ScreenFile>CPartyScreenChallengeMain</ScreenFile>
|
||||
<ScreenFile>CPartyScreenChallengeConfig</ScreenFile>
|
||||
<ScreenFile>CPartyScreenChallengeNames</ScreenFile>
|
||||
<ScreenFile>CPartyScreenChallengeSongs</ScreenFile>
|
||||
</PartyScreens>
|
||||
</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.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
@@ -103,9 +106,11 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
private enum EStage
|
||||
{
|
||||
Config,
|
||||
Songs,
|
||||
Names,
|
||||
Main,
|
||||
Singing
|
||||
Singing,
|
||||
MedleySinging
|
||||
}
|
||||
|
||||
public struct SData
|
||||
@@ -118,6 +123,14 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
public int[] Jokers;
|
||||
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 List<CResultTableRow> ResultTable;
|
||||
public int[,] Results;
|
||||
@@ -125,6 +138,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
public int CurrentRoundNr;
|
||||
|
||||
public int[] CatSongIndices;
|
||||
public List<int> Songs;
|
||||
}
|
||||
|
||||
private struct SStats
|
||||
@@ -151,7 +165,25 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_ScreenSongOptions.Sorting.DuetOptions = EDuetOptions.NoDuets;
|
||||
_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()
|
||||
@@ -194,12 +226,16 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
case EStage.Config:
|
||||
return _Screens["CPartyScreenChallengeConfig"];
|
||||
case EStage.Songs:
|
||||
return _Screens["CPartyScreenChallengeSongs"];
|
||||
case EStage.Names:
|
||||
return _Screens["CPartyScreenChallengeNames"];
|
||||
case EStage.Main:
|
||||
return _Screens["CPartyScreenChallengeMain"];
|
||||
case EStage.Singing:
|
||||
return CBase.Graphics.GetScreen(EScreen.Song);
|
||||
case EStage.MedleySinging:
|
||||
return CBase.Graphics.GetScreen(EScreen.Sing);
|
||||
default:
|
||||
throw new ArgumentException("Invalid stage: " + _Stage);
|
||||
}
|
||||
@@ -215,6 +251,9 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
switch (_Stage)
|
||||
{
|
||||
case EStage.Config:
|
||||
_Stage = EStage.Songs;
|
||||
break;
|
||||
case EStage.Songs:
|
||||
_Stage = EStage.Names;
|
||||
break;
|
||||
case EStage.Names:
|
||||
@@ -226,9 +265,13 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
GameData.Jokers = null;
|
||||
break;
|
||||
case EStage.Main:
|
||||
_Stage = EStage.Singing;
|
||||
if (GameData.GameMode == EGameMode.TR_GAMEMODE_MEDLEY)
|
||||
_Stage = EStage.MedleySinging;
|
||||
else
|
||||
_Stage = EStage.Singing;
|
||||
_StartNextRound();
|
||||
break;
|
||||
case EStage.MedleySinging:
|
||||
case EStage.Singing:
|
||||
_Stage = EStage.Main;
|
||||
_UpdateScores();
|
||||
@@ -246,9 +289,12 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
case EStage.Config:
|
||||
CBase.Graphics.FadeTo(EScreen.Party);
|
||||
return;
|
||||
case EStage.Names:
|
||||
case EStage.Songs:
|
||||
_Stage = EStage.Config;
|
||||
break;
|
||||
case EStage.Names:
|
||||
_Stage = EStage.Songs;
|
||||
break;
|
||||
case EStage.Main:
|
||||
_Stage = EStage.Names;
|
||||
break;
|
||||
@@ -265,8 +311,38 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
public override SScreenSongOptions GetScreenSongOptions()
|
||||
{
|
||||
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
|
||||
_ScreenSongOptions.Sorting.Tabs = CBase.Config.GetTabs();
|
||||
switch(GameData.SongSource)
|
||||
{
|
||||
case ESongSource.TR_ALLSONGS:
|
||||
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
|
||||
_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();
|
||||
|
||||
return _ScreenSongOptions;
|
||||
@@ -343,30 +419,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
public override void SongSelected(int songID)
|
||||
{
|
||||
const EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
|
||||
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;
|
||||
}
|
||||
_PrepareGame(new int[] { songID });
|
||||
|
||||
CBase.Graphics.FadeTo(EScreen.Sing);
|
||||
}
|
||||
@@ -380,11 +433,63 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
private void _StartNextRound()
|
||||
{
|
||||
_ScreenSongOptions.Selection.RandomOnly = _ScreenSongOptions.Sorting.Tabs != EOffOn.TR_CONFIG_ON;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON;
|
||||
_SetNumJokers();
|
||||
_SetTeamNames();
|
||||
GameData.CatSongIndices = null;
|
||||
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.CategoryChangeAllowed = false;
|
||||
_SetNumJokers();
|
||||
_SetTeamNames();
|
||||
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()
|
||||
@@ -429,6 +534,38 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_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()
|
||||
{
|
||||
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>
|
||||
<ItemGroup>
|
||||
<Compile Include="CChallengeRounds.cs" />
|
||||
<Compile Include="CPartyScreenChallengeSongs.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="CPartyModeChallenge.cs" />
|
||||
<Compile Include="CPartyScreenChallengeConfig.cs" />
|
||||
@@ -109,4 +110,4 @@ rm -f "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\GlobalSuppressions.cs"
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -644,6 +644,11 @@ namespace Vocaluxe.Screens
|
||||
|
||||
_Sso = CParty.GetSongSelectionOptions();
|
||||
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;
|
||||
_SearchText = _Sso.Sorting.SearchString;
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ namespace VocaluxeLib.PartyModes
|
||||
/// </summary>
|
||||
public int SongIndex;
|
||||
|
||||
/// <summary>
|
||||
/// If != -1, the SongMenu should enter show category based on provided category index if possible
|
||||
/// </summary>
|
||||
public int CategoryIndex;
|
||||
|
||||
/// <summary>
|
||||
/// If true, the SongMenu should perform the select random song method
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user