#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;