client/addons/store/functions/fnc_changePayment.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

28 lines
731 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Changes the payment method of the store
*
* Arguments:
* 0: Control <CONTROL> - The control that was changed
* 1: Selected Index <NUMBER> - The index of the selected item
*
* Return Value:
* None
*
* Example:
* [_paymentList, 0] call forge_store_fnc_changePayment
*
* Public: No
*/
params ["_control", "_selectedIndex"];
private _display = ctrlParent _control;
private _selectedPayment = _control lbData _selectedIndex;
private _selectedPaymentTitle = _control lbText _selectedIndex;
[format ["You have selected %1 as your payment method.", _selectedPaymentTitle], "info", 3, "right"] call EFUNC(misc,notify);
GVAR(activePayment) = _selectedPayment;