Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostic - Optimize target watch variable broadcast #1520

Merged
merged 6 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>Sets the refresh rate in seconds for the CBA target watcher fields to the right of the debug console</English>
shukari marked this conversation as resolved.
Show resolved Hide resolved
</Key>
<Key ID="STR_CBA_Diagnostic_ConsoleIndentSpaces">
<English>4 Spaces</English>
<Polish>4 Spacje</Polish>
Expand Down