VN_fnc_whitelisted_arsenal_templateOkButton

From Savage Game Design Wiki
Revision as of 12:47, 16 September 2019 by vn>Unknown user (Generated by LM_exportFunctionsToWiki.sqf)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
← back to Functions Introduced in S.O.G. Prairie Fire v1.00
Argument(s): n/a
Effect(s): unknown

Description

/*
        FILE: fn_whitelisted_arsenal_templateokbutton.sqf
        DATE: 10-06-2019
        AUTHOR: Ethan Johnson

        DESCRIPTION:
                Takes over the confirm button for the loadouts and can do custom things on save/load.
        PARAMETERS:
                (0): DISPLAY - Display for the arsenal.
        RETURNS:
                NONE
*/

params ["_display"];
private _center = (missionNamespace getVariable ["BIS_fnc_arsenal_center",player]);
private _hidetemplate = true;
private _notification = "";

private _ctrlTemplateName = _display displayCtrl IDC_RSCDISPLAYARSENAL_TEMPLATE_EDITNAME;
if (ctrlEnabled _ctrlTemplateName) then
{
        [
		_center,
		[profileNamespace,ctrlText _ctrlTemplateName],
		[
			_center getVariable ["BIS_fnc_arsenal_face",face _center],
			speaker _center,
			_center call BIS_fnc_getUnitInsignia
		]
	] call BIS_fnc_saveInventory;
        ['showTemplates',[_display]] call (uinamespace getvariable (["bis_fnc_arsenal","bis_fnc_garage"] select BIS_fnc_arsenal_type));
}
else
{
        private _ctrltemplate =  _display displayCtrl IDC_RSCDISPLAYARSENAL_TEMPLATE_VALUENAME;
	if ((_ctrltemplate lbValue lnbCurSelRow _ctrltemplate) >= 0) then
        {
                private _inventory = _ctrltemplate lnbText [lnbCurSelRow _ctrltemplate,0];
                private _alloweditems = missionNamespace getVariable ["vn_whitelisted_arsenal_alloweditems",[]];
		_notification = [_center,[profileNamespace,_inventory], _alloweditems] call vn_fnc_whitelisted_arsenal_loadinventory;

		//--- Load custom data
		_ctrltemplate = _display displayCtrl IDC_RSCDISPLAYARSENAL_TEMPLATE_VALUENAME;
		_data = profileNamespace getVariable ["bis_fnc_saveInventory_data",[]];
		_name = _ctrltemplate lnbText [lnbCurSelRow _ctrltemplate,0];
		_nameID = _data find _name;
		if (_nameID >= 0) then
                {
			_inventory = _data select (_nameID + 1);
			_inventoryCustom = _inventory select 10;
			if ((count _inventoryCustom) isEqualTo 3) then
                        {
                                _inventoryCustom params [["_face","",[""]],["_speaker","",[""]],["_insignia","",[""]]];
				_center setFace _face;
				_center setVariable ["BIS_fnc_arsenal_face",_face];
				_center setSpeaker _speaker;
				[_center,_insignia] call BIS_fnc_setUnitInsignia;
			};
		};
		["ListSelectCurrent",[_display]] call BIS_fnc_arsenal;
	}
        else
        {
		_hideTemplate = false;
	};
};



if (_hideTemplate) then
{
        if !(_notification isEqualTo "") then
        {
                [_display,_notification] spawn
                {
                        params ["_display","_notification"];
                        ['showMessage',[_display,localize "STR_VN_WA_FEEDBACK_ARSENAL_LOADOUT_ITEMS_RESTRICTED"]] call bis_fnc_arsenal;
                        [_notification, localize "STR_VN_WA_FEEDBACK_ARSENAL_LOADOUT_ITEMS_WARNING", localize "STR_VN_WA_FEEDBACK_ARSENAL_LOADOUT_ITEMS_CONTINUE", false, _display, false, false] call BIS_fnc_guiMessage;
                };
        };
};
(Placeholder description extracted from the function header by LM_exportFunctionsToWiki.sqf)

Syntax

Syntax
[] call VN_fnc_whitelisted_arsenal_templateokbutton;
Return value
Nothing

Examples

Example 1
-