replace timePFH with CBA_missionTime

This commit is contained in:
commy2
2016-03-02 11:01:39 +01:00
parent e2c7576251
commit 467075ad67
107 changed files with 289 additions and 349 deletions

View File

@ -276,5 +276,3 @@ PREP(hashListCreateHash);
PREP(hashListSelect);
PREP(hashListSet);
PREP(hashListPush);
PREP(timePFH);

View File

@ -13,7 +13,7 @@
BEGIN_COUNTER(waitAndExec);
//Handle the waitAndExec array:
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do {
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= CBA_missionTime}} do {
private _entry = GVAR(waitAndExecArray) deleteAt 0;
(_entry select 2) call (_entry select 1);
};

View File

@ -69,21 +69,6 @@ if (hasInterface) then {
}, 0, []] call CBA_fnc_addPerFrameHandler;
};
//////////////////////////////////////////////////
// Time handling
//////////////////////////////////////////////////
ACE_time = diag_tickTime;
ACE_realTime = diag_tickTime;
ACE_virtualTime = diag_tickTime;
ACE_diagTime = diag_tickTime;
ACE_gameTime = time;
ACE_pausedTime = 0;
ACE_virtualPausedTime = 0;
[FUNC(timePFH), 0, []] call CBA_fnc_addPerFrameHandler;
// Init toHex
[0] call FUNC(toHex);

View File

@ -29,7 +29,7 @@ if (isServer) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData params ["", "_eventLog"];
_eventLog pushBack [ACE_diagTime, _args, _ttl];
_eventLog pushBack [diag_tickTime, _args, _ttl];
};
};

View File

@ -19,8 +19,8 @@
params ["_params", "_function", "_namespace", "_uid", "_duration", "_event"];
if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then {
_namespace setVariable [_uid, [ACE_diagTime + _duration, _params call _function]];
if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then {
_namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];
// Does the cache needs to be cleared on an event?
if (!isNil "_event") then {

View File

@ -89,11 +89,11 @@ private _refresh = {
if (_show) then {
if ({_x select 0 == _iconId} count _list == 0) then {
_list pushBack [_iconId, _icon, _color, ACE_time];
_list pushBack [_iconId, _icon, _color, CBA_missionTime];
} else {
{
if (_x select 0 == _iconId) exitWith {
_list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]];
_list set [_forEachIndex, [_iconId, _icon, _color, CBA_missionTime]];
};
} forEach _list;
};

View File

@ -25,7 +25,7 @@ if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
GVAR(lastHint) params ["_lastHintTime", "_lastHintPriority"];
private _time = ACE_time;
private _time = CBA_missionTime;
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
hintSilent _text;

View File

@ -12,7 +12,7 @@
*/
#include "script_component.hpp"
// diag_log text format["%1 HASH HAS KEY: %2", ACE_diagTime, _this];
// diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this];
params ["_hash", "_key"];

View File

@ -12,7 +12,7 @@
*/
#include "script_component.hpp"
// diag_log text format["%1 HASH SET: %2", ACE_diagTime, _this];
// diag_log text format["%1 HASH SET: %2", diag_tickTime, _this];
params ["_hash", "_key", "_val"];

View File

@ -46,7 +46,7 @@ _ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW /
[{
(_this select 0) params ["_args", "_onFinish", "_onFail", "_condition", "_player", "_startTime", "_totalTime", "_exceptions"];
private _elapsedTime = ACE_time - _startTime;
private _elapsedTime = CBA_missionTime - _startTime;
private _errorCode = -1;
// this does not check: target fell unconscious, target died, target moved inside vehicle / left vehicle, target moved outside of players range, target moves at all.
@ -97,4 +97,4 @@ _ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW /
//Update Progress Bar (ratio of elepased:total)
(uiNamespace getVariable QGVAR(ctrlProgressBar)) progressSetPosition (_elapsedTime / _totalTime);
};
}, 0, [_args, _onFinish, _onFail, _condition, _player, ACE_time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler;
}, 0, [_args, _onFinish, _onFail, _condition, _player, CBA_missionTime, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler;

View File

@ -45,7 +45,7 @@ GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = _target addAction ["Decline", compile
GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = _requestID;
GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [ACE_time, _target, _requestID] spawn { // @todo
GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [CBA_missionTime, _target, _requestID] spawn { // @todo
params ["_time", "_target", "_requestID"];
_time = _time + 40;
@ -55,7 +55,7 @@ GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [ACE_time, _target, _requestID] spawn {
waitUntil {
_id = _target getVariable _requestID;
(ACE_time > _time || isNil "_id")
(CBA_missionTime > _time || isNil "_id")
};
_target setVariable [_requestID, nil];

View File

@ -34,7 +34,7 @@ if (!isServer) exitWith {false};
if (_globalEventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
} else {
_ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}};
_ttlReturn = call {_globalEventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _globalEventTTL}};
};
if (_ttlReturn) then {
@ -44,7 +44,7 @@ if (!isServer) exitWith {false};
if (_eventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
} else {
_ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}};
_ttlReturn = call {_eventTTL < 1 || {diag_tickTime < _time + _eventTTL}};
};
};

View File

@ -25,7 +25,7 @@ if (isNil QGVAR(publishSchedId)) then {
GVAR(publishNextTime) = 1e7;
GVAR(publishSchedId) = [{
if (ACE_diagTime > GVAR(publishNextTime)) then {
if (diag_tickTime > GVAR(publishNextTime)) then {
{
_x params [_unit, _varName];
_unit setVariable [_varName, _unit getVariable _varName, true];
@ -41,8 +41,8 @@ if (isNil QGVAR(publishSchedId)) then {
// If the variable is not on the list
if (GVAR(publishVarNames) find [_unit, _varName] == -1) exitWith {
GVAR(publishVarNames) pushBack [_unit, _varName];
GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay);
GVAR(publishNextTime) = GVAR(publishNextTime) min (diag_tickTime + _maxDelay);
};
// If the variable is on the list
GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay);
GVAR(publishNextTime) = GVAR(publishNextTime) min (diag_tickTime + _maxDelay);

View File

@ -1,40 +0,0 @@
/*
* Author: jaynus
* PFEH to set all Ace Time Variables
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
BEGIN_COUNTER(timePFH);
private _lastTickTime = ACE_diagTime;
private _lastGameTime = ACE_gameTime;
ACE_gameTime = time;
ACE_diagTime = diag_tickTime;
private _delta = ACE_diagTime - _lastTickTime;
if (ACE_gameTime <= _lastGameTime) then {
TRACE_1("paused",_delta);
ACE_paused = true;
// Game is paused or not running
ACE_pausedTime = ACE_pausedTime + _delta;
ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime);
} else {
TRACE_1("live",_delta);
ACE_paused = false;
// Time is updating
ACE_realTime = ACE_realTime + _delta;
ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
ACE_time = ACE_virtualTime;
};
END_COUNTER(timePFH);

View File

@ -19,5 +19,5 @@
params ["_func", "_params", "_delay"];
GVAR(waitAndExecArray) pushBack [ACE_time + _delay, _func, _params];
GVAR(waitAndExecArray) pushBack [CBA_missionTime + _delay, _func, _params];
GVAR(waitAndExecArray) sort true;