mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-02-13 11:43:52 +00:00
Initial commit
This commit is contained in:
parent
2211ed7650
commit
ebb3dc9cdd
10121 changed files with 801 additions and 4 deletions
60
docs/base/scripts/autoexec/AllowBotSkin.cs
Executable file
60
docs/base/scripts/autoexec/AllowBotSkin.cs
Executable file
|
|
@ -0,0 +1,60 @@
|
|||
package AllowBotSkin
|
||||
{
|
||||
|
||||
|
||||
function GMW_SkinPopup::fillList( %this, %raceGender )
|
||||
{
|
||||
for ( %i = 0; %i < %this.size(); %i++ )
|
||||
%this.realSkin[%i] = "";
|
||||
|
||||
%this.clear();
|
||||
%path = "textures/skins/";
|
||||
switch ( %raceGender )
|
||||
{
|
||||
case 0: // Human Male
|
||||
%pattern = ".lmale.png";
|
||||
case 1: // Human Female
|
||||
%pattern = ".lfemale.png";
|
||||
case 2: // Bioderm
|
||||
%pattern = ".lbioderm.png";
|
||||
}
|
||||
|
||||
%customSkins = GMW_SkinPrefPopup.getSelected();
|
||||
%count = 0;
|
||||
for ( %file = findFirstFile( %path @ "*" @ %pattern ); %file !$= ""; %file = findNextFile( %path @ "*" @ %pattern ) )
|
||||
{
|
||||
%skin = getSubStr( %file, strlen( %path ), strlen( %file ) - strlen( %path ) - strlen( %pattern ) ); // strip off the path and postfix
|
||||
|
||||
// Make sure this is not a bot skin:
|
||||
//if ( %skin !$= "basebot" && %skin !$= "basebbot" )
|
||||
//{
|
||||
// See if this skin has an alias:
|
||||
%baseSkin = false;
|
||||
for ( %i = 0; %i < $SkinCount; %i++ )
|
||||
{
|
||||
if ( %skin $= $Skin[%i, code] )
|
||||
{
|
||||
%baseSkin = true;
|
||||
%skin = $Skin[%i, name];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( %customSkins != %baseSkin )
|
||||
{
|
||||
if ( %baseSkin )
|
||||
%this.realSkin[%count] = $Skin[%i, code];
|
||||
%this.add( %skin, %count );
|
||||
%count++;
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
%this.sort( true );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(AllowBotSkin))
|
||||
activatePackage(AllowBotSkin);
|
||||
19
docs/base/scripts/autoexec/UEfix1.cs
Executable file
19
docs/base/scripts/autoexec/UEfix1.cs
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
// #autoload
|
||||
// #name = UEfix
|
||||
// #version = 1.0
|
||||
// #date = December 27, 2003
|
||||
// #category = Fix
|
||||
// #author = Lou Cypher
|
||||
// #warrior = LouCypher
|
||||
// #email = asta_llama_lincoln@hotmail.com
|
||||
// #web = http://deadzone.cjb.net
|
||||
// #description = Prevents clients from being vulnerable to crashing via NULL voice exploit
|
||||
|
||||
package UEfix {
|
||||
function alxGetWaveLen(%wavFile) {
|
||||
if ( strstr( %wavFile , ".wav" ) == -1 ) return $MaxMessageWavLength + 1;
|
||||
echo("Length check: " @ %wavFile);
|
||||
parent::alxGetWaveLen(%wavFile);
|
||||
}
|
||||
};
|
||||
activatePackage(UEfix);
|
||||
358
docs/base/scripts/autoexec/adminHud.cs
Executable file
358
docs/base/scripts/autoexec/adminHud.cs
Executable 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(1);
|
||||
}
|
||||
|
||||
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, "");
|
||||
}
|
||||
23
docs/base/scripts/autoexec/chatmenuHudClear.cs
Executable file
23
docs/base/scripts/autoexec/chatmenuHudClear.cs
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
//Clear VoiceBind Chatmenu at spawn
|
||||
|
||||
package chatmenuHudClear
|
||||
{
|
||||
|
||||
function ClientCmdDisplayHuds()
|
||||
{
|
||||
parent::ClientCmdDisplayHuds();
|
||||
cancelChatMenu();
|
||||
}
|
||||
|
||||
function clientCmdSetInventoryHudItem(%slot, %amount, %addItem)
|
||||
{
|
||||
parent::clientCmdSetInventoryHudItem(%slot, %amount, %addItem);
|
||||
cancelChatMenu();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(chatmenuHudClear))
|
||||
activatePackage(chatmenuHudClear);
|
||||
25
docs/base/scripts/autoexec/fov.cs
Executable file
25
docs/base/scripts/autoexec/fov.cs
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
// #autoload
|
||||
// #name = Spawn Bug Fix
|
||||
// #version = 1.0
|
||||
// #date = June 28, 2001
|
||||
// #status = final
|
||||
// #author = Daniel Trevino
|
||||
// #warrior = liq
|
||||
// #email = liqy@swbell.net
|
||||
// #web = http://www.toejamsplace.com/
|
||||
// #description = Fixes a bug in T2 where your FOV is set back to 90 on respawn. You can now use whatever FOV you want by editing your "$pref::Player::defaultFov" in ClientPrefs.cs
|
||||
|
||||
package spawnFix {
|
||||
function ClientCmdDisplayHuds() {
|
||||
parent::ClientCmdDisplayHuds();
|
||||
schedule(150, 0, setFov, $pref::Player::defaultFov);
|
||||
schedule(1000, 0, setFov, $pref::Player::defaultFov);
|
||||
}
|
||||
function clientCmdSetInventoryHudItem(%slot, %amount, %addItem)
|
||||
{
|
||||
parent::clientCmdSetInventoryHudItem(%slot, %amount, %addItem);
|
||||
schedule(150, 0, use, disc);
|
||||
schedule(1000, 0, use, disc);
|
||||
}
|
||||
};
|
||||
activatePackage(spawnFix);
|
||||
3
docs/base/scripts/autoexec/ircTempFix.cs
Executable file
3
docs/base/scripts/autoexec/ircTempFix.cs
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
$IRCTestServer = "irc.tribes2.net:6667";
|
||||
$IRCClient::state = IDIRC_CONNECTING_WAITING;
|
||||
$pref::IRCClient::autoreconnect = false;
|
||||
1
docs/base/scripts/autoexec/meltdownfix.cs
Executable file
1
docs/base/scripts/autoexec/meltdownfix.cs
Executable file
|
|
@ -0,0 +1 @@
|
|||
memPatch("5C88B5","90909090");
|
||||
551
docs/base/scripts/autoexec/modHud.cs
Executable file
551
docs/base/scripts/autoexec/modHud.cs
Executable 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 );
|
||||
}
|
||||
1
docs/base/scripts/autoexec/perfCounter.cs
Executable file
1
docs/base/scripts/autoexec/perfCounter.cs
Executable file
|
|
@ -0,0 +1 @@
|
|||
setPerfCounterEnable(1);
|
||||
560
docs/base/scripts/autoexec/statushud.cs
Executable file
560
docs/base/scripts/autoexec/statushud.cs
Executable file
|
|
@ -0,0 +1,560 @@
|
|||
// #author = |C|-DEbig3
|
||||
// #warrior = DEbig3
|
||||
// #Rewritten By = DarkTiger
|
||||
// version 1.0
|
||||
$statusHudStats::maxPing = -10000;
|
||||
$statusHudStats::minPing = 10000;
|
||||
package statusHudPackage {
|
||||
function toggleNetDisplayHud(%val)
|
||||
{
|
||||
if(%val)
|
||||
{
|
||||
$statusHudStatsCounter++;
|
||||
if($statusHudStatsCounter == 1)
|
||||
{
|
||||
NetGraphHudFrame.setVisible(false);
|
||||
NetBarHudFrame.setVisible(true);
|
||||
statusHudHud.setVisible(false);
|
||||
statusHudHud.setPosition(getWord(netGraphHudFrame.getPosition(),0),getWord(netGraphHudFrame.getPosition(),1));
|
||||
}
|
||||
else if($statusHudStatsCounter == 2)
|
||||
{
|
||||
netGraphHudFrame.setVisible(true);
|
||||
netBarHudFrame.setVisible(false);
|
||||
statusHudHud.setVisible(false);
|
||||
statusHudHud.setPosition(getWord(netGraphHudFrame.getPosition(),0),getWord(netGraphHudFrame.getPosition(),1));
|
||||
}
|
||||
else if($statusHudStatsCounter == 3){
|
||||
NetGraphHudFrame.setVisible(false);
|
||||
NetBarHudFrame.setVisible(false);
|
||||
if(!isObject(statusHudHud))
|
||||
statusHudBuild();
|
||||
statusHudHud.setVisible(true);
|
||||
statusHudHud.setPosition(getWord(netGraphHudFrame.getPosition(),0),getWord(netGraphHudFrame.getPosition(),1));
|
||||
}
|
||||
else if($statusHudStatsCounter == 4){
|
||||
NetGraphHudFrame.setVisible(true);
|
||||
NetBarHudFrame.setVisible(false);
|
||||
statusHudHud.setVisible(true);
|
||||
statusHudHud.setPosition(getWords(NetGraphHudFrame.getPosition(),0) - getWord(NetGraphHudFrame.getExtent(),0),getWords(NetGraphHudFrame.getPosition(),1));
|
||||
}
|
||||
else{
|
||||
$statusHudStatsCounter = 0;
|
||||
NetGraphHudFrame.setVisible(false);
|
||||
NetBarHudFrame.setVisible(false);
|
||||
statusHudHud.setVisible(false);
|
||||
statusHudHud.setPosition(getWord(netGraphHudFrame.getPosition(),0),getWord(netGraphHudFrame.getPosition(),1));
|
||||
}
|
||||
}
|
||||
}
|
||||
function NetBarHud::infoUpdate(%this, %ping, %packetLoss, %sendPackets, %sendBytes, %receivePackets, %receiveBytes) {
|
||||
parent::infoUpdate(%this, %ping, %packetLoss, %sendPackets, %sendBytes, %receivePackets, %receiveBytes);
|
||||
%dtms = getSimTime() - $statusHudStats::pingSpikeTime;
|
||||
$statusHudStats::pingSpikeTime = getSimTime();
|
||||
if(isObject(statusHudHud) && $statusHudStatsCounter > 2){
|
||||
statusHudHud.ppSCurrent.setText("<color:dcdcdc>" @ mFormatFloat(%sendPackets, "%4.0f"));
|
||||
statusHudHud.ppRCurrent.setText("<color:00bef0>" @ mFormatFloat(%receivePackets, "%4.0f"));
|
||||
statusHudHud.txCurrent.setText("<color:0078aa>" @ mFormatFloat(%sendBytes, "%4.0f"));
|
||||
statusHudHud.rxCurrent.setText("<color:787878>" @ mFormatFloat(%receiveBytes, "%4.0f"));
|
||||
$statusHudStats::totalPing += %ping;
|
||||
$statusHudStats::pingcount++;
|
||||
if(%ping > 500){
|
||||
$statusHudStats::lagSec += %dtms;
|
||||
statusHudHud.lagMSCurrent.setText("<color:ff0000>" @ mFormatFloat($statusHudStats::lagSec/1000, "%4.1f"));
|
||||
$statusHudStats::lastlag = getSimTime();
|
||||
}
|
||||
else if(getSimTime() - $statusHudStats::lastlag > 60000){
|
||||
statusHudHud.lagMSCurrent.setText("<color:00bef0>" @ mFormatFloat($statusHudStats::lagSec/1000, "%4.1f"));
|
||||
if(getSimTime() - $statusHudStats::lastlag > (60000 * 5)){
|
||||
$statusHudStats::lagSec = 0;
|
||||
statusHudHud.lagMSCurrent.setText(mFormatFloat($statusHudStats::lagSec/1000, "%4.1f"));
|
||||
}
|
||||
}
|
||||
%pingAvgReset = 0;
|
||||
if($statusHudStats::totalPing > 60000){
|
||||
$statusHudStats::totalPing = $statusHudStats::totalPing * 0.5;
|
||||
$statusHudStats::pingcount = $statusHudStats::pingcount * 0.5;
|
||||
$statusHudStats::maxPing = -10000;
|
||||
$statusHudStats::minPing = 10000;
|
||||
%pingAvgReset = 1;
|
||||
}
|
||||
if($statusHudStats::flCount++ > 12){
|
||||
$statusHudStats::fl = $statusHudStats::flMax - $statusHudStats::flMin;
|
||||
$statusHudStats::flMax = -10000;
|
||||
$statusHudStats::flMin = 10000;
|
||||
$statusHudStats::flCount = 0;
|
||||
}
|
||||
else{
|
||||
$statusHudStats::flMax = (%ping > $statusHudStats::flMax) ? %ping : $statusHudStats::flMax;
|
||||
$statusHudStats::flMin = (%ping < $statusHudStats::flMin) ? %ping : $statusHudStats::flMin;
|
||||
}
|
||||
|
||||
$statusHudStats::avgping= $statusHudStats::totalPing / $statusHudStats::pingcount;
|
||||
if(%pingAvgReset)
|
||||
statusHudHud.pingAvgCurrent.setText("<color:ff0000>" @ mFormatFloat($statusHudStats::avgping, "%4.0f"));
|
||||
else
|
||||
statusHudHud.pingAvgCurrent.setText(mFormatFloat($statusHudStats::avgping, "%4.0f"));
|
||||
|
||||
$statusHudStats::maxPing = (%ping > $statusHudStats::maxPing) ? %ping : $statusHudStats::maxPing;
|
||||
$statusHudStats::minPing = (%ping < $statusHudStats::minPing) ? %ping : $statusHudStats::minPing;
|
||||
|
||||
%speed = mFloor(getControlObjectSpeed());
|
||||
%alt = getControlObjectAltitude();
|
||||
%fps = $fps::real;
|
||||
if (%fps > $statusHudStats::maxfps)
|
||||
$statusHudStats::maxfps = %fps;
|
||||
%x = strstr($statusHudStats::avgfps, ".");
|
||||
%avgfps = getSubStr($statusHudStats::avgfps, 0, %x + 2);
|
||||
$statusHudStats::fpscount++;
|
||||
$statusHudStats::totalfps += %fps;
|
||||
%fpsReset = 0;
|
||||
if($statusHudStats::totalfps > 50000){
|
||||
$statusHudStats::totalfps *= 0.5;
|
||||
$statusHudStats::fpscount *= 0.5;
|
||||
$statusHudStats::maxfps = 0;
|
||||
%fpsReset = 1;
|
||||
}
|
||||
$statusHudStats::avgfps = $statusHudStats::totalfps / $statusHudStats::fpscount;
|
||||
if(%fpsReset){
|
||||
statusHudHud.fpscurrent.setText("<color:FF0000>" @ %fps);
|
||||
statusHudHud.fpsaverage.setText("<color:FF0000>" @ %avgfps);
|
||||
statusHudHud.fpsmax.setText("<color:FF0000>" @ $statusHudStats::maxfps);
|
||||
}
|
||||
else{
|
||||
statusHudHud.fpscurrent.setText(%fps);
|
||||
statusHudHud.fpsaverage.setText(%avgfps);
|
||||
statusHudHud.fpsmax.setText($statusHudStats::maxfps);
|
||||
}
|
||||
statusHudHud.ping.setText("<color:00FF00>" @ mFormatFloat(%ping, "%4.0f"));
|
||||
if(!isObject($statusHudStats::plObj)){
|
||||
$statusHudStats::plObj = getPLID();// to handel packet loss as the client side value is not correct
|
||||
}
|
||||
if(isObject($statusHudStats::plObj)){
|
||||
$statusHudStats::plupdate += %dtms;
|
||||
if($statusHudStats::plupdate > 4000){
|
||||
commandToServer( 'getScores' );
|
||||
$statusHudStats::plupdate = 0;
|
||||
}
|
||||
statusHudHud.pl.setText("<color:FF0000>" @ mFormatFloat($statusHudStats::plObj.packetLoss, "%3.0f"));
|
||||
}
|
||||
else{
|
||||
statusHudHud.pl.setText("<color:FF0000>" @ mFormatFloat(%packetLoss, "%3.0f"));
|
||||
}
|
||||
statusHudHud.speed.setText(%speed);
|
||||
statusHudHud.altitude.setText(%alt);
|
||||
|
||||
if(%pingAvgReset){
|
||||
statusHudHud.pingMinCurrent.setText("<color:FF0000>" @ mFloor($statusHudStats::minPing));
|
||||
statusHudHud.pingMaxCurrent.setText("<color:FF0000>" @ mFloor($statusHudStats::maxPing));
|
||||
statusHudHud.pingFluxCurrent.setText("<color:FF0000>" @ mFloor($statusHudStats::fl));
|
||||
}
|
||||
else{
|
||||
statusHudHud.pingMinCurrent.setText(mFloor($statusHudStats::minPing));
|
||||
statusHudHud.pingMaxCurrent.setText(mFloor($statusHudStats::maxPing));
|
||||
statusHudHud.pingFluxCurrent.setText(mFloor($statusHudStats::fl));
|
||||
}
|
||||
}
|
||||
}
|
||||
function getPLID(){
|
||||
%name = stripTrailingSpaces( strToPlayerName( getField( $pref::Player[$pref::Player::Current], 0 ) ) );
|
||||
for (%i = 0; %i < PlayerListGroup.getCount(); %i++) { // the client list
|
||||
%id = PlayerListGroup.getObject(%i);
|
||||
%fullName = stripChars(%id.name,"\cp\co\c6\c7\c8\c9\x10\x11");
|
||||
if(strlwr(%fullName) $= strlwr(%name)){
|
||||
return %id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function statusHudBuild() {
|
||||
if (isObject(statusHudHud)) {
|
||||
statusHudHud.delete();
|
||||
}
|
||||
$statusHud = new ShellFieldCtrl(statusHudHud) {
|
||||
profile = "GuiChatBackProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
position = netGraphHudFrame.getPosition();
|
||||
extent = "170 80";
|
||||
minExtent = "2 2";
|
||||
visible = "1";
|
||||
};
|
||||
playgui.add($statusHud);
|
||||
new GuiControlProfile ("statusHudTagProfile")
|
||||
{
|
||||
fontType = "Univers Condensed";
|
||||
fontSize = 14;
|
||||
fontColor = "200 200 200";
|
||||
justify = "center";
|
||||
};
|
||||
new GuiControlProfile ("statusHudTextProfile")
|
||||
{
|
||||
fontType = "Univers Condensed";
|
||||
fontSize = 14;
|
||||
justify = "center";
|
||||
};
|
||||
statusHudHud.fpscurrenttext = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "4 0";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "fps:";
|
||||
};
|
||||
statusHudHud.fpscurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "22 0";
|
||||
extent = "25 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.fpsaveragetext = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "53 0";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "avg:";
|
||||
};
|
||||
statusHudHud.fpsaverage = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "73 0";
|
||||
extent = "25 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.fpsmaxtext = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "104 0";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "max:";
|
||||
};
|
||||
statusHudHud.fpsmax = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "125 0";
|
||||
extent = "25 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.pingtext = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "4 16";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "ping:";
|
||||
};
|
||||
statusHudHud.ping = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "22 16";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = $statusHudPing;
|
||||
};
|
||||
statusHudHud.pltext = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "141 16";
|
||||
extent = "15 16";
|
||||
visible = "1";
|
||||
text = "pl:";
|
||||
};
|
||||
statusHudHud.pl = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "148 16";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = $statusHudPL;
|
||||
};
|
||||
statusHudHud.speedtext = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "53 16";
|
||||
extent = "28 16";
|
||||
visible = "1";
|
||||
text = "speed:";
|
||||
};
|
||||
statusHudHud.speed = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "82 16";
|
||||
extent = "24 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.altitudetext = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "105 16";
|
||||
extent = "15 16";
|
||||
visible = "1";
|
||||
text = "alt:";
|
||||
};
|
||||
statusHudHud.altitude = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "119 16";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
////////////////////////////////////////////////
|
||||
statusHudHud.ppSText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "4 32";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "ppS:";
|
||||
};
|
||||
statusHudHud.ppSCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "22 32";
|
||||
extent = "25 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.txText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "53 32";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "Tx:";
|
||||
};
|
||||
statusHudHud.txCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "66 32";
|
||||
extent = "25 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.rxText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "105 32";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "Rx:";
|
||||
};
|
||||
statusHudHud.rxCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "118 32";
|
||||
extent = "25 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.ppRText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "4 48";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "ppR:";
|
||||
};
|
||||
statusHudHud.ppRCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "22 48";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
|
||||
statusHudHud.lagMSText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "53 48";
|
||||
extent = "34 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.lagMSCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "73 48";
|
||||
extent = "24 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.pingAvgText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "105 48";
|
||||
extent = "36 16";
|
||||
visible = "1";
|
||||
text = "pingAvg:";
|
||||
};
|
||||
statusHudHud.pingAvgCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "137 48";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
|
||||
|
||||
statusHudHud.pingMinText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "4 64";
|
||||
extent = "34 16";
|
||||
visible = "1";
|
||||
text = "PingMin";
|
||||
};
|
||||
statusHudHud.pingMinCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "28 64";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
|
||||
statusHudHud.pingMaxText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "53 64";
|
||||
extent = "34 16";
|
||||
visible = "1";
|
||||
text = "PingMax";
|
||||
};
|
||||
statusHudHud.pingMaxCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "80 64";
|
||||
extent = "24 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.pingFluxText = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTagProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "105 64";
|
||||
extent = "36 16";
|
||||
visible = "1";
|
||||
text = "Flux";
|
||||
};
|
||||
statusHudHud.pingFluxCurrent = new GuiMLTextCtrl() {
|
||||
profile = "statusHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "124 64";
|
||||
extent = "20 16";
|
||||
visible = "1";
|
||||
text = "0";
|
||||
};
|
||||
statusHudHud.add(statusHudHud.fpscurrenttext);
|
||||
statusHudHud.add(statusHudHud.fpscurrent);
|
||||
statusHudHud.fpscurrenttext.setText("fps:");
|
||||
|
||||
statusHudHud.add(statusHudHud.fpsaveragetext);
|
||||
statusHudHud.add(statusHudHud.fpsaverage);
|
||||
statusHudHud.fpsaveragetext.setText("avg:");
|
||||
|
||||
statusHudHud.add(statusHudHud.fpsmaxtext);
|
||||
statusHudHud.add(statusHudHud.fpsmax);
|
||||
statusHudHud.fpsmaxtext.setText("max:");
|
||||
|
||||
statusHudHud.add(statusHudHud.pingtext);
|
||||
statusHudHud.add(statusHudHud.ping);
|
||||
statusHudHud.pingtext.setText("ping:");
|
||||
|
||||
statusHudHud.add(statusHudHud.pltext);
|
||||
statusHudHud.add(statusHudHud.pl);
|
||||
statusHudHud.pltext.setText("pl:");
|
||||
|
||||
statusHudHud.add(statusHudHud.speedtext);
|
||||
statusHudHud.add(statusHudHud.speed);
|
||||
statusHudHud.speedtext.setText("speed:");
|
||||
|
||||
statusHudHud.add(statusHudHud.altitudetext);
|
||||
statusHudHud.add(statusHudHud.altitude);
|
||||
statusHudHud.altitudetext.setText("alt:");
|
||||
|
||||
//////////////////////////////////////////////
|
||||
statusHudHud.add(statusHudHud.ppSText);
|
||||
statusHudHud.add(statusHudHud.ppSCurrent);
|
||||
statusHudHud.ppSText.setText("ppS:"); //dcdcdc
|
||||
|
||||
statusHudHud.add(statusHudHud.ppRText);
|
||||
statusHudHud.add(statusHudHud.ppRCurrent);
|
||||
statusHudHud.ppRText.setText("ppR:"); //00bef0
|
||||
|
||||
statusHudHud.add(statusHudHud.rxText);
|
||||
statusHudHud.rxText.setText("Rx:");//787878
|
||||
statusHudHud.add(statusHudHud.rxCurrent);
|
||||
|
||||
statusHudHud.add(statusHudHud.txText);
|
||||
statusHudHud.add(statusHudHud.txCurrent);
|
||||
statusHudHud.txText.setText("Tx:");// 0078aa
|
||||
|
||||
statusHudHud.add(statusHudHud.lagMSText);
|
||||
statusHudHud.add(statusHudHud.lagMSCurrent);
|
||||
statusHudHud.lagMSText.setText("Lag:");
|
||||
|
||||
statusHudHud.add(statusHudHud.pingAvgText);
|
||||
statusHudHud.add(statusHudHud.pingAvgCurrent);
|
||||
statusHudHud.pingAvgText.setText("PingAvg:");
|
||||
|
||||
statusHudHud.add(statusHudHud.pingMinText);
|
||||
statusHudHud.add(statusHudHud.pingMinCurrent);
|
||||
statusHudHud.pingMinText.setText("PMin:");
|
||||
|
||||
statusHudHud.add(statusHudHud.pingMaxText);
|
||||
statusHudHud.add(statusHudHud.pingMaxCurrent);
|
||||
statusHudHud.pingMaxText.setText("PMax:");
|
||||
|
||||
statusHudHud.add(statusHudHud.pingFluxText);
|
||||
statusHudHud.add(statusHudHud.pingFluxCurrent);
|
||||
statusHudHud.pingFluxText.setText("PDif:");
|
||||
statusHudHud.lagMSCurrent.setText(0);
|
||||
if(isObject(HM) && isObject(HudMover)) {
|
||||
hudmover::addhud(statusHudHud, "statusHud");
|
||||
}
|
||||
}
|
||||
};
|
||||
activatePackage(statusHudPackage);
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue