Skip to content

Commit

Permalink
Merge pull request #1520 from shukari/patch-2
Browse files Browse the repository at this point in the history
diagnostic - target watch variable is broadcasted to all
  • Loading branch information
commy2 committed Nov 11, 2021
2 parents d4b796f + 63fad66 commit 1f780ae
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/diagnostic/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (getMissionConfigValue ["EnableTargetDebug", 0] == 1 || {getNumber (configFil

missionNamespace setVariable [_varName, [_statementText, _returnString, _duration]];
if (_clientID != CBA_clientID) then {
publicVariable _varName; // send back over network
_clientID publicVariableClient _varName; // send back over network
};
}] call CBA_fnc_addEventHandler;

Expand Down
2 changes: 1 addition & 1 deletion addons/diagnostic/fnc_initTargetDebugConsole.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private _fnc_updateWatchInfo = {
missionNamespace setVariable [_varName, nil];
} else {
if ((_editText isEqualTo _responseStatement) && {_duration > 0.1}) exitWith {}; // don't re-run if statement that took a long time
if ((diag_tickTime - _lastSent) > random [0.1, 0.2, 0.3]) then {
if ((diag_tickTime - _lastSent) > random GVAR(watchInfoRefreshRateArray)) then {
_x set [3, diag_tickTime]; // set last run to now
[QGVAR(watchVariable), [CBA_clientID, _varIndex, _editText], GVAR(selectedClientID)] call CBA_fnc_ownerEvent; // send statement to target
};
Expand Down
12 changes: 12 additions & 0 deletions addons/diagnostic/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@
],
2
] call CBA_fnc_addSetting;

[
QGVAR(watchInfoRefreshRate), "SLIDER",
[LLSTRING(WatchInfoRefreshRate), LLSTRING(WatchInfoRefreshRateTooltip)],
[LELSTRING(main,DisplayName), LELSTRING(UI,Category)],
[0.2, 60, 0.2, 1],
1,
{
params ["_value"];
GVAR(watchInfoRefreshRateArray) = [_value - 0.1, _value, _value + 0.1];
}
] call CBA_fnc_addSetting;
6 changes: 6 additions & 0 deletions addons/diagnostic/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@
<French>Type d'indentation qui peut être employée dans la console de débogage.\nTab ajoute une indentation, et Shift + Tab en supprime une.</French>
<Spanish>Tipo de sangría que se puede agregar a la expresión en la consola de depuración presionando la tecla Tab o eliminar presionando Shift + Tab</Spanish>
</Key>
<Key ID="STR_CBA_Diagnostic_WatchInfoRefreshRate">
<English>Refresh rate target watcher field</English>
</Key>
<Key ID="STR_CBA_Diagnostic_WatchInfoRefreshRateTooltip">
<English>Refresh rate (in seconds) for the CBA target watcher fields to the right of the debug console.</English>
</Key>
<Key ID="STR_CBA_Diagnostic_ConsoleIndentSpaces">
<English>4 Spaces</English>
<Polish>4 Spacje</Polish>
Expand Down

0 comments on commit 1f780ae

Please sign in to comment.