Initial commit.

This commit is contained in:
Robert MacGregor 2012-07-27 17:22:05 -04:00
commit 9a05e8d86c
652 changed files with 154587 additions and 0 deletions

View file

@ -0,0 +1,76 @@
// #autoload
// #name = Fix Remap
// #version = 1.0
// #category = Fix
// #warrior = WegBert
// #status = beta
function redoBrokenMapping( %actionMap, %device, %action, %cmd, %newIndex )
{
%actionMap.bind( %device, %action, %cmd );
//OP_RemapList.setRowById( %oldIndex, buildFullMapString( %oldIndex ) );
OP_RemapList.setRowById( %newIndex, buildFullMapString( %newIndex ) );
}
package FixRemapLoad {
function RemapInputCtrl::onInputEvent( %this, %device, %action )
{
Parent::onInputEvent( %this, %device, %action );
// prevMapIndex would equal -1 under the following circumstances:
//
// 1. User installed a third-party script which added a remap entry to the list.
// The user removed that script and is trying to rebind a key that was
// previously bound to that script. With the remap entry missing, the system
// fails, because the function bound to the key has no $RemapCmd.
//
// 2. User installed a third-party script which did not add a remap entry to the
// list, but instead replaced an existing command with a third-party one
// (for example, the HappyThrow script upon being run for the first time
// rebinds the user's grenade key from the default function, throwGrenade, to
// throwGrenadeNew). The script may still be installed, but the user is trying
// to rebind the key bound to the third-party function. This third-party function,
// although perfectly valid and existing, has no $RemapCmd.
//
// To counter these problems, the script will warn the user that the function may or
// may not exist. It will allow the user to choose whether they still want to rebind
// the key or not. If they do, the script will proceed with the remapping that the
// original fon complained about.
if (%this.mode !$= "consoleKey")
{
switch$ ( OP_ControlsPane.group )
{
case "Observer":
%actionMap = observerMap;
%cmd = $ObsRemapCmd[%this.index];
default:
%actionMap = moveMap;
%cmd = $RemapCmd[%this.index];
}
%prevMap = %actionMap.getCommand( %device, %action );
if (%prevMap !$= %cmd && %prevMap !$= "")
{
%mapName = getMapDisplayName( %device, %action );
%prevMapIndex = findRemapCmdIndex( %prevMap );
if (%prevMapIndex == -1)
{
// The OK dialog has probably popped up now, so turn it off. We've got the situation
// under control.
if (MessageBoxOKDlg.isAwake())
Canvas.popDialog(MessageBoxOKDlg);
MessageBoxYesNo( "FIXREMAP WARNING",
"\"" @ %mapName @ "\" is bound to the function \"" @ %prevMap @ "\"! The function may exist in a user script. See FixRemap.txt in your T2 autoexec dir for more details. Do you still want to undo this mapping?",
"redoBrokenMapping(" @ %actionMap @ ", " @ %device @ ", \"" @ %action @ "\", \"" @ %cmd @ "\", " @ %this.index @ ");", "" );
}
}
}
}
};
activatePackage(FixRemapLoad);

View file

@ -0,0 +1,32 @@
// #autoload
// #name = GUIML Fix
// #version = 2.0
// #date = March 1st, 2010
// #category = Fix
// #author = Dark Dragon DX
// #warrior = DarkDragonDX
// #email = DarkDragonDX@Hotmail.com
// #description = Adds a failSafe for the <a:command> tag. Mainly for players that use mods with interactive GUIML elements.
package GUIMLFix
{
function toggleEditor(%make)
{
parent::toggleEditor(%make); //Call parent function
activatePackage(GUIMLPackage);
}
};
activatePackage(GUIMLFix);
//Seperate package to activate our new code
package GUIMLPackage
{
function GuiMLTextCtrl::onURL(%this, %url)
{
parent::onURL(%this, %url);
commandToServer('ProcessGameLink',getField(%url,1));
}
};
deactivatePackage(GUIMLPackage); // Just to be sure

View file

