TribesReplay/base/scripts/ChooseFilterDlg.cs
Robert MacGregor f9ca0b52f9 v22337 (04/13/01):
**SIEGE GAMEPLAY CHANGE**: When attacking a base, you will see red waypoints on the generators. When those generators are destroyed, the waypoints will change to green. If the generators are repaired thereafter, they will return to red. If you are on the defender team, these colors are reversed (green normally, red if destroyed, green if repaired again). This will help teams coordinate attack and defense more easily.

**FLARE GREANDE GAMEPLAY CHANGE**: Each flare will only attract ONE missile now. When the missile hits the flare, the flare will be destroyed. Only the first missile fired after the flare is thrown will be fooled by that flare. Other missiles must be attracted by other flares in order to be avoided.

*There was a problem where emails were getting cloned multiple times for some folks. This is fixed now and no longer occurs.

*There was an issue where the single player game type was not being properly cleared for folks when they left single player and went to other games. This is fixed now.

*A stray underground generator was removed from Caldera.

*The name column will no longer jump to the top when folks leave and join a room, thus making it easier to stay focused on a particular player's name.

*If you steal a vehicle, the vehicle's sensor radius will not switch to the stealing player's team. In otherwords, the sensor of the vehicle will still report to the original team's sensor net...not the team that stole the vehicle. That's as design and is one of the drawbacks of using a stolen vehicle.

*Bounty & Hunter: The player icons on the command maps are now the correct colors.

*More items have correct names and tags on the command map and in the HUD. There were instances like "East Generator Generator". Those have been eliminated.

*The last patch accidentally eliminated the "PlayerXXX joined YYYY game. Click here to join." links from the CHAT. This has been resolved and is now available again.

*Players are no longer able to squeeze in under the tires of vehicles and play Superman by lifting them off the ground. ; )

*Bots were getting stuck in Riverdance when the fell in the water near the bridge. This has been fixed.

*Added more filtering options so that the filters for the server query (JOIN) screen are more powerful and flexible.

*Added a Linux indicator so users can tell whether they are joining a Win32 or Linux server. (Shouldn't make any difference to game play, but we felt you'd like to know.)

*Fixed a small texture leak on 3Space objects.

*Added an underwater satchel charge effect. Slightly increased the delay time between activating the satchel and the time that it actually explodes (this was as designed...a minor bug was causing it to explode too soon).
2017-07-17 23:07:50 -04:00

349 lines
11 KiB
C#

