client/addons/interaction/functions/fnc_openInteraction.sqf
Jacob Schmidt d474b3676a
All checks were successful
Build / Build (push) Successful in 28s
Refactor: Standardize function descriptions and variable handling
This commit refactors several client-side functions to improve code consistency and readability.

- Standardizes function descriptions by removing redundant "Function: forge_client..." prefixes and "[Description]" sections, focusing on concise descriptions of the function's purpose.
- Updates variable handling in arsenal functions to use GVAR and EGVARS for default values, improving consistency and reducing code duplication.
- Removes the bank init function as it is no longer needed.
- Adds a done variable to the preinit file.
2025-05-25 11:30:26 -05:00

54 lines
968 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Open player interaction
*
* Arguments:
* N/A
*
* Return Value:
* N/A
*
* Examples:
* [] call forge_client_interaction_fnc_openInteraction;
*
* Public: Yes
*/
if (!isNull findDisplay 1014) exitWith {};
createDialog "RscInteraction";
{
ctrlShow [_x, false];
} forEach FORGE_InteractionButtons;
private _index1 = 0;
FORGE_CurrentActionArray = [];
{
private _cArray = _x select 0;
private _cTrue = true;
for "_i" from 0 to ((count _cArray) - 1) step 1 do {
_c = call compile (_cArray select _i);
if (!_c) then {
_cTrue = false;
};
};
if (_cTrue) then {
if (_index1 < 9) then {
private _idc = 1600 + _index1;
_index1 = _index1 + 1;
private _text = (_x select 1) select 0;
private _action = (_x select 1) select 1;
ctrlShow [_idc, true];
ctrlSetText [_idc, _text];
FORGE_CurrentActionArray pushBack _action;
};
};
} forEach FORGE_InteractionItems;