@ -0,0 +1,28 @@
// #autoload
// #name = cleanDSO
// #version = 1.0
// #date = December 21, 2001
// #author = Paul Tousignant
// #warrior = UberGuy (FT)
// #email = uberguy@skyreach.cas.nwu.edu
// #web = http://scripts.tribalwar.com/uberguy
// #description = Remove all your *.dso files every time you exit T2.
// #status = beta
package noDso {
function quit() {
%cnt = 0;
%tmpObj = new ScriptObject() {};
for(%file = findFirstFile("*.dso"); %file !$= ""; %file = findNextFile("*.dso")) {
%tmpObj.file[%cnt++] = %file;
}
for (%i=0; %i<%cnt; %i++) {
deleteFile(%tmpObj.file[%i]);
}
%tmpObj.delete();
return parent::quit();
}
};
activatePackage(noDso);

View file

@ -0,0 +1,45 @@
//
// xPack-T2-CTF-Maps.vl2 update file.
// MiniVStationX
// Adapted from the original station code by
// Tim 'Zear' Hammock
//
// This file created to address code changes in base++
// To handle issues with certain maps from the xPack Map Pack
// that move the vehicle stations and scale the vehicle pads.
//
// z0dd - ZOD, 4/25/02
package MiniVStationX
{
function StationVehiclePad::createStationVehicle(%data, %obj)
{
Parent::createStationVehicle(%data, %obj);
schedule(250, 0, "moveVStationX");
}
};
function moveVStationX()
{
if($CurrentMission $= "Raindance_x")
{
nametoid(team1vehiclestation).station.setTransform("-180.737 264.173 73.9045 0 0 -0.999913 0.0206931");
nametoid(team1vehiclestation).station.trigger.setTransform("-180.737 264.173 73.9045 0 0 -0.999913 0.0206931");
nametoid(team2vehiclestation).station.setTransform("-44.2395 -559.427 62.578 0 0 1 3.13932");
nametoid(team2vehiclestation).station.trigger.setTransform("-44.2395 -559.427 62.578 0 0 1 3.13932");
}
else if($CurrentMission $= "Rollercoaster_x")
{
nametoid(team1vehiclestation).station.setTransform("357.822 57.4137 157.373 0 0 1 1.752");
nametoid(team1vehiclestation).station.trigger.setTransform("357.822 57.4137 157.373 0 0 1 1.68703");
nametoid(team2vehiclestation).station.setTransform("-401.698 7.81527 156.566 0 0 -1 1.48");
nametoid(team2vehiclestation).station.trigger.setTransform("-401.698 7.81527 156.566 0 0 -1 1.54951");
(nametoid(team1flag)+ 1).setTransform("0 0 0 0 0 0 0");
(nametoid(team2flag)+ 1).setTransform("0 0 0 0 0 0 0");
}
else
return;
}
activatePackage(MiniVStationX);

View file

@ -0,0 +1,32 @@
// #autoload
// #name = Safe Mode
// #version = 1.0
// #date = Tuesday, January 12, 2010
// #author = Dark Dragon DX
// #warrior = DarkDragonDX
// #email = DarkDragonDX@Hotmail.com
// #web = http://www.the-Construct.net
// #description = Adds a new command-line to Tribes 2 for shortcuts: -safeMode
// #status = Release
package SafeMode{
function DispatchLaunchMode()
{
parent::DispatchLaunchMode();
// check T2 command line arguments
for(%i = 1; %i < $Game::argc ; %i++)
{
%arg = $Game::argv[%i];
%nextArg = $Game::argv[%i+1];
%hasNextArg = $Game::argc - %i > 1;
if( !stricmp(%arg, "-Safemode")) //If enabled, cuts off all TCP & HTTP object connections, preventing UE's when running T2 without internet
{
exec("scripts/Safemode.cs");
}
}
}
};
activatePackage(SafeMode);

View file

@ -0,0 +1,37 @@
// #autoload
// #name = Static Waypoint Fix
// #version = 1.0
// #category = Fix
// #warrior = Jsut
// #description = Fixes static waypoints in the command circuit.
package JsutStaticWaypointFix
{
function CommanderTree::processCommand(%this, %command, %target, %typeTag)
{
parent::processCommand(%this, %command, %target, %typeTag);
// special case?
if(%typeTag < 0)
{
switch$(getTaggedString(%command))
{
// waypoints: tree owns the waypoint targets
case "CreateWayPoint":
%target.settext(%this.currentWaypointID);
return;
}
}
}
};
activatePackage(JsutStaticWaypointFix);