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

67 lines
1.5 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Handles the delivery timer and locker updates for purchased items
*
* Arguments:
* 0: New Locker Contents <ARRAY>
*
* Returns:
* None
*
* Example:
* [_newLocker] spawn forge_store_fnc_handleDelivery
*
* Public: No
*/
params [["_newLocker", [], [[]]]];
private _deliveryTime = ["DT", 0] call BIS_fnc_getParamValue;
if (_newLocker isEqualTo []) exitWith {};
if (_deliveryTime > 0) then {
[
format [
"<t align='left'>Order Processing</t><br/><t size='0.8' align='left'>Estimated delivery: %1</t>",
[_deliveryTime, "MM:SS"] call BIS_fnc_secondsToString
],
"info",
3,
"right"
] call EFUNC(misc,notify);
uiSleep (_deliveryTime / 2);
[
"<t align='left'>Package in transit</t>",
"warning",
2,
"left"
] call EFUNC(misc,notify);
uiSleep (_deliveryTime / 2);
SETPVAR(player,FORGE_Locker,_newLocker);
[
"<t align='left'>Order Delivered!</t><br/><t size='0.8' align='left'>Check your locker</t>",
"success",
5,
"left"
] call EFUNC(misc,notify);
if (hasInterface) then { playSound "FD_Finish_F"; };
} else {
SETPVAR(player,FORGE_Locker,_newLocker);
[
"<t align='left'>Order Complete!</t><br/><t size='0.8' align='left'>Items added to locker</t>",
"success",
5,
"left"
] call EFUNC(misc,notify);
if (hasInterface) then { playSound "FD_Finish_F"; };
};