Initial commit

This commit is contained in:
Brian Beck 2025-09-11 16:56:30 -07:00
parent 2211ed7650
commit ebb3dc9cdd
10121 changed files with 801 additions and 4 deletions

View file

@ -0,0 +1,358 @@
////////////////////////////////////////////////////////////////////////////////////////
// z0dd - ZOD: ADMIN HUD ///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function CreateAdminHud()
{
$AdminHudId = new GuiControl(AdminHudDlg) {
profile = "GuiDialogProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new ShellPaneCtrl() {
profile = "ShellDlgPaneProfile";
horizSizing = "center";
vertSizing = "center";
position = "170 137";
extent = "320 260";
minExtent = "48 92";
visible = "1";
helpTag = "0";
text = "Admin Hud";
noTitleBar = "0";
// -- Drop down menu text label
new GuiTextCtrl() {
profile = "ShellTextRightProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 52";
extent = "50 22";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Menu:";
};
// -- Drop down menu
new ShellPopupMenu(AdminHudMenu) {
profile = "ShellPopupProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "60 44";
extent = "225 38";
minExtent = "49 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
text = "- OPTIONS -";
maxLength = "255";
maxPopupHeight = "200";
buttonBitmap = "gui/shll_pulldown";
rolloverBarBitmap = "gui/shll_pulldownbar_rol";
selectedBarBitmap = "gui/shll_pulldownbar_act";
noButtonStyle = "0";
};
// -- Input text field label
new GuiTextCtrl() {
profile = "ShellTextRightProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 88";
extent = "50 22";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Input:";
};
// -- Input text field
new ShellTextEditCtrl(AdminHudInput) {
profile = "NewTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "60 80";
extent = "225 38";
minExtent = "32 38";
visible = "1";
command = "AdminHudInput.setField();";
altCommand = "AdminHudInput.processEnter();";
helpTag = "0";
historySize = "0";
maxLength = "127";
password = "0";
glowOffset = "9 9";
};
// -- Cancel button
new ShellBitmapButton(AdminHudCancelBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "60 118";
extent = "120 38";
minExtent = "32 38";
visible = "1";
command = "HideAdminHud();";
accelerator = "escape";
helpTag = "0";
text = "CANCEL";
simpleStyle = "0";
};
// -- Send button
new ShellBitmapButton(AdminHudSendBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "165 118";
extent = "120 38";
minExtent = "32 38";
visible = "1";
command = "AdminHudSendBtn.adminCommand();";
helpTag = "0";
text = "SEND";
simpleStyle = "0";
};
// -- Clan Tag drop down menu text label
new GuiTextCtrl() {
profile = "ShellTextRightProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 173";
extent = "50 22";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Tags:";
};
// -- Clan Tag drop down menu
new ShellPopupMenu(ClanTagHudMenu) {
profile = "ShellPopupProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "60 165";
extent = "225 38";
minExtent = "49 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
text = "- CLAN TAGS -";
maxLength = "255";
maxPopupHeight = "200";
buttonBitmap = "gui/shll_pulldown";
rolloverBarBitmap = "gui/shll_pulldownbar_rol";
selectedBarBitmap = "gui/shll_pulldownbar_act";
noButtonStyle = "0";
};
new ShellBitmapButton(ClanTagSendBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "60 200";
extent = "225 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "ClanTagSendBtn.sendTagCommand();";
helpTag = "0";
text = "CHANGE CLAN TAG";
simpleStyle = "0";
};
};
};
ClanTagSendBtn.setActive(0);
}
function handleActivateAdminHud()
{
if(!$AdminHudCreated)
{
CreateAdminHud(); // Create the gui
UpdateAdminHudMenu(); // Fill the drop down menu
$AdminHudCreated = 1; // Set the flag
}
}
addMessageCallback('MsgClientJoin', handleActivateAdminHud);
function ShowAdminHud()
{
canvas.pushdialog(AdminHudDlg);
//clientCmdTogglePlayHuds(false);
$AdminHudOpen = 1;
}
function HideAdminHud()
{
// Empty out the text input field
AdminHudInput.setValue(%empty);
canvas.popdialog(AdminHudDlg);
$AdminHudOpen = 0;
//clientCmdTogglePlayHuds(true);
}
function AdminHudDlg::onWake( %this )
{
if ( isObject( AdminHudMap ) )
{
AdminHudMap.pop();
AdminHudMap.delete();
}
new ActionMap( AdminHudMap );
AdminHudMap.blockBind( moveMap, toggleModHud );
AdminHudMap.blockBind( moveMap, togglePracticeHud );
AdminHudMap.blockBind( moveMap, toggleInventoryHud );
AdminHudMap.blockBind( moveMap, toggleScoreScreen );
AdminHudMap.blockBind( moveMap, toggleCommanderMap );
AdminHudMap.bindCmd( keyboard, escape, "", "HideAdminHud();" );
AdminHudMap.push();
}
function AdminHudDlg::onSleep( %this )
{
%this.callback = "";
AdminHudMap.pop();
AdminHudMap.delete();
}
function UpdateAdminHudMenu()
{
// Populate the drop down menu with options seperated by \t (tab deliniated list).
%line1 = "Choose Option\tEnter Admin Password\tEnter Super Admin Password\tSet Join Password\tSet Admin Password\tSet Super Admin Password";
%line2 = "\tSet Random Teams\tSet Fair Teams\tSet Max Players\tSet Auto-PW\tSet Auto-PW Password\tSet Auto-PW Count\tSend Bottomprint Message";
%line3 = "\tSend Centerprint Message\tRemove Map From Rotation\tRestore Map To Rotation\tRemove GameType\tRestore GameType\tRestart Server\tConsole Command";
%opt = %line1 @ %line2 @ %line3;
AdminHudMenu.hudSetValue(%opt, "");
// Update the Clan Tag drop down menu as well
commandToServer('canGetClanTags');
}
function AdminHudMenu::onSelect(%this, %id, %text)
{
// Called when an option is selected in drop down menu
$AdminMenu = %this.getValue();
}
function AdminHudInput::setField( %this )
{
// called when you type in text input field
%value = %this.getValue();
%this.setValue( %value );
$AdminInput = %value;
//AdminHudSendBtn.setActive( strlen( stripTrailingSpaces( %value ) ) >= 1 );
}
function AdminHudInput::processEnter( %this )
{
// Called when you press enter in text input field
}
function AdminHudSendBtn::adminCommand( %this )
{
// Called when you press the send button
// Update the global from the text input field
AdminHudInput.setField();
// Send the current menu selection and text to the server
switch$ ( $AdminMenu )
{
case "Enter Admin Password":
commandToServer('SAD', $AdminInput);
case "Enter Super Admin Password":
commandToServer('SAD', $AdminInput);
case "Set Join Password":
commandToServer('Set', "joinpw", $AdminInput);
case "Set Admin Password":
commandToServer('Set', "adminpw", $AdminInput);
case "Set Super Admin Password":
commandToServer('Set', "superpw", $AdminInput);
case "Set Random Teams":
commandToServer('Set', "random", $AdminInput);
case "Set Fair Teams":
commandToServer('Set', "fairteams", $AdminInput);
case "Set Max Players":
commandToServer('Set', "maxplayers", $AdminInput);
case "Set Auto-PW":
commandToServer('AutoPWSetup', "autopw", $AdminInput);
case "Set Auto-PW Password":
commandToServer('AutoPWSetup', "autopwpass", $AdminInput);
case "Set Auto-PW Count":
commandToServer('AutoPWSetup', "autopwcount", $AdminInput);
case "Send Bottomprint Message":
commandToServer('aprint', $AdminInput, true);
case "Send Centerprint Message":
commandToServer('aprint', $AdminInput, false);
case "Remove Map From Rotation":
commandToServer('AddMap', $AdminInput);
case "Restore Map To Rotation":
commandToServer('RemoveMap', $AdminInput);
case "Remove GameType":
commandToServer('AddType', $AdminInput);
case "Restore GameType":
commandToServer('RemoveType', $AdminInput);
case "Restart Server":
commandToServer('Set', "restart", $AdminInput);
case "Console Command":
commandToServer('Set', "consolecmd", $AdminInput);
default:
error("Admin Hud selected option: " @ $AdminMenu @ " input: " @ $AdminInput @ " unknown values.");
}
// Clear the text input field and disable send button
//AdminHudSendBtn.setActive(0);
AdminHudInput.setValue(%empty);
UpdateAdminHudMenu();
$AdminInput = "";
$AdminMenu = "";
}
////////////////////////////////////////////////////////////////////////////////////////
// Canadian, 7/19/03. Clan Tag switiching //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function ClanTagHudMenu::onSelect(%this, %id, %text)
{
// Called when an option is selected in drop down menu
$CanSelected = %this.getValue();
ClanTagSendBtn.setActive(1);
}
function ClanTagSendBtn::sendTagCommand( %this )
{
// Called when you press the send button
// Send the current menu selection and text to the server
commandToServer('canUpdateClanTag', $CanSelected);
$CanSelected = "";
HideAdminHud();
}
function clientCmdcanDisplayTags(%tags)
{
ClanTagHudMenu.hudSetValue(%tags, "");
}