//------------------------------------------------------------------------------
//
// ChooseFilterDlg.cs
//
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function ChooseFilterDlg::onWake( %this )
{
CF_FilterList.clear();
CF_FilterList.addRow( 0, "All servers" );
CF_FilterList.addRow( 1, "Servers with buddies" );
CF_FilterList.addRow( 2, "Favorites only" );
for ( %i = 0; $pref::ServerBrowser::Filter[%i] !$= ""; %i++ )
CF_FilterList.addRow( %i + 3, $pref::ServerBrowser::Filter[%i] );
if ( $pref::ServerBrowser::activeFilter >= %i + 3 )
$pref::ServerBrowser::activeFilter = 0;
CF_FilterList.setSelectedById( $pref::ServerBrowser::activeFilter );
CF_GoBtn.makeFirstResponder( 1 );
}
//------------------------------------------------------------------------------
function ChooseFilterDlg::onSleep( %this )
{
// export out all the filters...
%count = CF_FilterList.rowCount();
for ( %row = 3; %row < %count; %row++ )
$pref::ServerBrowser::Filter[%row - 3] = CF_FilterList.getRowText( %row );
}
//------------------------------------------------------------------------------
function ChooseFilterDlg::newFilter( %this )
{
// get an updated list of game types:
queryMasterGameTypes();
%this.editFilterIndex = CF_FilterList.rowCount();
FilterEditName.setValue( "New Filter" );
FilterEditMinPlayers.setValue( 0 );
FilterEditMaxPlayers.setValue( 255 );
FilterEditGameType.setText( "Any" );
FilterEditMissionType.setText( "Any" );
for ( %i = 0; isObject( "FilterEditLocMask" @ %i ); %i++ )
( "FilterEditLocMask" @ %i ).setValue( true );
FilterEditUsePingTgl.setValue( false );
FilterEditMaxPing.setValue( 50 );
FilterEditMaxPing.setVisible( false );
Canvas.pushDialog( FilterEditDlg );
}
//------------------------------------------------------------------------------
function ChooseFilterDlg::editFilter( %this )
{
%rowId = CF_FilterList.getSelectedId();
if ( %rowId < 3 ) // can't edit default filters
return;
// get an updated list of game types:
queryMasterGameTypes();
%rowText = CF_FilterList.getRowTextById( %rowId );
%filterName = getField( %rowText, 0 );
%gameType = getField( %rowText, 1 );
if ( %gameType $= "" )
%gameType = "Any";
%misType = getField( %rowText, 2 );
if ( %misType $= "" )
%misType = "Any";
%minPlayers = getField( %rowText, 3 );
if ( %minPlayers $= "" )
%minPlayers = 0;
%maxPlayers = getField( %rowText, 4 );
if ( %maxPlayers $= "" )
%maxPlayers = 255;
%regionCode = getField( %rowText, 5 );
if ( %regionCode $= "" )
%regionCode = 4294967295;
%maxPing = getField( %rowText, 6 );
%maxBots = getField( %rowText, 7 );
if ( %maxBots $= "" )
%maxBots = 16;
%minCPU = getField( %rowText, 8 );
if ( %minCPU $= "" )
%minCPU = 0;
%flags = getField( %rowText, 9 );
FilterEditName.setValue( %filterName );
FilterEditMinPlayers.setValue( %minPlayers );
FilterEditMaxPlayers.setValue( %maxPlayers );
FilterEditGameType.setText( %gameType );
FilterEditMissionType.setText( %misType );
%index = 0;
while ( isObject( "FilterEditLocMask" @ %index ) )
{
( "FilterEditLocMask" @ %index ).setValue( %regionCode & 1 );
%index++;
%regionCode >>= 1;
}
if ( %maxPing == 0 )
{
FilterEditUsePingTgl.setValue( false );
FilterEditMaxPing.setValue( 50 );
FilterEditMaxPing.setVisible( false );
}
else
{
FilterEditUsePingTgl.setValue( true );
FilterEditMaxPing.setValue( %maxPing );
FilterEditMaxPing.setVisible( true );
}
FilterEditMaxBots.setValue( %maxBots );
FilterEditMinCPU.setValue( %minCPU );
FilterEditDedicatedTgl.setValue( %flags & 1 );
FilterEditNoPwdTgl.setValue( %flags & 2 );
FilterEditCurVersionTgl.setValue( %flags & 128 );
%this.editFilterIndex = %rowId;
Canvas.pushDialog( FilterEditDlg );
}
//------------------------------------------------------------------------------
function ChooseFilterDlg::saveFilter( %this )
{
%filterName = FilterEditName.getValue();
%gameType = FilterEditGameType.getText();
%misType = FilterEditMissionType.getText();
%minPlayers = FilterEditMinPlayers.getValue();
%maxPlayers = FilterEditMaxPlayers.getValue();
%regionCode = 0;
for ( %i = 0; isObject( "FilterEditLocMask" @ %i ); %i++ )
{
if ( ( "FilterEditLocMask" @ %i ).getValue() )
%regionCode |= ( 1 << %i );
}
%maxPing = FilterEditUsePingTgl.getValue() ? FilterEditMaxPing.getValue() : 0;
%maxBots = FilterEditMaxBots.getValue();
%minCPU = FilterEditMinCPU.getValue();
%flags = FilterEditDedicatedTgl.getValue()
| ( FilterEditNoPwdTgl.getValue() << 1 )
| ( FilterEditCurVersionTgl.getValue() << 7 );
%row = %filterName TAB %gameType TAB %misType
TAB %minPlayers TAB %maxPlayers TAB %regionCode
TAB %maxPing TAB %maxBots TAB %minCPU TAB %flags;
CF_FilterList.setRowById( %this.editFilterIndex, %row );
CF_FilterList.setSelectedById( %this.editFilterIndex );
%this.editFilterIndex = "";
Canvas.popDialog( FilterEditDlg );
}
//------------------------------------------------------------------------------
function ChooseFilterDlg::deleteFilter( %this )
{
%rowId = CF_FilterList.getSelectedId();
if ( %rowId < 3 ) // can't delete default filters
return;
%row = CF_FilterList.getRowNumById( %rowId );
%lastFilter = CF_FilterList.rowCount() - 3;
while ( ( %nextRow = CF_FilterList.getRowTextById( %rowId + 1 ) ) !$= "" )
{
CF_FilterList.setRowById( %rowId, %nextRow );
%rowId++;
}
CF_FilterList.removeRowById( %rowId );
// Get rid of the last filter (now extra):
$pref::ServerBrowser::Filter[%lastFilter] = "";
// Select next (or failing that, previous) filter:
if ( CF_FilterList.getRowTextById( %row ) $= "" )
%selId = CF_FilterList.getRowId( %row - 1 );
else
%selId = CF_FilterList.getRowId( %row );
CF_FilterList.setSelectedById( %selId );
}
//------------------------------------------------------------------------------
function ChooseFilterDlg::go( %this )
{
Canvas.popDialog( ChooseFilterDlg );
GMJ_Browser.runQuery();
}
//------------------------------------------------------------------------------
function CF_FilterList::onSelect( %this, %id, %text )
{
// Let the user know they can't edit or delete the default filters:
if ( %id < 3 )
{
CF_EditFilterBtn.setActive( false );
CF_DeleteFilterBtn.setActive( false );
}
else
{
CF_EditFilterBtn.setActive( true );
CF_DeleteFilterBtn.setActive( true );
}
$pref::ServerBrowser::activeFilter = %id;
}
//------------------------------------------------------------------------------
function FilterEditDlg::setMinPlayers( %this )
{
%newMin = FilterEditMinPlayers.getValue();
if ( %newMin < 0 )
{
%newMin = 0;
FilterEditMinPlayers.setValue( %newMin );
}
else if ( %newMin > 254 )
{
%newMin = 254;
FilterEditMinPlayers.setValue( %newMin );
}
%newMax = FilterEditMaxPlayers.getValue();
if ( %newMax <= %newMin )
{
%newMax = %newMin + 1;
FilterEditMaxPlayers.setValue( %newMax );
}
}
//------------------------------------------------------------------------------
function FilterEditDlg::setMaxPlayers( %this )
{
%newMax = FilterEditMaxPlayers.getValue();
if ( %newMax < 1 )
{
%newMax = 1;
FilterEditMaxPlayers.setValue( %newMax );
}
else if ( %newMax > 255 )
{
%newMax = 255;
FilterEditMaxPlayers.setValue( %newMax );
}
%newMin = FilterEditMinPlayers.getValue();
if ( %newMin >= %newMax )
{
%newMin = %newMax - 1;
FilterEditMinPlayers.setValue( %newMin );
}
}
//------------------------------------------------------------------------------
function FilterEditDlg::setMaxBots( %this )
{
%newMax = FilterEditMaxBots.getValue();
if ( %newMax < 0 )
{
%newMax = 0;
FilterEditMaxBots.setValue( %newMax );
}
else if ( %newMax > 16 )
{
%newMax = 16;
FilterEditMaxBots.setValue( %newMax );
}
}
//------------------------------------------------------------------------------
function FilterEditUsePingTgl::onAction( %this )
{
FilterEditMaxPing.setVisible( %this.getValue() );
}
//------------------------------------------------------------------------------
function FilterEditDlg::setMaxPing( %this )
{
%newMax = FilterEditMaxPing.getValue();
if ( %newMax < 10 )
{
%newMax = 10;
FilterEditMaxPing.setValue( %newMax );
}
}
//------------------------------------------------------------------------------
function FilterEditDlg::setMinCPU( %this )
{
%newMin = FilterEditMinCPU.getValue();
if ( %newMin < 0 )
{
%newMin = 0;
FilterEditMinCPU.setValue( %newMin );
}
}
//------------------------------------------------------------------------------
function clearGameTypes()
{
%text = FilterEditGameType.getText();
FilterEditGameType.clear();
FilterEditGameType.add( "Any", 0 );
FilterEditGameType.setText( %text );
}
//------------------------------------------------------------------------------
function addGameType( %type )
{
FilterEditGameType.add( %type, 0 );
}
//------------------------------------------------------------------------------
function clearMissionTypes()
{
%text = FilterEditMissionType.getText();
FilterEditMissionType.clear();
FilterEditMissionType.add( "Any", 0 );
FilterEditMissionType.setText( %text );
// Add all the mission types found on this machine:
for ( %i = 0; %i < $HostTypeCount; %i++ )
FilterEditMissionType.add( $HostTypeDisplayName[%i], %i );
}
//------------------------------------------------------------------------------
function addMissionType(%type)
{
if ( %type !$= "" && FilterEditMissionType.findText( %type ) == -1 )
FilterEditMissionType.add( %type, 0 );
}
//------------------------------------------------------------------------------
// Make sure we still have at least one region selected:
function FilterEditDlg::checkRegionMasks( %this, %lastIndex )
{
%index = 0;
while ( isObject( "FilterEditLocMask" @ %index ) )
{
if ( ( "FilterEditLocMask" @ %index ).getValue() )
return;
%index++;
}
// None are selected, so reselect the last control:
( "FilterEditLocMask" @ %lastIndex ).setValue( true );
}