mirror of
https://github.com/Ragora/TribesReplay.git
synced 2026-01-19 17:44:45 +00:00
- Fixed buddy filter. You can now use the Filter option on the JOIN screen to find games that have players in them that are listed on your buddy list. (Use the Email or Warrior Browser functions to add/remove people from your buddy list.) - You can now add a player to your server admin lists (so that server admins can auto-admin players when they join a server, if desired). How this is done: If you are a SuperAdmin (owner of the server), you can go into the lobby and right-click on a player's name. You will then have the ability to add them to your Admin or SuperAdmin lists. - "Vote Spamming" has been prevented in-game. - Added "quickbuy" keyboard shortcuts to use at vehicle station. (Default keys are the 1-6 number keys. 1 is Wildcat, 6 is Havoc). (NOTE: These key bindings are not currently editable. However, since you are on the vehicle purchase pad when they are in effect, they cannot interfere with any custom keys you've created, so you should have no problems.) - Moved some of the CD check from script into code, where it should be. - Missile reticle is improved aesthetically. This is part 1 of 2 of the missile reticle changes. The second part will be in the next patch. - Team Damage ON/OFF can be changed by Admins/SuperAdmins as well as being voted on by players. If you are an Admin or SuperAdmin, then just go to Lobby and look up where the "Vote" options are listed. There are options there to toggle the Team Damage flag. Regular players can also Vote to Enable/Disable Team Damage in the same spot. - Default server prefs have been changed so that the default time limit is now 30 minutes (instead of 20) and Team Damage is OFF. - The "sticking" mouse button problem is now fixed. - Deployables are now easier to place on walls and other surfaces. There were some inconsistencies on which surfaces could be placed upon and those are now resolved. - (gameplay change) Flag captures are now worth 100 points, instead of 1 point. Additionally, each time someone grabs the flag *from the enemy flag stand* they will gain 1 point, regardless of whether they actually capture it or not. You will ONLY get this single point if the flag was actually on the flagstand. You will NOT get the point by touching the flag anywhere else on the field. This change will help prevent tie situations and will reward aggressive offensive play. NOTE: The "touch" point can only be gained once every 20 seconds...so a "scrum" around the flag base will not result in a large group of points being gained. - (gameplay change) Deployable inventory stations can no longer be deployed directly next to each other. They must be at least 20 meters apart in order to be deployed properly. - (gameplay change) Many team damage fixes occurred. When Team Damage is OFF the following are now true: Friendly teammates are no longer prevented from destroying deployables. The ELF will no longer drain energy from friendly players. If a friendly player blinds another friendly player with Whiteout grenades, then a message is displayed in the Chat HUD so that the blinded person knows who did it. (There are more Team Damage changes coming in the next patch.) - (gameplay change) Medium now has a standard loadout of 12 grenades in the grenade launcher instead of 10. Light: 10; Medium: 12; Heavy: 15. - (gameplay change) Deployable pulse sensors now have a range of 150m instead of 120m to make them a more attractive option to deploy. - (gameplay change) Ejection speed increased slightly to more easily accomodate jumping out of moving vehicles. - (gameplay change) Siege: Alcatraz. The generators have been moved around a bit. There are two entrances to that base. One is the "front door" and the other is the "back door". (The back door is the one that has a team-pass-only force field blocking enemies from the switch room.) There is now an upper generator down the chute from the "front door" that powers the "back door" force field. Additionally, there is a solar panel outside that powers the base turrets and sentry turrets. None of these generators have to be destroyed to get to the switch, but their destruction makes it MUCH easier to do so. There are four generators total on this map (all are waypointed now), and the destruction of all four is necessary before the base power will go down. - (gameplay change) Siege: Caldera. The generator has been moved out of the switch room and into the very big main room that has the inventory stations in it. It is no longer necessary to destroy the generators in a particular sequence. Destroying the two main generators (Primary and Secondary) will drop the force field that protects the switch. Both gens must be down in order for the switch force field to drop.
617 lines
19 KiB
C#
617 lines
19 KiB
C#
//------------------------------------------------------------------------------
|
|
//
|
|
// LobbyGui.cs
|
|
//
|
|
//------------------------------------------------------------------------------
|
|
|
|
$InLobby = false;
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyGui::onAdd( %this )
|
|
{
|
|
// Add the Player popup menu:
|
|
new GuiControl(LobbyPlayerActionDlg) {
|
|
profile = "GuiModelessDialogProfile";
|
|
horizSizing = "width";
|
|
vertSizing = "height";
|
|
position = "0 0";
|
|
extent = "640 480";
|
|
minExtent = "8 8";
|
|
visible = "1";
|
|
setFirstResponder = "0";
|
|
modal = "1";
|
|
|
|
new ShellPopupMenu( LobbyPlayerPopup ) {
|
|
profile = "ShellPopupProfile";
|
|
position = "0 0";
|
|
extent = "0 0";
|
|
minExtent = "0 0";
|
|
visible = "1";
|
|
maxPopupHeight = "200";
|
|
noButtonStyle = "1";
|
|
};
|
|
};
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyGui::onWake( %this )
|
|
{
|
|
if ( !%this.initialized )
|
|
{
|
|
LobbyPlayerList.setSortColumn( $pref::Lobby::SortColumnKey );
|
|
LobbyPlayerList.setSortIncreasing( $pref::Lobby::SortInc );
|
|
|
|
%this.initialized = true;
|
|
}
|
|
|
|
$InLobby = true;
|
|
|
|
//pop any key maps
|
|
moveMap.pop();
|
|
if ( isObject( passengerkeys ) )
|
|
passengerKeys.pop();
|
|
if ( isObject( observerBlockMap ) )
|
|
observerBlockMap.pop();
|
|
if ( isObject( observerMap ) )
|
|
observerMap.pop();
|
|
|
|
$enableDirectInput = "0";
|
|
deactivateDirectInput();
|
|
|
|
LobbyMessageVector.attach(HudMessageVector);
|
|
LobbyMessageScroll.scrollToBottom();
|
|
updateLobbyPlayerList();
|
|
|
|
LobbyServerName.setText( $clServerName );
|
|
|
|
%headerStyle = "<font:" @ $ShellLabelFont @ ":" @ $ShellFontSize @ "><color:00DC00>";
|
|
%statusText = "<spop><spush>" @ %headerStyle @ "MISSION TYPE:<spop>" SPC $clMissionType
|
|
NL "<spush>" @ %headerStyle @ "MISSION:<spop>" SPC $clMissionName
|
|
NL "<spush>" @ %headerStyle @ "OBJECTIVES:<spop>";
|
|
|
|
for ( %line = 0; %this.objLine[%line] !$= ""; %line++ )
|
|
%statusText = %statusText NL "<lmargin:10>* <lmargin:24>" @ %this.objLine[%line];
|
|
|
|
LobbyStatusText.setText( %statusText );
|
|
|
|
fillLobbyVoteMenu();
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyGui::onSleep( %this )
|
|
{
|
|
if ( %this.playerDialogOpen )
|
|
LobbyPlayerPopup.forceClose();
|
|
|
|
LobbyVoteMenu.clear();
|
|
LobbyVoteMenu.mode = "";
|
|
LobbyCancelBtn.setVisible( false );
|
|
LobbyStatusText.setText( "" );
|
|
$InLobby = false;
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function lobbyDisconnect()
|
|
{
|
|
MessageBoxYesNo( "CONFIRM", "Are you sure you want to leave this game?", "lobbyLeaveGame();", "" );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function lobbyLeaveGame()
|
|
{
|
|
Canvas.popDialog( LobbyGui );
|
|
Disconnect();
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function lobbyReturnToGame()
|
|
{
|
|
Canvas.setContent( PlayGui );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyChatEnter::onEscape( %this )
|
|
{
|
|
%this.setValue( "" );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyChatEnter::send( %this )
|
|
{
|
|
%text = %this.getValue();
|
|
if ( %text $= "" )
|
|
%text = " ";
|
|
commandToServer( 'MessageSent', %text );
|
|
%this.setValue( "" );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerList::initColumns( %this )
|
|
{
|
|
%this.clear();
|
|
%this.clearColumns();
|
|
%this.addColumn( 0, " ", 24, 24, 24, "center" ); // Flag column
|
|
%this.addColumn( 6, "lobby_headset", 36, 36, 36, "headericon" ); // Voice Com column
|
|
%this.addColumn( 1, "Player", $pref::Lobby::Column1, 50, 200 );
|
|
if ( $clTeamCount > 1 )
|
|
%this.addColumn( 2, "Team", $pref::Lobby::Column2, 50, 200 );
|
|
%this.addColumn( 3, "Score", $pref::Lobby::Column3, 25, 200, "numeric center" );
|
|
%this.addColumn( 4, "Ping", $pref::Lobby::Column4, 25, 200, "numeric center" );
|
|
%this.addColumn( 5, "PL", $pref::Lobby::Column5, 25, 200, "numeric center" );
|
|
|
|
commandToServer( 'getScores' );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerList::onColumnResize( %this, %col, %size )
|
|
{
|
|
$pref::Lobby::Column[%this.getColumnKey( %col )] = %size;
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerList::onSetSortKey( %this, %key, %increasing )
|
|
{
|
|
$pref::Lobby::SortColumnKey = %key;
|
|
$pref::Lobby::SortInc = %increasing;
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function updateLobbyPlayerList()
|
|
{
|
|
if ( $InLobby )
|
|
{
|
|
// Let the server know we want an update:
|
|
commandToServer( 'getScores' );
|
|
schedule( 4000, 0, updateLobbyPlayerList );
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function lobbyUpdatePlayer( %clientId )
|
|
{
|
|
%player = $PlayerList[%clientId];
|
|
if ( !isObject( %player ) )
|
|
{
|
|
warn( "lobbyUpdatePlayer( " @ %clientId @ " ) - there is no client object with that id!" );
|
|
return;
|
|
}
|
|
|
|
// Build the text:
|
|
if ( %player.isSuperAdmin )
|
|
%tag = "SA";
|
|
else if ( %player.isAdmin )
|
|
%tag = "A";
|
|
else if ( %player.isBot )
|
|
%tag = "B";
|
|
else
|
|
%tag = " ";
|
|
|
|
if ( %player.canListen )
|
|
{
|
|
if ( %player.voiceEnabled )
|
|
{
|
|
%voiceIcons = "lobby_icon_speak";
|
|
if ( %player.isListening )
|
|
%voiceIcons = %voiceIcons @ ":lobby_icon_listen";
|
|
}
|
|
else
|
|
%voiceIcons = %player.isListening ? "lobby_icon_listen" : "";
|
|
}
|
|
else
|
|
%voiceIcons = "shll_icon_timedout";
|
|
|
|
if ( $clTeamCount > 1 )
|
|
{
|
|
if ( %player.teamId == 0 )
|
|
%teamName = "Observer";
|
|
else
|
|
%teamName = $clTeamScore[%player.teamId, 0] $= "" ? "-" : $clTeamScore[%player.teamId, 0];
|
|
%text = %tag TAB %voiceIcons TAB %player.name TAB %teamName TAB %player.score TAB %player.ping TAB %player.packetLoss;
|
|
}
|
|
else
|
|
%text = %tag TAB %voiceIcons TAB %player.name TAB %player.score TAB %player.ping TAB %player.packetLoss;
|
|
|
|
if ( LobbyPlayerList.getRowNumById( %clientId ) == -1 )
|
|
LobbyPlayerList.addRow( %clientId, %text );
|
|
else
|
|
LobbyPlayerList.setRowById( %clientId, %text );
|
|
|
|
if ( $InLobby )
|
|
LobbyPlayerList.sort();
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function lobbyRemovePlayer( %clientId )
|
|
{
|
|
LobbyPlayerList.removeRowById( %clientId );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerList::onRightMouseDown( %this, %column, %row, %mousePos )
|
|
{
|
|
// Open the action menu:
|
|
%clientId = %this.getRowId( %row );
|
|
LobbyPlayerPopup.player = $PlayerList[%clientId];
|
|
|
|
if ( LobbyPlayerPopup.player !$= "" )
|
|
{
|
|
LobbyPlayerPopup.position = %mousePos;
|
|
Canvas.pushDialog( LobbyPlayerActionDlg );
|
|
LobbyPlayerPopup.forceOnAction();
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerActionDlg::onWake( %this )
|
|
{
|
|
LobbyGui.playerDialogOpen = true;
|
|
fillPlayerPopupMenu();
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerActionDlg::onSleep( %this )
|
|
{
|
|
LobbyGui.playerDialogOpen = false;
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerPopup::onSelect( %this, %id, %text )
|
|
{
|
|
//the id's for these are used in DefaultGame::sendGamePlayerPopupMenu()...
|
|
//mute: 1
|
|
//admin: 2
|
|
//kick: 3
|
|
//ban: 4
|
|
//force observer: 5
|
|
//switch team: 6
|
|
|
|
switch( %id )
|
|
{
|
|
case 1: // Mute/Unmute
|
|
togglePlayerMute(%this.player.clientId);
|
|
|
|
case 2: // Admin
|
|
MessageBoxYesNo( "CONFIRM", "Are you sure you want to make " @ %this.player.name @ " an admin?",
|
|
"lobbyPlayerVote( VoteAdminPlayer, \"ADMIN player\", " @ %this.player.clientId @ " );" );
|
|
|
|
case 3: // Kick
|
|
MessageBoxYesNo( "CONFIRM", "Are you sure you want to kick " @ %this.player.name @ "?",
|
|
"lobbyPlayerVote( VoteKickPlayer, \"KICK player\", " @ %this.player.clientId @ " );" );
|
|
|
|
case 4: // Ban
|
|
MessageBoxYesNo( "CONFIRM", "Are you sure you want to ban " @ %this.player.name @ "?",
|
|
"lobbyPlayerVote( BanPlayer, \"BAN player\", " @ %this.player.clientId @ " );" );
|
|
|
|
case 5: // force observer
|
|
forceToObserver(%this.player.clientId);
|
|
|
|
case 6: //change team 1
|
|
changePlayersTeam(%this.player.clientId, 1);
|
|
|
|
case 7: //change team 2
|
|
changePlayersTeam(%this.player.clientId, 2);
|
|
|
|
case 8:
|
|
adminAddPlayerToGame(%this.player.clientId);
|
|
|
|
case 9: // enable/disable voice communication
|
|
togglePlayerVoiceCom( %this.player );
|
|
|
|
case 10:
|
|
confirmAdminListAdd( %this.player, false );
|
|
|
|
case 11:
|
|
confirmAdminListAdd( %this.player, true );
|
|
}
|
|
|
|
Canvas.popDialog( LobbyPlayerActionDlg );
|
|
}
|
|
|
|
function confirmAdminListAdd( %client, %super )
|
|
{
|
|
if( %super )
|
|
MessageBoxYesNo( "CONFIRM", "Are you sure you want to add " @ %client.name @ " to the server super admin list?", "toSuperList( " @ %client.clientId @ " );" );
|
|
|
|
else
|
|
MessageBoxYesNo( "CONFIRM", "Are you sure you want to add " @ %client.name @ " to the server admin list?", "toAdminList( " @ %client.clientId @ " );" );
|
|
}
|
|
|
|
function toSuperList( %client )
|
|
{
|
|
commandToServer( 'AddToSuperAdminList', %client );
|
|
}
|
|
|
|
function toAdminList( %client )
|
|
{
|
|
commandToServer( 'AddToAdminList', %client );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyPlayerPopup::onCancel( %this )
|
|
{
|
|
Canvas.popDialog( LobbyPlayerActionDlg );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function togglePlayerMute(%client)
|
|
{
|
|
commandToServer( 'togglePlayerMute', %client );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function togglePlayerVoiceCom( %playerRep )
|
|
{
|
|
commandToServer( 'ListenTo', %playerRep.clientId, !%playerRep.voiceEnabled, true );
|
|
//if ( !%playerRep.isSmurf )
|
|
// update client pref
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function forceToObserver( %client )
|
|
{
|
|
commandToServer( 'forcePlayerToObserver', %client );
|
|
}
|
|
|
|
function AdminAddPlayerToGame(%client)
|
|
{
|
|
CommandToServer( 'clientAddToGame', %client );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function changePlayersTeam(%client, %team)
|
|
{
|
|
commandToServer( 'changePlayersTeam', %client, %team);
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function fillLobbyVoteMenu()
|
|
{
|
|
LobbyVoteMenu.key++;
|
|
LobbyVoteMenu.clear();
|
|
LobbyVoteMenu.tourneyChoose = 0;
|
|
commandToServer( 'GetVoteMenu', LobbyVoteMenu.key );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function fillLobbyTeamMenu()
|
|
{
|
|
LobbyVoteMenu.key++;
|
|
LobbyVoteMenu.clear();
|
|
LobbyVoteMenu.mode = "team";
|
|
commandToServer( 'GetTeamList', LobbyVoteMenu.key );
|
|
LobbyCancelBtn.setVisible( true );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function fillPlayerPopupMenu()
|
|
{
|
|
LobbyPlayerPopup.key++;
|
|
LobbyPlayerPopup.clear();
|
|
|
|
LobbyPlayerPopup.add(LobbyPlayerPopup.player.name, 0);
|
|
commandToServer( 'GetPlayerPopupMenu', LobbyPlayerPopup.player.clientId, LobbyPlayerPopup.key );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function fillLobbyMissionTypeMenu()
|
|
{
|
|
LobbyVoteMenu.key++;
|
|
LobbyVoteMenu.clear();
|
|
LobbyVoteMenu.mode = "type";
|
|
commandToServer( 'GetMissionTypes', LobbyVoteMenu.key );
|
|
LobbyCancelBtn.setVisible( true );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function fillLobbyMissionMenu( %type, %typeName )
|
|
{
|
|
LobbyVoteMenu.key++;
|
|
LobbyVoteMenu.clear();
|
|
LobbyVoteMenu.mode = "mission";
|
|
LobbyVoteMenu.missionType = %type;
|
|
LobbyVoteMenu.typeName = %typeName;
|
|
commandToServer( 'GetMissionList', LobbyVoteMenu.key, %type );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function fillLobbyTimeLimitMenu()
|
|
{
|
|
LobbyVoteMenu.key++;
|
|
LobbyVoteMenu.clear();
|
|
LobbyVoteMenu.mode = "timeLimit";
|
|
commandToServer( 'GetTimeLimitList', LobbyVoteMenu.key );
|
|
LobbyCancelBtn.setVisible( true );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
addMessageCallback( 'MsgVoteItem', handleVoteItemMessage );
|
|
addMessageCallback( 'MsgPlayerPopupItem', handlePlayerPopupMessage );
|
|
addMessageCallback( 'MsgVotePassed', handleVotePassedMessage );
|
|
addMessageCallback( 'MsgVoteFailed', handleVoteFailedMessage );
|
|
addMessageCallback( 'MsgAdminPlayer', handleAdminPlayerMessage );
|
|
addMessageCallback( 'MsgAdminAdminPlayer', handleAdminAdminPlayerMessage );
|
|
addMessageCallback( 'MsgSuperAdminPlayer', handleSuperAdminPlayerMessage );
|
|
addMessageCallback( 'MsgAdminForce', handleAdminForceMessage );
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handleAdminForceMessage()
|
|
{
|
|
alxPlay(AdminForceSound, 0, 0, 0);
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handleAdminAdminPlayerMessage( %msgType, %msgString, %client )
|
|
{
|
|
%player = $PlayerList[%client];
|
|
if(%player)
|
|
%player.isAdmin = true;
|
|
alxPlay(AdminForceSound, 0, 0, 0);
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handleAdminPlayerMessage( %msgType, %msgString, %client )
|
|
{
|
|
%player = $PlayerList[%client];
|
|
if(%player)
|
|
%player.isAdmin = true;
|
|
alxPlay(VotePassSound, 0, 0, 0);
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handleSuperAdminPlayerMessage( %msgType, %msgString, %client )
|
|
{
|
|
%player = $PlayerList[%client];
|
|
if(%player)
|
|
{
|
|
%player.isSuperAdmin = true;
|
|
%player.isAdmin = true;
|
|
}
|
|
alxPlay(AdminForceSound, 0, 0, 0);
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handleVoteItemMessage( %msgType, %msgString, %key, %voteName, %voteActionMsg, %voteText, %sort )
|
|
{
|
|
if ( %key != LobbyVoteMenu.key )
|
|
return;
|
|
|
|
%index = LobbyVoteMenu.rowCount();
|
|
LobbyVoteMenu.addRow( %index, detag( %voteText ) );
|
|
if ( %sort )
|
|
LobbyVoteMenu.sort( 0 );
|
|
$clVoteCmd[%index] = detag( %voteName );
|
|
$clVoteAction[%index] = detag( %voteActionMsg );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handlePlayerPopupMessage( %msgType, %msgString, %key, %voteName, %voteActionMsg, %voteText, %popupEntryId )
|
|
{
|
|
if ( %key != LobbyPlayerPopup.key )
|
|
return;
|
|
|
|
LobbyPlayerPopup.add( " " @ detag( %voteText ), %popupEntryId );
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handleVotePassedMessage( %msgType, %msgString, %voteName, %voteText )
|
|
{
|
|
if ( $InLobby )
|
|
fillLobbyVoteMenu();
|
|
|
|
alxPlay(VotePassSound, 0, 0, 0);
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function handleVoteFailedMessage( %msgType, %msgString, %voteName, %voteText )
|
|
{
|
|
if ( $InLobby )
|
|
fillLobbyVoteMenu();
|
|
|
|
alxPlay(VoteNotPassSound, 0, 0, 0);
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function lobbyVote()
|
|
{
|
|
%id = LobbyVoteMenu.getSelectedId();
|
|
%text = LobbyVoteMenu.getRowTextById( %id );
|
|
|
|
switch$ ( LobbyVoteMenu.mode )
|
|
{
|
|
case "": // Default case...
|
|
// Test for special cases:
|
|
switch$ ( $clVoteCmd[%id] )
|
|
{
|
|
case "JoinGame":
|
|
CommandToServer( 'clientJoinGame' );
|
|
schedule( 100, 0, lobbyReturnToGame );
|
|
return;
|
|
|
|
case "ChooseTeam":
|
|
fillLobbyTeamMenu();
|
|
return;
|
|
|
|
case "VoteTournamentMode":
|
|
LobbyVoteMenu.tourneyChoose = 1;
|
|
fillLobbyMissionTypeMenu();
|
|
return;
|
|
|
|
case "VoteMatchStart":
|
|
startNewVote( "VoteMatchStart" );
|
|
schedule( 100, 0, lobbyReturnToGame );
|
|
return;
|
|
|
|
case "MakeObserver":
|
|
commandToServer( 'ClientMakeObserver' );
|
|
schedule( 100, 0, lobbyReturnToGame );
|
|
return;
|
|
|
|
case "VoteChangeMission":
|
|
fillLobbyMissionTypeMenu();
|
|
return;
|
|
|
|
case "VoteChangeTimeLimit":
|
|
fillLobbyTimeLimitMenu();
|
|
return;
|
|
|
|
case "Addbot":
|
|
commandToServer( 'addBot' );
|
|
return;
|
|
}
|
|
|
|
case "team":
|
|
commandToServer( 'ClientJoinTeam', %id++ );
|
|
LobbyVoteMenu.reset();
|
|
return;
|
|
|
|
case "type":
|
|
fillLobbyMissionMenu( $clVoteCmd[%id], %text );
|
|
return;
|
|
|
|
case "mission":
|
|
if( !LobbyVoteMenu.tourneyChoose )
|
|
{
|
|
startNewVote( "VoteChangeMission",
|
|
%text, // Mission display name
|
|
LobbyVoteMenu.typeName, // Mission type display name
|
|
$clVoteCmd[%id], // Mission id
|
|
LobbyVoteMenu.missionType ); // Mission type id
|
|
}
|
|
else
|
|
{
|
|
startNewVote( "VoteTournamentMode",
|
|
%text, // Mission display name
|
|
LobbyVoteMenu.typeName, // Mission type display name
|
|
$clVoteCmd[%id], // Mission id
|
|
LobbyVoteMenu.missionType ); // Mission type id
|
|
LobbyVoteMenu.tourneyChoose = 0;
|
|
}
|
|
LobbyVoteMenu.reset();
|
|
return;
|
|
|
|
case "timeLimit":
|
|
startNewVote( "VoteChangeTimeLimit", $clVoteCmd[%id] );
|
|
LobbyVoteMenu.reset();
|
|
return;
|
|
}
|
|
|
|
startNewVote( $clVoteCmd[%id], $clVoteAction[%id] );
|
|
fillLobbyVoteMenu();
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function LobbyVoteMenu::reset( %this )
|
|
{
|
|
%this.mode = "";
|
|
%this.tourneyChoose = 0;
|
|
LobbyCancelBtn.setVisible( false );
|
|
fillLobbyVoteMenu();
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
function lobbyPlayerVote(%voteType, %actionMsg, %playerId)
|
|
{
|
|
startNewVote(%voteType, %playerId, 0, 0, 0, true);
|
|
fillLobbyVoteMenu();
|
|
}
|