if !(_allMaterial) exitWith {hint (["STR_DONT_HAVE_ALL_ITEMS","Max_Settings_Craft","Craft_Localization"] call theprogrammer_core_fnc_localize);};
while {_allMaterial} do {
waitUntil {uiSleep 1; ((_workbench getVariable ["craft_in_progress",[]]) isEqualTo [])};
{
_ctrl = _x select 0;
_num = _x select 1;
_data = (_workbench getVariable ["workbench_inventory",[[],0]]) select 0;
_index = [_ctrl,_data] call max_craft_fnc_index;
if (_index isEqualTo -1) exitWith...
if !(_allMaterial) exitWith {hint (["STR_DONT_HAVE_ALL_ITEMS","Max_Settings_Craft","Craft_Localization"] call theprogrammer_core_fnc_localize);};
while {_allMaterial} do {
waitUntil {uiSleep 1; ((_workbench getVariable ["craft_in_progress",[]]) isEqualTo [])};
{
_ctrl = _x select 0;
_num = _x select 1;
_data = (_workbench getVariable ["workbench_inventory",[[],0]]) select 0;
_index = [_ctrl,_data] call max_craft_fnc_index;
if (_index isEqualTo -1) exitWith {_allMaterial = false;};
_value = (_data select _index) select 1;
if (_num > _value) exitWith {_allMaterial = false;};
} forEach (getArray (_config >> "itemsRequired"));
if !(_allMaterial) exitWith {};
};