-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from gruppe-adler/optimize
mostly not what the branch name says
- Loading branch information
Showing
145 changed files
with
1,265 additions
and
915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
#include "script_component.hpp" | ||
|
||
if (!(EGVAR(main,enabled))) exitWith { | ||
INFO("GRAD civs is disabled. Good bye!"); | ||
}; | ||
if (!(EGVAR(main,enabled))) exitWith {}; | ||
|
||
if (isServer || !hasInterface) then { | ||
["business", ["bus_rally"], FUNC(sm_business)] call EFUNC(common,augmentStateMachine); | ||
if (isServer || CBA_isHeadlessClient) then { | ||
["business", ["bus_rally"], FUNC(sm_business)] call EFUNC(common,augmentStateMachine); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
addons/cars/functions/fnc_sm_business_trans_mountUp_dismount_condition.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#include "..\script_component.hpp" | ||
|
||
(([_this, "emotions"] call EFUNC(common,civGetState)) == "emo_panic") || (_this call EFUNC(legacy,sm_activities_helper_surrenderCondition)) | ||
(([_this, "emotions"] call EFUNC(common,civGetState)) == "emo_panic") || (_this call EFUNC(interact,sm_activities_helper_surrenderCondition)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
z\grad_civs\addons\diagnostics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class Extended_PostInit_EventHandlers | ||
{ | ||
class ADDON | ||
{ | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; | ||
class Extended_PreInit_EventHandlers | ||
{ | ||
class ADDON | ||
{ | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PREP(initConfig); | ||
PREP(showFps); | ||
PREP(showHonkAtArea); | ||
PREP(showInfoLine); | ||
PREP(showOnMap_drawCivs); | ||
PREP(showOnMap); | ||
PREP(showPinkArrows); | ||
PREP(showPointingHints); | ||
PREP(updateInfoLine); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "script_component.hpp" | ||
|
||
if (!(EGVAR(main,enabled))) exitWith {}; | ||
|
||
if (hasInterface) then { | ||
call FUNC(showHonkAtArea); | ||
call FUNC(showOnMap); | ||
call FUNC(showPinkArrows); | ||
call FUNC(showPointingHints); | ||
call FUNC(showInfoLine); | ||
call FUNC(showFps); | ||
}; | ||
|
||
if (isServer || CBA_isHeadlessClient) then { | ||
GVAR(debugLoopHandle) = [{ | ||
params ["_args", "_handle"]; | ||
if (hasInterface && (!isGameFocused || isGamePaused)) exitWith {}; | ||
if (call EGVAR(legacy,EXITON)) exitWith {[_handle] call CBA_fnc_removePerFrameHandler}; | ||
if (GVAR(showInfoLine)) then { | ||
{ _x call FUNC(updateInfoLine); } forEach EGVAR(legacy,localCivs); | ||
}; | ||
}, 1, []] call CBA_fnc_addPerFrameHandler; | ||
|
||
[ | ||
{ | ||
if (GVAR(showFps)) then { | ||
[QGVAR(fps), [clientOwner, diag_fps, count EGVAR(legacy,localCivs)]] call CBA_fnc_globalEvent; | ||
}; | ||
}, | ||
2, | ||
[] | ||
] call CBA_fnc_addPerFrameHandler; | ||
}; | ||
|
||
if (isServer) then { | ||
[ | ||
QEGVAR(common,civ_added), | ||
{ | ||
params [["_civ", objNull, [objNull]]]; | ||
_civ setVariable [QGVAR(localAt), owner _civ, true]; | ||
_civ addEventHandler ["Local", { | ||
params ["_civ", ""]; | ||
_civ setVariable [QGVAR(localAt), owner _civ, true]; | ||
}]; | ||
} | ||
] call CBA_fnc_addEventHandler; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
PREP_RECOMPILE_START; | ||
#include "XEH_PREP.hpp" | ||
PREP_RECOMPILE_END; | ||
|
||
ADDON = true; | ||
|
||
|
||
[] call FUNC(initConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
name = QUOTE(COMPONENT); | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"grad_civs_main", "grad_civs_legacy"}; | ||
author = "AUTHOR"; | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#include "..\script_component.hpp" | ||
|
||
INFO("initConfig running..."); | ||
|
||
private _settingsGroup = ["GRAD Civs", "a) diagnostics"]; | ||
|
||
[ | ||
QGVAR(showFps), | ||
"CHECKBOX", | ||
"Show server & HC fps", | ||
_settingsGroup, | ||
false, | ||
true, | ||
{}, | ||
false | ||
] call CBA_fnc_addSetting; | ||
|
||
[ | ||
QGVAR(showOnMap), | ||
"CHECKBOX", | ||
"Show civs on map", | ||
_settingsGroup, | ||
false, | ||
true, | ||
FUNC(showOnMap), | ||
false | ||
] call CBA_fnc_addSetting; | ||
|
||
[ | ||
QGVAR(showInfoLine), | ||
"CHECKBOX", | ||
"Show info line", | ||
_settingsGroup, | ||
false, | ||
true, | ||
FUNC(showInfoLine), | ||
false | ||
] call CBA_fnc_addSetting; | ||
|
||
[ | ||
QGVAR(showPinkArrows), | ||
"CHECKBOX", | ||
"Create 3D arrows over civ heads", | ||
_settingsGroup, | ||
false, | ||
true, | ||
FUNC(showPinkArrows), | ||
false | ||
] call CBA_fnc_addSetting; | ||
|
||
[ | ||
QGVAR(showMisc), | ||
"CHECKBOX", | ||
"Miscellaneous stuff", | ||
_settingsGroup, | ||
false, | ||
true, | ||
FUNC(showHonkAtArea), | ||
false | ||
] call CBA_fnc_addSetting; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "..\script_component.hpp" | ||
|
||
ISNILS(GVAR(lastFps), call CBA_fnc_hashCreate); | ||
ISNILS(GVAR(fpsHandler), -1); | ||
ISNILS(GVAR(fpsPfh), -1); | ||
|
||
GVAR(fpsHandler) = [ | ||
QGVAR(fps), | ||
{ | ||
if (!GVAR(showFps)) exitWith {}; | ||
params [ | ||
["_clientId", -1, [0]], | ||
["_fps", -1, [0]], | ||
["_civCount", 0, [0]] | ||
]; | ||
|
||
[GVAR(lastFps), _clientId, [_fps, _civCount]] call CBA_fnc_hashSet; | ||
} | ||
] call CBA_fnc_addEventHandler; | ||
|
||
GVAR(fpsPfh) = [ | ||
{ | ||
if (!GVAR(showFps)) exitWith {}; | ||
|
||
private _text = "FPS "; | ||
[GVAR(lastFps), { | ||
_text = format ["%1 | %2: %3 (%4)", _text, _key, _value#0, _value#1] | ||
}] call CBA_fnc_hashEachPair; | ||
systemChat _text; | ||
}, | ||
2, | ||
[] | ||
] call CBA_fnc_addPerFrameHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "..\script_component.hpp" | ||
|
||
GVAR(honkHandler) = [QEGVAR(interact,honking_at_poly), { | ||
if (!GVAR(showMisc)) exitWith {}; | ||
[ | ||
{ | ||
params [ | ||
["_args", [], [[]]], | ||
["_handle", 0, [0]] | ||
]; | ||
_args params [ | ||
["_endTime", 0, [0]], | ||
["_poly", [], [[]]] | ||
]; | ||
if (CBA_missionTime >= _endTime) exitWith { | ||
[_handle] call CBA_fnc_removePerFrameHandler; | ||
}; | ||
|
||
{ // show the honked_at "danger zone" in front of the vehicle | ||
private _from = _poly select _forEachIndex; | ||
private _to = _poly select ((_forEachIndex + 1) mod (count _poly)); | ||
drawLine3D [_from, _to, [1, 0.3, 0.5, 1]]; | ||
} forEach _poly; | ||
}, | ||
0, | ||
[CBA_missionTime + 3, _this] | ||
] call CBA_fnc_addPerFrameHandler; | ||
}] call CBA_fnc_addEventHandler; |
Oops, something went wrong.