View file

@ -0,0 +1,19 @@
// terrain sound/puff properties for Classic mod maps. z0dd - ZOD, 7/20/02
//"Color: red green blue startAlpha endAlpha"
//Soft sound = 0
//Hard sound = 1
//Metal sound = 2
//Snow sound = 3
addMaterialMapping("terrain/GMD.DarkRock", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 1");
addMaterialMapping("terrain/GMD.DirtMossy", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/gmd.grassmixed", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/GMD.LightSand", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/GMD.SandBurnt", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/GMD.GrassLight", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/lushworld.lakesand", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/Eep.MoonDirt", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/Eep.MoonDirtDark", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/ril.darkrock", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 1");
addMaterialMapping("terrain/ril.darkrock1", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 1");

View file

@ -0,0 +1,530 @@
////////////////////////////////////////////////////////////////////////////////////////
// z0dd - ZOD: Overloaded base function package ////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
package zzClientOverloads
{
function clientCmdMissionStartPhase3(%seq, %missionName)
{
parent::clientCmdMissionStartPhase3(%seq, %missionName);
commandToServer('getMod');
}
function LobbyGui::onSleep( %this )
{
if ( %this.playerDialogOpen )
LobbyPlayerPopup.forceClose();
LobbyVoteMenu.clear();
LobbyVoteMenu.mode = "";
LobbyCancelBtn.setVisible( false );
LobbyStatusText.setText( "" );
$InLobby = false;
$PrivMsgTarget = "";
}
function lobbyReturnToGame()
{
Canvas.setContent( PlayGui );
$PrivMsgTarget = "";
}
function LobbyChatEnter::onEscape( %this )
{
%this.setValue( "" );
$PrivMsgTarget = "";
}
function LobbyChatEnter::send( %this )
{
%text = %this.getValue();
if ( %text $= "" )
%text = " ";
if($PrivMsgTarget !$= "")
{
commandToServer('PrivateMessageSent', $PrivMsgTarget, %text);
$PrivMsgTarget = "";
%this.setValue( "" );
}
else
{
commandToServer( 'MessageSent', %text );
%this.setValue( "" );
}
}
function OptionsDlg::onWake( %this )
{
if(!$ClassicHudsBound)
{
$RemapName[$RemapCount] = "Toss Repair Kit";
$RemapCmd[$RemapCount] = "tossRepairKit";
$RemapCount++;
$RemapName[$RemapCount] = "Toss Weapon Ammo";
$RemapCmd[$RemapCount] = "tossAmmo";
$RemapCount++;
$RemapName[$RemapCount] = "Toss Mine";
$RemapCmd[$RemapCount] = "tossMine";
$RemapCount++;
$RemapName[$RemapCount] = "Toss Beacon";
$RemapCmd[$RemapCount] = "tossBeacon";
$RemapCount++;
$RemapName[$RemapCount] = "Toss Grenade";
$RemapCmd[$RemapCount] = "tossGrenade";
$RemapCount++;
$RemapName[$RemapCount] = "Max Throw Grenade";
$RemapCmd[$RemapCount] = "throwGrenadeMax";
$RemapCount++;
$RemapName[$RemapCount] = "Max Throw Mine";
$RemapCmd[$RemapCount] = "throwMineMax";
$RemapCount++;
$RemapName[$RemapCount] = "Mod Hud";
$RemapCmd[$RemapCount] = "toggleModHud";
$RemapCount++;
$RemapName[$RemapCount] = "Admin Hud";
$RemapCmd[$RemapCount] = "toggleAdminHud";
$RemapCount++;
$RemapName[$RemapCount] = "Practice Hud";
$RemapCmd[$RemapCount] = "togglePracticeHud";
$RemapCount++;
$ClassicHudsBound = true;
}
parent::onWake( %this );
}
function clientCmdSetDefaultVehicleKeys(%inVehicle)
{
Parent::clientCmdSetDefaultVehicleKeys(%inVehicle);
if(%inVehicle)
{
passengerKeys.copyBind( moveMap, toggleModHud );
passengerKeys.copyBind( moveMap, toggleAdminHud );
passengerKeys.copyBind( moveMap, togglePracticeHud );
passengerKeys.copyBind( moveMap, mouseJet );
passengerKeys.copyBind( moveMap, throwGrenadeMax );
passengerKeys.copyBind( moveMap, throwMineMax );
}
}
function clientCmdSetStationKeys(%inStation)
{
Parent::clientCmdSetStationKeys(%inStation);
if ( %inStation )
{
stationMap.blockBind( moveMap, toggleModHud );
stationMap.blockBind( moveMap, toggleAdminHud );
stationMap.blockBind( moveMap, togglePracticeHud );
}
}
function lobbyVote()
{
%id = LobbyVoteMenu.getSelectedId();
%text = LobbyVoteMenu.getRowTextById( %id );
switch$ ( LobbyVoteMenu.mode )
{
case "":
switch$ ( $clVoteCmd[%id] )
{
case "JoinGame":
CommandToServer( 'clientJoinGame' );
schedule( 100, 0, lobbyReturnToGame );
return;
case "ChooseTeam":
commandToServer( 'ClientJoinTeam', -1, true );
schedule( 100, 0, lobbyReturnToGame );
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 "VoteArmorClass":
fillLobbyArmorClassMenu();
return;
case "VoteAntiTurtleTime":
fillLobbyAntiTurtleMenu();
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;
case "armorclass":
startNewVote( "VoteArmorClass", $clVoteCmd[%id] );
LobbyVoteMenu.reset();
return;
case "antiturtle":
startNewVote( "VoteAntiTurtleTime", $clVoteCmd[%id] );
LobbyVoteMenu.reset();
return;
}
startNewVote( $clVoteCmd[%id], $clVoteAction[%id] );
fillLobbyVoteMenu();
}
function LobbyPlayerPopup::onSelect( %this, %id, %text )
{
parent::onSelect(%this, %id, %text);
switch( %id )
{
case 12:
commandToServer('ProcessGameLink', %this.player.clientId);
case 13:
commandToServer('WarnPlayer', %this.player.clientId);
case 14:
commandToServer('StripAdmin', %this.player.clientId);
case 15:
PrivateMessage(%this.player.clientId);
// From Rapture Admin - MeBad
case 16:
commandToServer('PrintClientInfo', %this.player.clientId);
case 17:
commandToServer('togglePlayerGag', %this.player.clientId);
case 18:
commandToServer('togglePlayerFreeze', %this.player.clientId);
case 19:
commandToServer('bootToTheRear', %this.player.clientId);
case 20:
commandToServer('explodePlayer', %this.player.clientId);
}
Canvas.popDialog( LobbyPlayerActionDlg );
}
function VehicleHud::onBuy( %this )
{
//toggleCursorHuds( 'vehicleHud' ); // z0dd - ZOD, 5/01/02. Dont close veh station HUD after selecting
commandToServer( 'buyVehicle', %this.selected );
}
};
activatePackage(zzClientOverloads);
function fillLobbyArmorClassMenu()
{
LobbyVoteMenu.key++;
LobbyVoteMenu.clear();
LobbyVoteMenu.mode = "armorclass";
commandToServer( 'GetArmorClassList', LobbyVoteMenu.key );
LobbyCancelBtn.setVisible( true );
}
function fillLobbyAntiTurtleMenu()
{
LobbyVoteMenu.key++;
LobbyVoteMenu.clear();
LobbyVoteMenu.mode = "antiturtle";
commandToServer( 'GetAntiTurtleTimeList', LobbyVoteMenu.key );
LobbyCancelBtn.setVisible( true );
}
function assignMissionType(%msgType, %msgString, %gameType, %a2, %a3, %a4, %a5, %a6)
{
$thisMissionType = detag(%gameType);
}
function handleStripAdminMsg(%msgType, %msgString, %super, %admin, %client)
{
%player = $PlayerList[%client];
if(%player)
{
%player.isSuperAdmin = false;
%player.isAdmin = false;
lobbyUpdatePlayer(%client);
}
alxPlay(AdminForceSound, 0, 0, 0);
}
function clientCmdGetClassicModSettings(%val)
{
if(%val)
{
commandToServer('SetHitSounds', $pref::Classic::playerHitSound, $pref::Classic::playerHitWav,
$pref::Classic::vehicleHitSound, $pref::Classic::vehicleHitWav);
commandToServer('SetRepairKitWaste', $pref::Classic::wasteRepairKit);
}
}
function clientCmdTeamDestroyMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
{
if($pref::Classic::ignoreTeamDestroyMessages)
%msgString = ""; // z0dd - ZOD, 8/23/02. Yogi. The message gets to the client but is "muted" from the HUD
clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6);
}
////////////////////////////////////////////////////////////////////////////////////////
// Keybinds ////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function tossAmmo( %val ) { if ( %val ) throw( Ammo ); }
function tossRepairKit( %val ) { if ( %val ) throw( RepairKit ); }
function tossMine( %val ) { if ( %val ) throw( Mine ); }
function tossBeacon( %val ) { if ( %val ) throw( Beacon ); }
function tossGrenade( %val ) { if ( %val ) throw( Grenade ); }
function toggleModHud(%val)
{
if(%val && $ModHudCreated)
{
if($ModHudOpen)
HideModHud();
else
ShowModHud();
}
}
function toggleAdminHud(%val)
{
if(%val && $AdminHudCreated)
{
if($AdminHudOpen)
HideAdminHud();
else
ShowAdminHud();
}
}
function togglePracticeHud(%val)
{
if(%val && $PracticeHudCreated)
{
if($practiceHudOpen)
HidePracticeHud();
else
ShowPracticeHud();
}
}
function throwGrenadeMax( %val )
{
if(($ServerMod !$= "Classic;base") && ($ServerMod !$= "classic;base"))
return;
if ( !%val )
{
commandToServer( 'throwMaxEnd' );
}
$mvTriggerCount4 += $mvTriggerCount4 & 1 == %val ? 2 : 1;
}
function throwMineMax( %val )
{
if(($ServerMod !$= "Classic;base") && ($ServerMod !$= "classic;base"))
return;
if ( !%val )
{
commandToServer( 'throwMaxEnd' );
}
$mvTriggerCount5 += $mvTriggerCount5 & 1 == %val ? 2 : 1;
}
////////////////////////////////////////////////////////////////////////////////////////
// Grav Cycle Chaingun /////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function clientCmdShowVehicleWeapons(%vehicleType)
{
switch$ (%vehicleType)
{
case "Hoverbike":
// add right-hand weapons box and highlight
dashboardHud.weapon = new GuiControl(vWeapHiliteOne) {
profile = "GuiDashBoxProfile";
horizSizing = "right";
vertSizing = "top";
position = "358 22";
extent = "80 33";
minExtent = "8 8";
visible = "1";
new HudBitmapCtrl(vWeapBkgdOne) {
profile = "GuiDashBoxProfile";
horizSizing = "right";
vertSizing = "top";
position = "0 0";
extent = "82 40";
minExtent = "8 8";
bitmap = "gui/hud_veh_new_dashpiece_2";
visible = "1";
opacity = "0.8";
new HudBitmapCtrl(vWeapIconOne) {
profile = "GuiDashBoxProfile";
horizSizing = "right";
vertSizing = "top";
position = "28 6";
extent = "25 25";
minExtent = "8 8";
bitmap = "gui/hud_blaster";
visible = "1";
opacity = "0.8";
};
};
};
dashboardHud.add(dashboardHud.weapon);
reticleHud.setBitmap("gui/hud_ret_tankchaingun");
reticleFrameHud.setVisible(false);
default:
return;
}
}
////////////////////////////////////////////////////////////////////////////////////////
// Projectile Hit Sound defaults ///////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function setupClassicClientDefaults()
{
if($pref::Classic::wasteRepairKit $="")
{
$pref::Classic::wasteRepairKit = 0;
export( "$pref::*", "prefs/ClientPrefs.cs", False );
}
if($pref::Classic::playerHitWav $="")
{
$pref::Classic::playerHitSound = 1; // turns player impact sounds on/off
$pref::Classic::playerHitWav = "~wfx/weapons/cg_hard4.wav"; // wav file to play when hitting enemy player. base dir is .../audio
$pref::Classic::vehicleHitSound = 1; // turns vehicle impact sounds on/off
$pref::Classic::vehicleHitWav = "~wfx/weapons/mine_switch.wav"; // wav file to play when hitting enemy vehicles. base dir is .../audio
export( "$pref::*", "prefs/ClientPrefs.cs", False );
}
if($pref::Classic::ignoreTeamDestroyMessages $="")
{
$pref::Classic::ignoreTeamDestroyMessages = 0;
export( "$pref::*", "prefs/ClientPrefs.cs", False );
}
}
setupClassicClientDefaults();
////////////////////////////////////////////////////////////////////////////////////////
// Bomber Pilot Hud ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Addition to give client bomber reticle when piloting.
package pilotBomberHud
{
function ClientCmdSetHudMode(%mode, %type, %node)
{
parent::clientCmdSetHudMode(%mode, %type, %node);
if ((%type $= "Bomber") && (%node == 0))
{
clientCmdStartBomberSight();
}
else if (($typeHolder $= "Bomber") && ($nodeHolder == 0))
{
clientCmdEndBomberSight();
}
$typeHolder = %type;
$nodeHolder = %node;
}
};
function activateBomberPilotHud(%msgType, %msgString, %gameType, %a2, %a3, %a4, %a5, %a6)
{
activatePackage(pilotBomberHud);
}
////////////////////////////////////////////////////////////////////////////////////////
// Private messaging ///////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function PrivateMessage(%clientId)
{
$PrivMsgTarget = %clientId;
%notice = "\c2Next message you send will be private to: " @ $PlayerList[%clientId].name;
addMessageHudLine(%notice);
}
////////////////////////////////////////////////////////////////////////////////////////
// Callbacks ///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
addMessageCallback('MsgClientReady', assignMissionType);
addMessageCallback('MsgStripAdminPlayer', handleStripAdminMsg);
addMessageCallback('MsgBomberPilotHud', activateBomberPilotHud);
function serverCMDgetMod(%client)
{
%paths = getModPaths();
commandToClient(%client, 'serverMod', %paths);
}
function clientCMDserverMod(%value)
{
$ServerMod = %value;
if((%value $= "Classic;base") || (%value $= "classic;base"))
{
$Camera::movementSpeed = 50;
}
}

View file

@ -0,0 +1,551 @@
////////////////////////////////////////////////////////////////////////////////////////
// z0dd - ZOD - sal9000: MOD HUD ///////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function CreateModHud()
{
$ModHudId = new GuiControl(modHud) {
profile = "GuiDialogProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new ShellPaneCtrl(modHudGui) {
profile = "ShellDlgPaneProfile";
horizSizing = "center";
vertSizing = "center";
position = "170 90";
extent = "320 295";
minExtent = "48 92";
visible = "1";
helpTag = "0";
text = "MOD HUD";
new GuiMLTextCtrl(modHudOpt) {
profile = "ShellMediumTextProfile";
horizSizing = "center";
vertSizing = "bottom";
position = "29 38";
extent = "260 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
lineSpacing = "2";
};
new ShellPopupMenu(modOptionMenu) {
profile = "ShellPopupProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "22 49";
extent = "277 36";
minExtent = "49 36";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
text = "- OPTIONS -";
maxLength = "255";
maxPopupHeight = "200";
buttonBitmap = "gui/shll_pulldown";
rolloverBarBitmap = "gui/shll_pulldownbar_rol";
selectedBarBitmap = "gui/shll_pulldownbar_act";
noButtonStyle = "0";
};
new GuiMLTextCtrl(modHudSet) {
profile = "ShellMediumTextProfile";
horizSizing = "center";
vertSizing = "bottom";
position = "29 90";
extent = "267 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
lineSpacing = "2";
};
new ShellScrollCtrl(modA) {
profile = "NewScrollCtrlProfile";
horizSizing = "right";
vertSizing = "height";
position = "26 103";
extent = "267 70";
minExtent = "24 52";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
constantThumbHeight = "0";
defaultLineHeight = "15";
childMargin = "0 3";
fieldBase = "gui/shll_field";
new GuiScrollContentCtrl(modB) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "4 7";
extent = "182 239";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new ShellTextList(modSetList) {
profile = "ShellTextArrayProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "182 8";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
enumerate = "0";
resizeCell = "1";
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
};
};
};
new ShellBitmapButton(modCloseBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "22 235";
extent = "137 35";
minExtent = "32 35";
visible = "1";
command = "HideModHud();";
accelerator = "return";
helpTag = "0";
text = "CLOSE";
simpleStyle = "0";
};
new ShellBitmapButton(modSubmitBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "160 235";
extent = "137 35";
minExtent = "32 35";
visible = "1";
command = "modSubmit();";
accelerator = "return";
helpTag = "0";
text = "SUBMIT";
simpleStyle = "0";
};
new ShellBitmapButton(modBtn1) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "22 175";
extent = "137 35";
minExtent = "32 35";
visible = "0";
command = "modBtnProg(11);";
accelerator = "return";
helpTag = "0";
text = "-Empty-";
simpleStyle = "0";
};
new ShellBitmapButton(modBtn2) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "160 175";
extent = "137 35";
minExtent = "32 35";
visible = "0";
command = "modBtnProg(12);";
accelerator = "return";
helpTag = "0";
text = "-Empty-";
simpleStyle = "0";
};
new ShellBitmapButton(modBtn3) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "22 205";
extent = "137 35";
minExtent = "32 35";
visible = "0";
command = "modBtnProg(13);";
accelerator = "return";
helpTag = "0";
text = "-Empty-";
simpleStyle = "0";
};
new ShellBitmapButton(modBtn4) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "160 205";
extent = "137 35";
minExtent = "32 35";
visible = "0";
command = "modBtnProg(14);";
accelerator = "return";
helpTag = "0";
text = "-Empty-";
simpleStyle = "0";
};
};
};
}
function handleActivateModHud(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8)
{
if(!$ModHudCreated)
{
CreateModHud();
$ModHudCreated = 1;
}
}
function handleInitModHud(%msgType, %msgString, %gameType, %a2, %a3, %a4, %a5, %a6)
{
if($ModHudCreated)
commandToServer('ModHudInitialize', true);
}
addMessageCallback('MsgClientJoin', handleActivateModHud);
addMessageCallback('MsgClientReady', handleInitModHud);
// Get the headings from the server
function clientCMDModHudHead(%head, %opt, %set)
{
modHudGui.settitle(%head);
modHudOpt.setvalue(%opt);
modHudSet.setvalue(%set);
}
function clientCMDModHudDone()
{
$ModArray[curopt] = 1;
modOptionMenu.clear();
for(%z = 1; %z <= $ModArray[index]; %z++)
{
%nam = $ModArray[%z, nam];
modOptionMenu.add(%nam, %z);
}
modOptionMenu.setSelected($ModArray[curopt]);
modArrayCallOption($ModArray[curopt]);
}
function modArrayCallOption(%opt)
{
modSetList.clear();
for(%x = 1; %x <= $ModArray[%opt, noa]; %x++)
{
%nam = $ModArray[%opt, %x];
modSetList.addRow(%x, %nam);
}
%pal = $ModArray[%opt, pal];
%cur = $ModArray[%opt, cur];
if(%cur $= "")
modSetList.setSelectedByID(%pal);
else
modSetList.setSelectedByID(%cur);
}
function clientCMDInitializeModHud(%mod)
{
for(%i = 0; $ModArray[%i, nam] !$= ""; %i++)
{
$ModArray[%i, cur] = "";
$ModArray[%i, pal] = "";
$ModArray[%i, nam] = "";
$ModArray[%i, noa] = "";
$ModArray[%i, index] = "";
for(%j = 0; %j < 10; %j++)
$ModArray[%i, %j] = "";
}
$ModArray[curmode] = %mod;
$ModArray[index] = 0;
}
function modHudExport()
{
if($ModArray[curmode] $= "")
return;
for(%z = 1; %z <= $ModArray[curopt]; %z++)
{
%pal = $ModArray[%z, pal];
$ModExport[modStu($ModArray[curmode]), modStu($ModArray[%z, index])] = $ModArray[%z, %pal];
}
export("$ModExport*", "scripts/autoexec/modExport.cs", false);
}
function modStu(%str)
{
return strreplace(%str, " ", "_");
}
function clientCMDModHudPopulate(%option, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
{
%s[1] = %a1;
%s[2] = %a2;
%s[3] = %a3;
%s[4] = %a4;
%s[5] = %a5;
%s[6] = %a6;
%s[7] = %a7;
%s[8] = %a8;
%s[9] = %a9;
%s[10] = %a10;
$ModArray[index]++;
$ModArray[curopt] = $ModArray[index];
%cur = $ModArray[curopt];
$ModArray[%cur, pal] = "";
$ModArray[%cur, cur] = "";
$ModArray[%cur, nam] = %option;
%z = 0;
while(%s[%z++] !$= "") {
$ModArray[%cur, %z] = %s[%z];
%pal = $ModExport[modStu($ModArray[curmode]), modStu(%opt)];
if(%s[%z] $= %pal)
%palm = %z;
}
if(%palm $= "") {
$ModArray[%cur, cur] = "1";
$ModArray[%cur, pal] = "1";
%id =1;
}
else {
$ModArray[%cur, cur] = %palm;
$ModArray[%cur, pal] = %palm;
%id = %palm;
}
commandToServer('ModUpdateSettings', %cur, %id);
$ModArray[%cur, noa] = %z-1;
}
function modSetList::onSelect(%this, %id, %text)
{
$ModArray[$ModArray[curopt], cur] = %id;
//commandToServer('ModUpdateSettings', $ModArray[curopt], %id);
}
function modOptionMenu::onSelect(%this, %id, %text)
{
$ModArray[curopt] = %id;
modArraycallOption(%id);
}
function ShowModHud()
{
canvas.pushdialog(modHud);
$ModHudOpen = 1;
//clientCmdTogglePlayHuds(false);
}
function HideModHud()
{
modHudExport();
canvas.popdialog(modHud);
$ModHudOpen = 0;
//clientCmdTogglePlayHuds(true);
}
function modHud::onWake( %this )
{
if ($HudHandle[modHud] !$= "")
alxStop($HudHandle[inventoryScreen]);
alxPlay(HudInventoryActivateSound, 0, 0, 0);
$HudHandle[modHud] = alxPlay(HudInventoryHumSound, 0, 0, 0);
if ( isObject( modHudMap ) )
{
modHudMap.pop();
modHudMap.delete();
}
new ActionMap( modHudMap );
modHudMap.blockBind( moveMap, togglePracticeHud );
modHudMap.blockBind( moveMap, toggleAdminHud );
modHudMap.blockBind( moveMap, toggleInventoryHud );
modHudMap.blockBind( moveMap, toggleScoreScreen );
modHudMap.blockBind( moveMap, toggleCommanderMap );
modHudMap.bindCmd( keyboard, escape, "", "HideModHud();" );
modHudMap.push();
}
function modHud::onSleep( %this )
{
%this.callback = "";
modHudMap.pop();
modHudMap.delete();
alxStop($HudHandle[modHud]);
alxPlay(HudInventoryDeactivateSound, 0, 0, 0);
$HudHandle[modHud] = "";
}
////////////////////////////////////////////////////////////////////////////////////////
// Button functions ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function modSubmit()
{
// Send the currently selected option and setting to the server
commandToServer('ModUpdateSettings', $ModArray[curopt], $ModArray[$ModArray[curopt], cur]);
modHudExport();
}
function modBtnProg(%button)
{
switch ( %button )
{
case 11:
%value = modBtn1.getValue();
case 12:
%value = modBtn2.getValue();
case 13:
%value = modBtn3.getValue();
case 14:
%value = modBtn4.getValue();
default:
%value = "";
}
commandToServer('ModButtonSet', %button, %value);
//HideModHud();
}
function clientCMDModHudBtn1(%text, %enabled, %visible)
{
modBtn1.setActive(%enabled);
modBtn1.visible = %visible;
if(%text !$= "")
modBtn1.text = %text;
}
function clientCMDModHudBtn2(%text, %enabled, %visible)
{
modBtn2.setActive(%enabled);
modBtn2.visible = %visible;
if(%text !$= "")
modBtn2.text = %text;
}
function clientCMDModHudBtn3(%text, %enabled, %visible)
{
modBtn3.setActive(%enabled);
modBtn3.visible = %visible;
if(%text !$= "")
modBtn3.text = %text;
}
function clientCMDModHudBtn4(%text, %enabled, %visible)
{
modBtn4.setActive(%enabled);
modBtn4.visible = %visible;
if(%text !$= "")
modBtn4.text = %text;
}
////////////////////////////////////////////////////////////////////////////////////////
// Server functions ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function serverCMDModHudInitialize(%client, %value)
{
Game.InitModHud(%client, %value);
}
function serverCmdModUpdateSettings(%client, %option, %value)
{
// %option is the index # of the hud list option
// %value is the index # of the hud list setting
%option = deTag(%option);
%value = deTag(%value);
Game.UpdateModHudSet(%client, %option, %value);
}
function serverCmdModButtonSet(%client, %button, %value)
{
%button = deTag(%button);
%value = deTag(%value);
Game.ModButtonCmd(%client, %button, %value);
}
function DefaultGame::InitModHud(%game, %client, %value)
{
// Clear out any previous settings
//commandToClient(%client, 'InitializeModHud', "ModName");
// Send the hud labels | Hud Label | | Option label | | Setting label |
//commandToClient(%client, 'ModHudHead', "MOD NAME HUD", "Option:", "Setting:");
// Send the Option list and settings per option | Option | | Setting |
//commandToClient(%client, 'ModHudPopulate', "Example1", "Empty");
//commandToClient(%client, 'ModHudPopulate', "Example2", "Setting1", "Setting2", "Setting3", "Setting4", "Setting5", "Setting6", "Setting7", "Setting8", "Setting9", "Setting10");
// Send the button labels and visual settings | Button | | Label | | Visible | | Active |
//commandToClient(%client, 'ModHudBtn1', "BUTTON1", 1, 1);
//commandToClient(%client, 'ModHudBtn2', "BUTTON2", 1, 1);
//commandToClient(%client, 'ModHudBtn3', "BUTTON3", 1, 1);
//commandToClient(%client, 'ModHudBtn4', "BUTTON4", 1, 1);
// We're done!
//commandToClient(%client, 'ModHudDone');
}
function DefaultGame::UpdateModHudSet(%game, %client, %option, %value)
{
// 1 = Example1
// 2 = Example2
//switch$ ( %option )
//{
// case 1:
// %msg = '\c2Something set to: %2.';
// case 2:
// %msg = '\c2Something set to: %2.';
// default:
// %msg = '\c2Invalid setting.';
//}
//messageClient( %client, 'MsgModHud', %msg, %option, %value );
}
function DefaultGame::ModButtonCmd(%game, %client, %button, %value)
{
// 11 = Button 1
// 12 = Button 2
// 13 = Button 3
// 14 = Button 4
//switch ( %button )
//{
// case 11:
// %msg = '\c2Something set to: %2.';
// case 12:
// %msg = '\c2Something set to: %2.';
// case 13:
// %msg = '\c2Something set to: %2.';
// case 14:
// %msg = '\c2Something set to: %2.';
// default:
// %msg = '\c2Invalid setting.';
//}
//messageClient( %client, 'MsgModHud', %msg, %button, %value );
}

View file

@ -0,0 +1,887 @@
////////////////////////////////////////////////////////////////////////////////////////
// z0dd - ZOD: PRACTICE HUD ////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// BUTTON MAP:
// ===========
//
// (00-09: GUI CONTROLS)
//
// (10-19: SERVER BUTTONS)
// 10 = 999 Ammo
// 11 = Auto Return Flags
// 12 = Spawn in Favorites
// 13 = Spawn Only
// 14 = No Score Limit
// 15 = Protect Assests
// 16 = Reset Map
//
// (20-29: TELEPORT OPTIONS)
// 20 = Beacon Mode
// 21 = Teleport Mode
// 22 = Select
// 23 = Destroy
// 24 = Teleport
//
// (30-39: SPAWN VEHICLE)
// 30 = Wildcat
// 31 = Beowulf
// 32 = Jericho
// 33 = Shrike
// 34 = Thundersword
// 35 = Havoc
//
// (40-49: PROJECTILE OBSERVATION)
// 40 = Disc
// 41 = Grenade L.
// 42 = Mortar
// 43 = Missile L.
function CreatePracticeHud()
{
$practiceHudId = new GuiControl(practiceHud) {
profile = "GuiDialogProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new ShellPaneCtrl(practiceHudGui) {
profile = "ShellDlgPaneProfile";
horizSizing = "center";
vertSizing = "center";
position = "77 43";
extent = "486 394";
minExtent = "48 92";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
text = "Practice Hud";
longTextBuffer = "0";
maxLength = "255";
noTitleBar = "0";
new ShellFieldCtrl(adminLBorder) {
profile = "ShellFieldProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 44";
extent = "260 126";
minExtent = "16 18";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new ShellToggleButton(UnlimAmmoBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 8";
extent = "128 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(10);";
helpTag = "0";
text = "999 AMMO";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(AutoReturnBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "127 8";
extent = "128 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(11);";
helpTag = "0";
text = "AUTO-RETURN FLAGS";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(spawnInFavsBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 37";
extent = "128 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(12);";
helpTag = "0";
text = "SPAWN IN FAVORITE";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(SpawnOnlyBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "127 37";
extent = "128 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(13);";
helpTag = "0";
text = "SPAWN ONLY";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(NoScoreLimitBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 66";
extent = "128 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(14);";
helpTag = "0";
text = "NO SCORE LIMIT";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(ProtectAssestsBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "127 66";
extent = "128 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(15);";
helpTag = "0";
text = "PROTECT ASSETS";
longTextBuffer = "0";
maxLength = "255";
};
new ShellBitmapButton(ResetMapBtn) {
profile = "ShellButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "73 90";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(16);";
helpTag = "0";
text = "RESET MAP";
simpleStyle = "0";
};
};
new ShellFieldCtrl(adminRBorder) {
profile = "ShellFieldProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "284 44";
extent = "184 126";
minExtent = "16 18";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new ShellPopupMenu(practiceOptionMenu) {
profile = "ShellPopupProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "4 -2";
extent = "180 36";
minExtent = "49 36";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
text = "- OPTIONS -";
longTextBuffer = "0";
maxLength = "255";
maxPopupHeight = "200";
buttonBitmap = "gui/shll_pulldown";
rolloverBarBitmap = "gui/shll_pulldownbar_rol";
selectedBarBitmap = "gui/shll_pulldownbar_act";
noButtonStyle = "0";
};
new ShellScrollCtrl(practiceA) {
profile = "NewScrollCtrlProfile";
horizSizing = "right";
vertSizing = "height";
position = "2 25";
extent = "181 70";
minExtent = "24 52";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
constantThumbHeight = "0";
defaultLineHeight = "15";
childMargin = "0 3";
fieldBase = "gui/shll_field";
new GuiScrollContentCtrl(practiceB) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "4 7";
extent = "157 56";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new ShellTextList(practiceSetList) {
profile = "ShellTextArrayProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "157 234";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
enumerate = "0";
resizeCell = "1";
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
};
};
};
new ShellBitmapButton(practiceSubmitBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "42 91";
extent = "105 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceSubmit();";
accelerator = "return";
helpTag = "0";
text = "SUBMIT";
simpleStyle = "0";
};
};
new ShellFieldCtrl(projectileBorder) {
profile = "ShellFieldProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 190";
extent = "448 42";
minExtent = "16 18";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new GuiMLTextCtrl(projectileStr) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "173 1";
extent = "113 14";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
deniedSound = "InputDeniedSound";
};
new ShellToggleButton(observeDiscBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "2 12";
extent = "108 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(40);";
helpTag = "0";
text = "DISC";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(observeGLBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "112 12";
extent = "108 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(41);";
helpTag = "0";
text = "GRENADE L.";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(observeMortarBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "222 12";
extent = "108 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(42);";
helpTag = "0";
text = "MORTAR";
longTextBuffer = "0";
maxLength = "255";
};
new ShellToggleButton(observeMissileBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "332 12";
extent = "108 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(43);";
helpTag = "0";
text = "MISSILE L.";
longTextBuffer = "0";
maxLength = "255";
};
};
new ShellFieldCtrl(teleBorder) {
profile = "ShellFieldProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "20 237";
extent = "225 107";
minExtent = "16 18";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new GuiMLTextCtrl(teleStr) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "76 1";
extent = "83 14";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
deniedSound = "InputDeniedSound";
};
new ShellRadioButton(BeaconModeBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "2 12";
extent = "108 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(20);";
helpTag = "0";
text = "BEACON MODE";
longTextBuffer = "0";
maxLength = "255";
groupNum = "1";
};
new ShellRadioButton(TelepadModeBtn) {
profile = "ShellRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "112 12";
extent = "107 30";
minExtent = "26 27";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(21);";
helpTag = "0";
text = "TELEPAD MODE";
longTextBuffer = "0";
maxLength = "255";
groupNum = "1";
};
new ShellBitmapButton(SelectBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "60 37";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(22);";
accelerator = "return";
helpTag = "0";
text = "SELECT";
simpleStyle = "0";
};
new ShellBitmapButton(DestroyBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "5 67";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(23);";
accelerator = "return";
helpTag = "0";
text = "DESTROY";
simpleStyle = "0";
};
new ShellBitmapButton(TeleportBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "113 67";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(24);";
accelerator = "return";
helpTag = "0";
text = "TELEPORT";
simpleStyle = "0";
};
};
new ShellFieldCtrl(SpawnVehBorder) {
profile = "ShellFieldProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "256 237";
extent = "212 107";
minExtent = "16 18";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
new GuiMLTextCtrl(spawnVehStr) {
profile = "GuiDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "58 2";
extent = "115 14";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
deniedSound = "InputDeniedSound";
};
new ShellBitmapButton(spawnVehBtn1) {
profile = "ShellButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "2 12";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(30);";
helpTag = "0";
text = "WILDCAT";
simpleStyle = "0";
};
new ShellBitmapButton(spawnVehBtn2) {
profile = "ShellButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "2 42";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(31);";
helpTag = "0";
text = "BEOWULF";
simpleStyle = "0";
};
new ShellBitmapButton(spawnVehBtn3) {
profile = "ShellButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "2 72";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(32);";
helpTag = "0";
text = "JERICHO";
simpleStyle = "0";
};
new ShellBitmapButton(spawnVehBtn4) {
profile = "ShellButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "102 12";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(33);";
helpTag = "0";
text = "SHRIKE";
simpleStyle = "0";
};
new ShellBitmapButton(spawnVehBtn5) {
profile = "ShellButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "102 42";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(34);";
helpTag = "0";
text = "THUNDERSWORD";
simpleStyle = "0";
};
new ShellBitmapButton(spawnVehBtn6) {
profile = "ShellButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "102 72";
extent = "108 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "practiceServerBtns(35);";
helpTag = "0";
text = "HAVOC";
simpleStyle = "0";
};
};
new ShellBitmapButton(closeBtn) {
profile = "ShellButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "190 343";
extent = "120 38";
minExtent = "32 38";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
command = "HidePracticeHud();";
accelerator = "return";
helpTag = "0";
text = "CLOSE";
simpleStyle = "0";
};
new GuiMLTextCtrl(serverHudStr) {
profile = "ShellMediumTextProfile";
horizSizing = "center";
vertSizing = "bottom";
position = "192 25";
extent = "104 18";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
deniedSound = "InputDeniedSound";
};
new GuiMLTextCtrl(playerHudStr) {
profile = "ShellMediumTextProfile";
horizSizing = "center";
vertSizing = "bottom";
position = "192 171";
extent = "104 18";
minExtent = "8 8";
visible = "1";
hideCursor = "0";
bypassHideCursor = "0";
helpTag = "0";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
deniedSound = "InputDeniedSound";
};
};
};
}
////////////////////////////////////////////////////////////////////////////////////////
// Callbacks ///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function handleActivatePracticeHud()
{
if(!$PracticeHudCreated)
{
CreatePracticeHud();
$PracticeHudCreated = 1;
}
}
function handleInitPracHud(%msgType, %msgString, %gameType, %a2, %a3, %a4, %a5, %a6)
{
if($practiceHudCreated)
commandToServer('practiceHudInitialize', true);
}
function updatePracHud(%msgType, %msgString, %a1, %a2, %a3)
{
// set hud sensitivity
if(%a3 $= "")
%val = 0;
else
%val = (%a3 > 0);
UnlimAmmoBtn.setactive(%val);
AutoReturnBtn.setactive(%val);
spawnInFavsBtn.setactive(%val);
SpawnOnlyBtn.setactive(%val);
NoScoreLimitBtn.setactive(%val);
ProtectAssestsBtn.setactive(%val);
ResetMapBtn.setactive(%val);
practiceOptionMenu.setActive(%val);
practiceSubmitBtn.setactive(%val);
// set hud values
UnlimAmmoBtn.setvalue(%a1 & 1);
AutoReturnBtn.setvalue(%a1 & 2);
spawnInFavsBtn.setvalue(%a1 & 4);
SpawnOnlyBtn.setvalue(%a1 & 8);
NoScoreLimitBtn.setvalue(%a1 & 16);
ProtectAssestsBtn.setvalue(%a1 & 32);
observeDiscBtn.setvalue(%a2 & 1);
observeGLBtn.setvalue(%a2 & 2);
observeMortarBtn.setvalue(%a2 & 4);
observeMissileBtn.setvalue(%a2 & 8);
BeaconModeBtn.setvalue(%a2 & 16);
TelepadModeBtn.setvalue(%a2 & 32);
}
addMessageCallback('MsgClientJoin', handleActivatePracticeHud);
addMessageCallback('MsgClientReady', handleInitPracHud);
addMessageCallback('MsgStripAdminPlayer', updatePracHud);
addMessageCallback('UpdatePracHud', updatePracHud);
addMessageCallback('MsgAdminPlayer', updatePracHud);
addMessageCallback('MsgAdminAdminPlayer', updatePracHud);
addMessageCallback('MsgSuperAdminPlayer', updatePracHud);
addMessageCallback('MsgAdminForce', updatePracHud);
////////////////////////////////////////////////////////////////////////////////////////
// Get the headings from the server
function clientCMDpracticeHudHead(%head, %server, %player, %projectile, %tele, %vehicle)
{
practiceHudGui.settitle(%head);
serverHudStr.setvalue(%server);
playerHudStr.setvalue(%player);
projectileStr.setvalue(%projectile);
teleStr.setvalue(%tele);
spawnVehStr.setvalue(%vehicle);
}
function clientCMDpracticeHudDone()
{
$practiceArray[curopt] = 1;
practiceOptionMenu.clear();
for(%z = 1; %z <= $practiceArray[index]; %z++)
{
%nam = $practiceArray[%z, nam];
practiceOptionMenu.add(%nam, %z);
}
practiceOptionMenu.setSelected($practiceArray[curopt]);
practiceArrayCallOption($practiceArray[curopt]);
}
function practiceArrayCallOption(%opt)
{
practiceSetList.clear();
for(%x = 1; %x <= $practiceArray[%opt, noa]; %x++)
{
%nam = $practiceArray[%opt, %x];
practiceSetList.addRow(%x, %nam);
}
%cur = $practiceArray[%opt, cur];
practiceSetList.setSelectedByID(%cur);
}
function clientCMDinitializePracHud(%mode)
{
for(%i = 0; $ModArray[%i, nam] !$= ""; %i++)
{
$practiceArray[%i, cur] = "";
$practiceArray[%i, nam] = "";
$practiceArray[%i, noa] = "";
for(%j = 0; %j < 10; %j++)
$practiceArray[%i, %j] = "";
}
$practiceArray[index] = 0;
$practiceArray[curmode] = %mode;
}
function clientCMDpracticeHudPopulate(%opt, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13, %a14, %a15)
{
%s[1] = %a1;
%s[2] = %a2;
%s[3] = %a3;
%s[4] = %a4;
%s[5] = %a5;
%s[6] = %a6;
%s[7] = %a7;
%s[8] = %a8;
%s[9] = %a9;
%s[10] = %a10;
%s[11] = %a11;
%s[12] = %a12;
%s[13] = %a13;
%s[14] = %a14;
%s[15] = %a15;
$practiceArray[index]++;
$practiceArray[curopt] = $practiceArray[index];
%cur = $practiceArray[curopt];
$practiceArray[%cur, cur] = "";
$practiceArray[%cur, nam] = %opt;
while(%s[%z++] !$= "")
{
$practiceArray[%cur, %z] = %s[%z];
}
$practiceArray[%cur, cur] = "1";
$practiceArray[%cur, noa] = %z-1;
}
function practiceSetList::onSelect(%this, %id, %text)
{
$practiceArray[$practiceArray[curopt], cur] = %id;
}
function practiceOptionMenu::onSelect(%this, %id, %text)
{
$practiceArray[curopt] = %id;
practiceArraycallOption(%id);
}
function ShowPracticeHud()
{
if($thisMissionType $= "PracticeCTFGame")
{
commandToServer('needPracHudUpdate', %opt);
canvas.pushdialog(practiceHud);
$practiceHudOpen = 1;
}
}
function HidePracticeHud()
{
canvas.popdialog(practiceHud);
$practiceHudOpen = 0;
}
function practiceHud::onWake( %this )
{
if ( isObject( practiceHudMap ) )
{
practiceHudMap.pop();
practiceHudMap.delete();
}
new ActionMap( practiceHudMap );
practiceHudMap.blockBind( moveMap, toggleModHud );
practiceHudMap.blockBind( moveMap, toggleAdminHud );
practiceHudMap.blockBind( moveMap, toggleInventoryHud );
practiceHudMap.blockBind( moveMap, toggleScoreScreen );
practiceHudMap.blockBind( moveMap, toggleCommanderMap );
practiceHudMap.bindCmd( keyboard, escape, "", "HidePracticeHud();" );
practiceHudMap.push();
}
function practiceHud::onSleep( %this )
{
%this.callback = "";
practiceHudMap.pop();
practiceHudMap.delete();
}
////////////////////////////////////////////////////////////////////////////////////////
// Button functions ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function practiceServerBtns(%opt)
{
switch(%opt)
{
case 40:
%val = observeDiscBtn.getValue();
case 41:
%val = observeGLBtn.getValue();
case 42:
%val = observeMortarBtn.getValue();
case 43:
%val = observeMissileBtn.getValue();
default:
%val = "";
}
commandToServer('practiceBtnCall', %opt, %val);
}
function practiceSubmit()
{
// Send the currently selected option and setting to the server
commandToServer('practiceUpdateSettings', $practiceArray[curopt], $practiceArray[$practiceArray[curopt], cur]);
}

View file

@ -0,0 +1,10 @@
Tribes2 Classic client pack version 4
7/29/03
The "zz_classic_client_v1.vl2" file should be put into
your "...\Tribes2\GameData\base" directory, overwriting
any existing earlier version.
See the "classic_readme.txt" file for a list of changes.