aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-02 00:43:45 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-02 00:43:45 +0000
commit81105dec41773cbb503ab071e6819bcd4703f845 (patch)
tree333706837eedc28c383f94f35334cb3a8786981a /src
parenta258171e190e67b1a4025994ee96a972cba7ae1f (diff)
downloadusdx-81105dec41773cbb503ab071e6819bcd4703f845.tar.gz
usdx-81105dec41773cbb503ab071e6819bcd4703f845.tar.xz
usdx-81105dec41773cbb503ab071e6819bcd4703f845.zip
first changes to party mode
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3167 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r--src/base/UParty.pas74
-rw-r--r--src/base/USong.pas2
-rw-r--r--src/screens/UScreenSing.pas4
-rw-r--r--src/screens/UScreenSong.pas20
4 files changed, 81 insertions, 19 deletions
diff --git a/src/base/UParty.pas b/src/base/UParty.pas
index bc485dca..cbdaf08d 100644
--- a/src/base/UParty.pas
+++ b/src/base/UParty.pas
@@ -108,7 +108,6 @@ type
TPartyGame = class
private
- bPartyGame: boolean; //< are we playing party or standard mode
CurRound: Integer; //< indicates which of the elements of Rounds is played next (at the moment)
bPartyStarted: Boolean;
@@ -126,12 +125,16 @@ type
procedure SetRankingByScore;
public
+ bPartyGame: boolean; //< are we playing party or standard mode
+
//Teams: TTeamInfo;
Rounds: array of TParty_Round; //< holds info which modes are played in this party game (if started)
Teams: array of TParty_TeamInfo; //< holds info of teams playing in current round (private for easy manipulation of lua functions)
Modes: array of TParty_ModeInfo; //< holds info of registred party modes
+ SungPartySongs: array of integer;
+
property CurrentRound: Integer read CurRound;
constructor Create;
@@ -206,13 +209,17 @@ type
the index stands for the placing,
team is the team number (in the team array)
rank is correct rank if some teams have the
- same score.
+ same score.
}
function GetTeamRanking: AParty_TeamRanking;
{ returns a string like "Team 1 (and Team 2) win" }
function GetWinnerString(Round: integer): UTF8String;
+ procedure SaveSungPartySong(ID: integer);
+{ add when Duet is ready
+ function SongNotSungAndNotDuet(ID, N_DuetSongs: integer): boolean;
+}
destructor Destroy; override;
end;
@@ -239,7 +246,7 @@ const
PR_First = 1;
PR_Second = 2;
PR_Third = 3;
-
+
StandardModus = 0; //Modus Id that will be played in non-party mode
var
@@ -288,6 +295,8 @@ begin
// clear times played
for I := 0 to High(TimesPlayed) do
TimesPlayed[I] := 0;
+
+ SetLength(SungPartySongs, 0);
end;
{ private: some intelligent randomnes for plugins }
@@ -821,7 +830,7 @@ begin
// we set screen song to party mode
// plugin should not have to do this if it
// don't want default procedure to be executed
- ScreenSong.Mode := smPartyMode;
+ ScreenSong.Mode := smPartyClassic; // may need to be commented off
with Modes[Rounds[CurRound].Mode] do
ExecuteDefault := (CallLua(Parent, Functions.BeforeSongSelect));
@@ -873,6 +882,13 @@ begin
else
ExecuteDefault := true;
+ //set correct playersplay
+ if (bPartyGame) then
+ PlayersPlay := Length(Teams);
+{ add when Tournament is ready
+ if (ScreenSong.Mode = smPartyTournament) then
+ PlayersPlay := 2;
+}
// execute default function:
if ExecuteDefault then
begin
@@ -884,10 +900,6 @@ begin
sing screen is shown, or it should be called
by plugin if it wants to define a custom
singscreen start up. }
-
- //set correct playersplay
- if (bPartyGame) then
- PlayersPlay := Length(Teams);
end;
end;
@@ -933,7 +945,16 @@ begin
// display party score screen
Display.FadeTo(@ScreenPartyScore)
else //display standard score screen
+{ add when Tournament is ready
+ begin
+ if (ScreenSong.Mode = smPartyTournament) then
+ Display.FadeTo(@ScreenPartyTournamentWin)
+ else
+}
Display.FadeTo(@ScreenScore);
+{ add when Tournament is ready
+ end;
+}
end;
end;
@@ -1023,4 +1044,41 @@ begin
Result := Language.Translate('PARTY_NOBODY');
end;
+procedure TPartyGame.SaveSungPartySong(ID: integer);
+begin
+ SetLength(SungPartySongs, Length(SungPartySongs) + 1);
+ SungPartySongs[High(SungPartySongs)] := ID;
+end;
+{ add when Duet is ready
+function TPartyGame.SongNotSungAndNotDuet(ID, N_DuetSongs: integer): boolean;
+var
+ I: integer;
+ Sung: boolean;
+begin
+ Sung := false;
+
+ if (CatSongs.Song[ID].isDuet) then
+ begin
+ Result := false;
+ Exit;
+ end;
+
+ for I := 0 to High(SungPartySongs) do
+ begin
+ if (SungPartySongs[I] = ID) then
+ Sung := true;
+ end;
+
+ if (Sung) then
+ begin
+ if (Songs.SongList.Count - High(Party.SungPartySongs) - N_DuetSongs <= 1) then
+ Result := true
+ else
+ Result := false
+ end
+ else
+ Result := true;
+
+end;
+}
end.
diff --git a/src/base/USong.pas b/src/base/USong.pas
index 1dda2825..92d3f82d 100644
--- a/src/base/USong.pas
+++ b/src/base/USong.pas
@@ -64,7 +64,7 @@ uses
type
- TSingMode = ( smNormal, smPartyMode, smPlaylistRandom, smMedley );
+ TSingMode = ( smNormal, smPartyClassic, smPartyFree, smPartyChallenge, smPartyTournament, smJukebox, smPlaylistRandom , smMedley );
TMedleySource = ( msNone, msCalculated, msTag );
diff --git a/src/screens/UScreenSing.pas b/src/screens/UScreenSing.pas
index b339199b..4ce2f1b5 100644
--- a/src/screens/UScreenSing.pas
+++ b/src/screens/UScreenSing.pas
@@ -634,7 +634,7 @@ begin
// error loading song -> go back to previous screen and show some error message
Display.AbortScreenChange;
// select new song in party mode
- if ScreenSong.Mode = smPartyMode then
+ if ScreenSong.Mode = smPartyClassic then
ScreenSong.SelectRandomSong();
if Length(CurrentSong.LastError) > 0 then
ScreenPopupError.ShowPopup(Format(Language.Translate(CurrentSong.LastError), [CurrentSong.ErrorLineNo]))
@@ -665,7 +665,7 @@ begin
//Error Loading Song in Medley Mode -> Go back to Song Screen and Show some Error Message
Display.AbortScreenChange;
// select new song in party mode
- if ScreenSong.Mode = smPartyMode then
+ if ScreenSong.Mode = smPartyClassic then
ScreenSong.SelectRandomSong();
if Length(CurrentSong.LastError) > 0 then
ScreenPopupError.ShowPopup(Format(Language.Translate(CurrentSong.LastError), [CurrentSong.ErrorLineNo]))
diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas
index 879bcbfc..3b500575 100644
--- a/src/screens/UScreenSong.pas
+++ b/src/screens/UScreenSong.pas
@@ -592,7 +592,7 @@ begin
end;
end
//When in party Mode then Ask before Close
- else if (Mode = smPartyMode) then
+ else if (Mode = smPartyClassic) then
begin
AudioPlayback.PlaySound(SoundLib.Back);
CheckFadeTo(@ScreenMain,'MSG_END_PARTY');
@@ -635,7 +635,7 @@ begin
end;
end;
end
- else if (Mode = smPartyMode) then //PartyMode -> Show Menu
+ else if (Mode = smPartyClassic) then //PartyMode -> Show Menu
begin
if (Ini.PartyPopup = 1) then
ScreenSongMenu.MenuShow(SM_Party_Main)
@@ -1596,7 +1596,7 @@ begin
end;
end
//Party Mode
- else if Mode = smPartyMode then
+ else if Mode = smPartyClassic then
begin
SelectRandomSong;
//Show Menu directly in PartyMode
@@ -2006,7 +2006,7 @@ begin
else
SkipTo(Random(CatSongs.VisibleSongs));
end;
- smPartyMode: // one category select category and select random song
+ smPartyClassic: // one category select category and select random song
begin
CatSongs.ShowCategoryList;
CatSongs.ClickCategoryButton(PlaylistMan.CurPlayList);
@@ -2033,7 +2033,7 @@ end;
procedure TScreenSong.SetJoker;
begin
// If Party Mode
- if Mode = smPartyMode then //Show Joker that are available
+ if Mode = smPartyClassic then //Show Joker that are available
begin
if (Length(Party.Teams) >= 1) then
begin
@@ -2114,7 +2114,7 @@ var
Visible: boolean;
begin
//Set Visibility of Party Statics and Text
- Visible := (Mode = smPartyMode);
+ Visible := (Mode = smPartyClassic);
for I := 0 to High(StaticParty) do
Statics[StaticParty[I]].Visible := Visible;
@@ -2137,10 +2137,14 @@ end;
procedure TScreenSong.StartSong;
begin
CatSongs.Selected := Interaction;
+
+ if (Mode = smPartyFree) then
+ Party.SaveSungPartySong(Interaction);
+
StopMusicPreview();
//Party Mode
- if (Mode = smPartyMode) then
+ if (Mode = smPartyClassic) then
begin
FadeTo(@ScreenSing);
end
@@ -2175,7 +2179,7 @@ end;
//Team No of Team (0-5)
procedure TScreenSong.DoJoker (Team: integer);
begin
- if (Mode = smPartyMode) and
+ if (Mode = smPartyClassic) and
(High(Party.Teams) >= Team) and
(Party.Teams[Team].JokersLeft > 0) then
begin