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

Return target exec result back to executor #1299

Merged
merged 3 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -29,7 +29,7 @@ if (getMissionConfigValue ["EnableTargetDebug", 0] == 1 || {getNumber (configFil
private _returnString = _statementText call {
private ["_clientID", "_statementText", "_varName", "_timeStart", "_x"]; // prevent these variables from being overwritten
_this = ([nil] apply compile _this) select 0;
if (isNil "_this") exitWith {"#NIL"};
if (isNil "_this") exitWith {"<any>"};
str _this
};
_returnString = _returnString select [0, 1000]; // limit string length
Expand Down
6 changes: 5 additions & 1 deletion addons/diagnostic/fnc_initTargetDebugConsole.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Author:
---------------------------------------------------------------------------- */

#define COUNT_WATCH_BOXES 8
#define EXEC_RESULT ([nil] apply {[] call _this} param [0, text "<any>"])
commy2 marked this conversation as resolved.
Show resolved Hide resolved
#define EXEC_RESULT_CTRL (parsingNamespace getVariable ["BIS_RscDebugConsoleExpressionResultCtrl", controlNull])
#define EXEC_SEND_RESULT {[EXEC_RESULT, {EXEC_RESULT_CTRL ctrlSetText str _this}] remoteExec ["call", remoteExecutedOwner]}

if !(getMissionConfigValue ["EnableTargetDebug", 0] == 1 || {getNumber (configFile >> "EnableTargetDebug") == 1}) exitWith {};

Expand Down Expand Up @@ -88,7 +91,8 @@ _targetExec ctrlSetText toUpper LLSTRING(TargetExec);
_targetExec ctrlAddEventHandler ["ButtonClick", {
params ["_targetExec"];
private _statement = ctrlText (ctrlParentControlsGroup _targetExec controlsGroupCtrl IDC_RSCDEBUGCONSOLE_EXPRESSION);
compile _statement remoteExec ["call", GVAR(selectedClientID)];

[compile _statement, EXEC_SEND_RESULT] remoteExec ["call", GVAR(selectedClientID)];
}];

_targetExec ctrlAddEventHandler ["MouseButtonUp", {
Expand Down