params for public functions

This commit is contained in:
SilentSpike 2015-07-17 02:05:24 +01:00
parent 78a8149cc2
commit 81f87ee13c
5 changed files with 11 additions and 14 deletions

View File

@ -177,7 +177,7 @@ switch (toLower _mode) do {
} else { } else {
GVAR(camZoom) = (GVAR(camZoom) - (_zChange * GVAR(camZoom) * 0.2)) max 0.1; GVAR(camZoom) = (GVAR(camZoom) - (_zChange * GVAR(camZoom) * 0.2)) max 0.1;
}; };
call FUNC(handleCamera); [] call FUNC(handleCamera);
}; };
case "onmousemoving": { case "onmousemoving": {
private ["_x","_y"]; private ["_x","_y"];
@ -185,7 +185,7 @@ switch (toLower _mode) do {
_y = _args select 2; _y = _args select 2;
GVAR(mousePos) = [_x,_y]; GVAR(mousePos) = [_x,_y];
call FUNC(handleMouse); [] call FUNC(handleMouse);
}; };
// Keyboard events // Keyboard events
case "onkeydown": { case "onkeydown": {

View File

@ -20,3 +20,6 @@ _killer = _this select 1;
// Remove from group to prevent appearing on HUD upon respawn // Remove from group to prevent appearing on HUD upon respawn
[_unit, true, QGVAR(isSpectator), side group _unit] call EFUNC(common,switchToGroupSide); [_unit, true, QGVAR(isSpectator), side group _unit] call EFUNC(common,switchToGroupSide);
GVAR(camUnit) = _killer;
GVAR(camMode) = 2;

View File

@ -1,6 +1,6 @@
/* /*
* Author: SilentSpike * Author: SilentSpike
* Start the spectator camera spectator on respawn * Start the interface on respawn
* *
* Arguments: * Arguments:
* 0: New unit <OBJECT> * 0: New unit <OBJECT>

View File

@ -18,10 +18,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit","_set","_target"]; params ["_unit",["_set",true,[true]],["_target",objNull,[objNull]]];
_unit = _this select 0;
_set = if (count _this > 1) then {_this select 1} else {true};
_target = if (count _this > 2) then {_this select 2} else {objNull};
// No change, no service (but allow spectators who respawn to be reset) // No change, no service (but allow spectators who respawn to be reset)
if !(_set || (_unit getVariable [QGVAR(isSpectator), false])) exitWith {}; if !(_set || (_unit getVariable [QGVAR(isSpectator), false])) exitWith {};
@ -47,10 +44,9 @@ if (_set) then {
[_unit, QGVAR(isSpectator)] call EFUNC(common,hideUnit); [_unit, QGVAR(isSpectator)] call EFUNC(common,hideUnit);
[_unit, QGVAR(isSpectator)] call EFUNC(common,muteUnit); [_unit, QGVAR(isSpectator)] call EFUNC(common,muteUnit);
if !(GVAR(modulePos)) then { if !(isNull _target) then {
if !(isNull _target) then { GVAR(camPos) = getPosASL _target;
GVAR(camPos) = getPosATL _target; GVAR(camUnit) = _target;
};
}; };
["open"] call FUNC(handleInterface); ["open"] call FUNC(handleInterface);

View File

@ -18,9 +18,7 @@
#include "script_component.hpp" #include "script_component.hpp"
_newUnits = _this select 0; params [["_newUnits",[]],["_append",true,[true]],["_permanent",false,[false]]];
_append = if (count _this > 1) then {_this select 1} else {true};
_permanent = if (count _this > 2) then {_this select 2} else {false};
if (_permanent) then { if (_permanent) then {
if (_append) then { if (_append) then {