aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenPartyOptions.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/UScreenPartyOptions.pas')
-rw-r--r--src/screens/UScreenPartyOptions.pas90
1 files changed, 29 insertions, 61 deletions
diff --git a/src/screens/UScreenPartyOptions.pas b/src/screens/UScreenPartyOptions.pas
index 2deffda6..3dce9954 100644
--- a/src/screens/UScreenPartyOptions.pas
+++ b/src/screens/UScreenPartyOptions.pas
@@ -44,38 +44,26 @@ uses
type
TScreenPartyOptions = class(TMenu)
- public
+ private
SelectLevel: cardinal;
SelectPlayList: cardinal;
SelectPlayList2: cardinal;
SelectRounds: cardinal;
- SelectTeams: cardinal;
- SelectPlayers1: cardinal;
- SelectPlayers2: cardinal;
- SelectPlayers3: cardinal;
+
+ IPlaylist: array[0..2] of UTF8String;
+ IPlaylist2: array of UTF8String;
PlayList: integer;
PlayList2: integer;
- Rounds: integer;
- NumTeams: integer;
- NumPlayer1, NumPlayer2, NumPlayer3: integer;
-
+
+ procedure SetPlaylist2;
+ public
constructor Create; override;
function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override;
procedure OnShow; override;
procedure SetAnimationProgress(Progress: real); override;
- procedure SetPlaylist2;
end;
-var
- IPlaylist: array[0..2] of UTF8String;
- IPlaylist2: array of UTF8String;
-
- const
- ITeams: array[0..1] of UTF8String = ('2', '3');
- IPlayers: array[0..3] of UTF8String = ('1', '2', '3', '4');
- IRounds: array[0..5] of UTF8String = ('2', '3', '4', '5', '6', '7');
-
implementation
uses
@@ -122,27 +110,11 @@ begin
//Don'T start when Playlist is Selected and there are no Playlists
if (Playlist = 2) and (Length(PlaylistMan.Playlists) = 0) then
Exit;
- // Don't start when SinglePlayer Teams but only Multiplayer Plugins available
- OnlyMultiPlayer := true;
- for I := 0 to High(DLLMan.Plugins) do
- begin
- OnlyMultiPlayer := (OnlyMultiPlayer and DLLMan.Plugins[I].TeamModeOnly);
- end;
- if (OnlyMultiPlayer) and ((NumPlayer1 = 0) or (NumPlayer2 = 0) or ((NumPlayer3 = 0) and (NumTeams = 1))) then
- begin
- ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_PLUGINS'));
- Exit;
- end;
+
//Save Difficulty
Ini.Difficulty := SelectsS[SelectLevel].SelectedOption;
Ini.SaveLevel;
- //Save Num Teams:
- PartySession.Teams.NumTeams := NumTeams + 2;
- PartySession.Teams.Teaminfo[0].NumPlayers := NumPlayer1+1;
- PartySession.Teams.Teaminfo[1].NumPlayers := NumPlayer2+1;
- PartySession.Teams.Teaminfo[2].NumPlayers := NumPlayer3+1;
-
//Save Playlist
PlaylistMan.Mode := TSingMode( Playlist );
PlaylistMan.CurPlayList := High(cardinal);
@@ -169,9 +141,6 @@ begin
else
PlaylistMan.CurPlayList := Playlist2;
- //Start Party
- PartySession.StartNewParty(Rounds + 2);
-
AudioPlayback.PlaySound(SoundLib.Start);
//Go to Player Screen
FadeTo(@ScreenPartyPlayer);
@@ -191,10 +160,6 @@ begin
if (Interaction = 1) then
begin
SetPlaylist2;
- end //Change Team3 Players visibility
- else if (Interaction = 4) then
- begin
- SelectsS[7].Visible := (NumTeams = 1);
end;
end;
SDLK_LEFT:
@@ -206,10 +171,6 @@ begin
if (Interaction = 1) then
begin
SetPlaylist2;
- end //Change Team3 Players visibility
- else if (Interaction = 4) then
- begin
- SelectsS[7].Visible := (NumTeams = 1);
end;
end;
end;
@@ -229,30 +190,25 @@ begin
IPlaylist2[0] := '---';
//Clear all Selects
- NumTeams := 0;
- NumPlayer1 := 0;
- NumPlayer2 := 0;
- NumPlayer3 := 0;
- Rounds := 5;
PlayList := 0;
PlayList2 := 0;
//Load Screen From Theme
LoadFromTheme(Theme.PartyOptions);
+ Theme.PartyOptions.SelectLevel.oneItemOnly := true;
+ Theme.PartyOptions.SelectLevel.showArrows := true;
SelectLevel := AddSelectSlide(Theme.PartyOptions.SelectLevel, Ini.Difficulty, Theme.ILevel);
+
+ Theme.PartyOptions.SelectPlayList.oneItemOnly := true;
+ Theme.PartyOptions.SelectPlayList.showArrows := true;
SelectPlayList := AddSelectSlide(Theme.PartyOptions.SelectPlayList, PlayList, IPlaylist);
+
+ Theme.PartyOptions.SelectPlayList2.oneItemOnly := true;
+ Theme.PartyOptions.SelectPlayList2.showArrows := true;
SelectPlayList2 := AddSelectSlide(Theme.PartyOptions.SelectPlayList2, PlayList2, IPlaylist2);
- SelectRounds := AddSelectSlide(Theme.PartyOptions.SelectRounds, Rounds, IRounds);
- SelectTeams := AddSelectSlide(Theme.PartyOptions.SelectTeams, NumTeams, ITeams);
- SelectPlayers1 := AddSelectSlide(Theme.PartyOptions.SelectPlayers1, NumPlayer1, IPlayers);
- SelectPlayers2 := AddSelectSlide(Theme.PartyOptions.SelectPlayers2, NumPlayer2, IPlayers);
- SelectPlayers3 := AddSelectSlide(Theme.PartyOptions.SelectPlayers3, NumPlayer3, IPlayers);
Interaction := 0;
-
- //Hide Team3 Players
- SelectsS[7].Visible := false;
end;
procedure TScreenPartyOptions.SetPlaylist2;
@@ -306,7 +262,19 @@ procedure TScreenPartyOptions.OnShow;
begin
inherited;
- Randomize;
+ Party.Clear;
+
+ // check if there are loaded modes
+ if Party.ModesAvailable then
+ begin
+ // modes are loaded
+ Randomize;
+ end
+ else
+ begin // no modes found
+ ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_PLUGINS'));
+ Display.AbortScreenChange;
+ end;
end;
procedure TScreenPartyOptions.SetAnimationProgress(Progress: real);