Difference between revisions of "VN fnc whitelisted arsenal lbColor"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Text replacement - "]]; |p1n=" to "]] |p1n=")
(Page filling)
Line 1: Line 1:
[[Category:TODO]]
 
 
{{Function
 
{{Function
  
Line 6: Line 5:
 
|author= Ethan Johnson
 
|author= Ethan Johnson
  
|a=
+
|a= local
  
|e=
+
|e= local
  
 
|g1= whitelisted_arsenal_functions
 
|g1= whitelisted_arsenal_functions
  
|d= <pre>/*
+
|d= Color codes loadouts in the arsenal based on the availability of the items inside them.
        FILE: fn_whitelisted_arsenal_lbcolor.sqf
 
        DATE: 10-06-2019
 
        AUTHOR: Ethan Johnson
 
  
        DESCRIPTION:
+
|s= [display] call [[VN_fnc_whitelisted_arsenal_lbColor]]
                Color codes loadouts in the arsenal based on the availability of the items inside them.
 
        PARAMETERS:
 
                (0): DISPLAY - Arsenal display that should be used for messages, gui etc.
 
        RETURNS:
 
                NONE
 
*/
 
  
params ["_display"];
+
|p1n= display
 
+
|p1t= display
if !(ctrlText (_display displayCtrl IDC_RSCDISPLAYARSENAL_TEMPLATE_TITLE) isEqualTo "Load") exitWith {};
+
|p1d= Arsenal display that should be used for messages, gui etc.
 
 
private _templatevalues = _display displayCtrl IDC_RSCDISPLAYARSENAL_TEMPLATE_VALUENAME;
 
private _loadoutdata = profileNamespace getVariable ["bis_fnc_saveInventory_data",[]];
 
 
 
['showMessage',[_display,localize "STR_VN_WA_FEEDBACK_ARSENAL_LOADOUT_BLACKLIST"]] call bis_fnc_arsenal;
 
 
 
private _alloweditems = ([""] + (missionNamespace getVariable ["vn_whitelisted_arsenal_alloweditems",[]]));
 
 
 
for "_i" from 0 to (count _loadoutdata - 1) step 2 do
 
{
 
private _name = _loadoutdata select _i;
 
private _data = _loadoutdata select (_i + 1);
 
        private _allowed = true;
 
 
 
        _data params ["_uniformdata","_vestdata","_backpackdata","_headgeardata","_gogglesdata","_binoculardata","_primarydata","_secondarydata","_handgundata","_assigneddata"];
 
 
 
        {
 
                private _type = _x;
 
 
 
                switch (true) do
 
                {
 
                        case (_type isEqualType ""):
 
                        {
 
if !(_type in _alloweditems) then
 
{
 
_allowed = false;
 
};
 
                        };
 
                        case (_type isEqualType []):
 
                        {
 
                                {
 
                                        private _item = _x;
 
if (_item isEqualType []) then
 
{
 
{
 
if !(_x in _alloweditems) then
 
                                {
 
                                        _allowed = false;
 
                                };
 
} foreach _item;
 
}
 
else
 
{
 
if !(_item in _alloweditems) then
 
                                        {
 
                                                _allowed = false;
 
                                        };
 
};
 
                                }foreach _type;
 
                        };
 
                };
 
        }foreach [_uniformdata,_vestdata,_backpackdata,_headgeardata,_googlesdata,_binoculardata,_primarydata,_secondarydata,_handgundata];
 
private _color = [[0.867,0.369,0.031,1],[1,1,1,1]] select _allowed;
 
 
 
for "_i" from 0 to (( lnbSize _templatevalues ) select 0 ) - 1 do
 
{
 
if (_templatevalues lnbText [ _i, 0 ] isEqualTo _name) then
 
{
 
_templatevalues lnbSetColor [[ _i, 0 ], _color];
 
_templatevalues lbSetValue [_i, 1];
 
};
 
};
 
};
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
 
 
|s= [] call [[VN_fnc_whitelisted_arsenal_lbcolor]]
 
 
 
|p1n=
 
|p1t=
 
|p1d=
 
 
|p1v=
 
|p1v=
  
Line 108: Line 28:
 
|r1d=
 
|r1d=
  
|x1= <code>-</code>
+
|x1= <code>[_arsenalDisplay] call [[VN_fnc_whitelisted_arsenal_lbColor]];</code>
 
}}
 
}}

Revision as of 22:53, 25 February 2021

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

Description

Color codes loadouts in the arsenal based on the availability of the items inside them.

Syntax

Syntax
[display] call VN_fnc_whitelisted_arsenal_lbColor
Parameters
display: Display - Arsenal display that should be used for messages, gui etc.
Return value
Nothing

Examples

Example 1
[_arsenalDisplay] call VN_fnc_whitelisted_arsenal_lbColor;