Difference between revisions of "VN fnc whitelisted arsenal templateOkButton"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Text replacement - " |a= " to " |author= ")
(Page filling)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
 
{{Function
 
{{Function
  
Line 6: Line 5:
 
|author= Ethan Johnson
 
|author= Ethan Johnson
  
|e=
+
|a= local
 +
 
 +
|e= local
  
 
|g1= whitelisted_arsenal_functions
 
|g1= whitelisted_arsenal_functions
  
|d= <pre>/*
+
|d= Takes over the confirm button for the loadouts and can do custom things on save/load.
        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;
 
                };
 
        };
 
};
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
  
|s= [] call [[VN_fnc_whitelisted_arsenal_templateokbutton]];
+
|s= [display] call [[VN_fnc_whitelisted_arsenal_templateOkButton]]
  
|p1n=
+
|p1n= display
|p1t=
+
|p1t= display
|p1d=
+
|p1d= display for the Arsenal
 
|p1v=
 
|p1v=
  
Line 108: Line 28:
 
|r1d=
 
|r1d=
  
|x1= <code>-</code>
+
|x1= <code>[_display] call [[VN_fnc_whitelisted_arsenal_templateOkButton]];</code>
 
}}
 
}}

Latest revision as of 20:14, 26 February 2021

← back to Functions Introduced in S.O.G. Prairie Fire v1.00
by Ethan Johnson
Argument(s): local
Effect(s): local

Description

Takes over the confirm button for the loadouts and can do custom things on save/load.

Syntax

Syntax
[display] call VN_fnc_whitelisted_arsenal_templateOkButton
Parameters
display: Display - display for the Arsenal
Return value
Nothing

Examples

Example 1
[_display] call VN_fnc_whitelisted_arsenal_templateOkButton;