Im Heutigen Stream habe ich dies hier fertig gestellt.
Wenn ihr nicht genug Geld auf der Hand habt ist es Rot, wenn ihr genug habt Grün. Logisch oder?
Ihr könnt es gerne benutzten. Schaut doch gerne mal vorbei und last ein follow da um Zukünftig nichts zu verpassen! https://www.twitch.tv/theriskarma
Ersetzt einfach jede Datei.
fn_clothingFiler.sqf
Spoiler anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_clothingFilter.sqf
Author: Bryan "Tonic" Boardwine
Description:
Functionality for filtering clothing types in the menu.
*/
disableSerialization;
params [
"", //Control
["_selection", 0, [0]]
];
life_clothing_filter = _selection;
switch (_selection) do {
case 4: {
life_shop_cam camSetTarget (player modelToWorld [0,-.15,1.3]);
life_shop_cam camSetPos (player modelToWorld [1,-4,2]);
life_shop_cam camCommit 1;
};
case 0: {
life_shop_cam camSetTarget (player modelToWorld [0,0,1]);
life_shop_cam camSetPos (player modelToWorld [1,4,2]);
life_shop_cam camCommit 1;
};
case 3: {
life_shop_cam camSetTarget (player modelToWorld [0,0,1.4]);
life_shop_cam camSetPos (player modelToWorld [-.1,2,1.4]);
life_shop_cam camCommit 1;
};
default {
life_shop_cam camSetTarget (player modelToWorld [0,0,1.6]);
life_shop_cam camSetPos (player modelToWorld [-.5,1,1.6]);
life_shop_cam camCommit 1;
};
};
if (isNull (findDisplay 3100)) exitWith {};
private _list = CONTROL(3100,3101);
private _idcItemlist = 1;
lbClear _list;
private _configArray = switch (_selection) do {
case 0: {M_CONFIG(getArray,"Clothing",life_clothing_store,"uniforms");};
case 1: {M_CONFIG(getArray,"Clothing",life_clothing_store,"headgear");};
case 2: {M_CONFIG(getArray,"Clothing",life_clothing_store,"goggles");};
case 3: {M_CONFIG(getArray,"Clothing",life_clothing_store,"vests");};
case 4: {M_CONFIG(getArray,"Clothing",life_clothing_store,"backpacks");};
};
private "_pic";
private "_details";
{
_x params [
["_className", "NONE", [""]],
["_displayName", "", [""]],
["_price", 1000, [0]]
];
if !(_className isEqualTo "NONE") then {
_details = [_className] call life_fnc_fetchCfgDetails;
_pic = (_details select 2);
};
if ([_x] call life_fnc_levelCheck) then {
if (isNil "_details") then {
_list lbAdd _displayName;
_list lbSetData [(lbSize _list)-1,_className];
} else {
if (_displayName isEqualTo "") then {
_list lbAdd (_details select 1);
} else {
_list lbAdd _displayName;
};
_list lbSetData [(lbSize _list)-1,_className];
_list lbSetValue [(lbSize _list)-1,_price];
_list lbSetPicture [(lbSize _list)-1,_pic];
if (_price <= life_cash) then {
lbSetColor [3101, _idcItemlist, [0.039,0.722,0.027,1]];
}else{
lbSetColor [3101, _idcItemlist, [0.812,0.039,0.039,1]];
};
_idcItemlist = _idcItemlist + 1;
};
};
true
} count _configArray;
Alles anzeigen
fn_vehicleShopMenu.sqf
Spoiler anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_vehicleShopMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Blah
*/
(_this select 3) params [
["_shop","",[""]],
["_sideCheck",sideUnknown,[civilian]],
["_spawnPoints","",["",[]]],
["_shopFlag","",[""]],
["_shopTitle","",[""]],
["_disableBuy",false,[true]]
];
private _buyMultiplier = 0;
private _price = 0;
private _idcItemlist = 0;
switch (playerSide) do {
case civilian: {
_buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN");
};
case west: {
_buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP");
};
case independent: {
_buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC");
};
case east: {
_buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR");
};
};
disableSerialization;
//Long boring series of checks
if (dialog) exitWith {};
if (_shop isEqualTo "") exitWith {};
if (!(_sideCheck isEqualTo sideUnknown) && {!(playerSide isEqualTo _sideCheck)}) exitWith {hint localize "STR_Shop_Veh_NotAllowed"};
private _conditions = M_CONFIG(getText,"CarShops",_shop,"conditions");
if !([_conditions] call life_fnc_levelCheck) exitWith {hint localize "STR_Shop_Veh_NotAllowed"};
if (LIFE_SETTINGS(getNumber,"vehicleShop_3D") isEqualTo 1) then {
createDialog "Life_Vehicle_Shop_v2_3D";
} else {
createDialog "Life_Vehicle_Shop_v2";
};
life_veh_shop = [_shop,_spawnpoints,_shopFlag,_disableBuy]; //Store it so so other parts of the system can access it.
ctrlSetText [2301,_shopTitle];
if (_disableBuy) then {
//Disable the buy button.
ctrlEnable [2309,false];
};
//Fetch the shop config.
_vehicleList = M_CONFIG(getArray,"CarShops",_shop,"vehicles");
private _control = CONTROL(2300,2302);
lbClear _control; //Flush the list.
ctrlShow [2330,false];
ctrlShow [2304,false];
//Loop through
{
_x params["_className"];
private _toShow = [_x] call life_fnc_levelCheck;
if (_toShow) then {
_vehicleInfo = [_className] call life_fnc_fetchVehInfo;
_control lbAdd (_vehicleInfo select 3);
_control lbSetPicture [(lbSize _control)-1,(_vehicleInfo select 2)];
_control lbSetData [(lbSize _control)-1,_className];
_control lbSetValue [(lbSize _control)-1,_forEachIndex];
_initalPrice = M_CONFIG(getNumber,"LifeCfgVehicles",_className,"price");
_price = round(_initalPrice * _buyMultiplier);
if (_price <= life_cash) then {
lbSetColor [2302, _idcItemlist, [0.039,0.722,0.027,1]];
}else{
lbSetColor [2302, _idcItemlist, [0.812,0.039,0.039,1]];
};
};
_idcItemlist = _idcItemlist + 1;
} forEach _vehicleList;
((findDisplay 2300) displayCtrl 2302) lbSetCurSel 0;
Alles anzeigen
fn_virt_update.sqf
Spoiler anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_virt_update.sqf
Author: Bryan "Tonic" Boardwine
Description:
Update and fill the virtual shop menu.
*/
disableSerialization;
//Setup control vars.
private _item_list = CONTROL(2400,2401);
private _gear_list = CONTROL(2400,2402);
private _idcItemlist = 0;
private _price = 0;
//Purge list
lbClear _item_list;
lbClear _gear_list;
if (!isClass(missionConfigFile >> "VirtualShops" >> life_shop_type)) exitWith {closeDialog 0; hint localize "STR_NOTF_ConfigDoesNotExist";}; //Make sure the entry exists..
ctrlSetText[2403,localize (M_CONFIG(getText,"VirtualShops",life_shop_type,"name"))];
private _shopItems = M_CONFIG(getArray,"VirtualShops",life_shop_type,"items");
{
if (getText(missionConfigFile >> "VirtualItems" >> _x >> "condition") isEqualTo "NONE" OR [life_currentExpPerks, getText(missionConfigFile >> "VirtualItems" >> _x >> "condition")] call mav_ttm_fnc_hasPerk) then{
_displayName = M_CONFIG(getText,"VirtualItems",_x,"displayName");
_price = M_CONFIG(getNumber,"VirtualItems",_x,"buyPrice");
_item_list lbAdd format ["%1 ($%2)",(localize _displayName),[_price] call life_fnc_numberText];
_item_list lbSetData [(lbSize _item_list)-1,_x];
_item_list lbSetValue [(lbSize _item_list)-1,_price];
_icon = M_CONFIG(getText,"VirtualItems",_x,"icon");
if !(_icon isEqualTo "") then {
_item_list lbSetPicture [(lbSize _item_list)-1,_icon];
};
if (_price <= life_cash) then {
lbSetColor [2401, _idcItemlist, [0.039,0.722,0.027,1]];
}else{
lbSetColor [2401, _idcItemlist, [0.812,0.039,0.039,1]];
};
};
_idcItemlist = _idcItemlist + 1;
} forEach _shopItems;
{
private _name = M_CONFIG(getText,"VirtualItems",_x,"displayName");
_val = ITEM_VALUE(_x);
if (_val > 0) then {
_gear_list lbAdd format ["%2 [x%1]",_val,(localize _name)];
_gear_list lbSetData [(lbSize _gear_list)-1,_x];
_icon = M_CONFIG(getText,"VirtualItems",_x,"icon");
if (!(_icon isEqualTo "")) then {
_gear_list lbSetPicture [(lbSize _gear_list)-1,_icon];
};
};
} forEach _shopItems;
Alles anzeigen
fn_weaponShopFilter.sqf
Spoiler anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_weaponShopFilter.sqf
Author: Bryan "Tonic" Boardwine
Edit: Added level checks - BoGuu
Description:
Applies the filter selected and changes the list.
*/
private _index = (lbCurSel 38402);
private _shop = uiNamespace getVariable ["Weapon_Shop",""];
private _idcItemlist = 0;
private _price = 0;
if (_index isEqualTo -1 || {_shop isEqualTo ""}) exitWith {systemChat "Bad Data Filter"; closeDialog 0;}; //Bad data passing.
uiNamespace setVariable ["Weapon_Shop_Filter",_index];
//Setup List Control & Purge it.
private _priceTag = ((findDisplay 38400) displayCtrl 38404);
_priceTag ctrlSetStructuredText parseText "";
private _itemList = ((findDisplay 38400) displayCtrl 38403);
lbClear _itemList;
private "_config";
if ((uiNamespace getVariable ["Weapon_Magazine",0]) isEqualTo 1 || {(uiNamespace getVariable ["Weapon_Accessories",0]) isEqualTo 1}) then {
if ((uiNamespace getVariable ["Weapon_Magazine",0]) isEqualTo 1) then {
_config = M_CONFIG(getArray,"WeaponShops",_shop,"mags");
{
_bool = [_x] call life_fnc_levelCheck;
if (_bool) then {
_x params ["_var"];
_count = {_x == _var} count (uiNamespace getVariable ["Magazine_Array",[]]);
if (_count > 0) then {
_itemInfo = [(_x select 0)] call life_fnc_fetchCfgDetails;
_itemList lbAdd format ["%1",if (!((_x select 1) isEqualTo "")) then {(_x select 1)} else {(_itemInfo select 1)}];
_itemList lbSetData[(lbSize _itemList)-1,(_itemInfo select 0)];
_itemList lbSetPicture[(lbSize _itemList)-1,(_itemInfo select 2)];
_itemList lbSetValue[(lbSize _itemList)-1,(_x select 2)];
//Buggy?
_price = _x select 2;
if (_price <= life_cash) then {
lbSetColor [38403, _idcItemlist, [0.039,0.722,0.027,1]];
}else{
lbSetColor [38403, _idcItemlist, [0.812,0.039,0.039,1]];
};
_idcItemlist = _idcItemlist + 1;
};
};
true
} count _config;
((findDisplay 38400) displayCtrl 38406) ctrlSetText localize "STR_Global_Weapons";
ctrlShow [38406,true];
ctrlShow [38407,false];
} else {
_config = M_CONFIG(getArray,"WeaponShops",_shop,"accs");
{
_bool = [_x] call life_fnc_levelCheck;
if (_bool) then {
_x params ["_var"];
_count = {_x == _var} count (uiNamespace getVariable ["Accessories_Array",[]]);
if (_count > 0) then {
_itemInfo = [(_x select 0)] call life_fnc_fetchCfgDetails;
_itemList lbAdd format ["%1",if (!((_x select 1) isEqualTo "")) then {(_x select 1)} else {(_itemInfo select 1)}];
_itemList lbSetData[(lbSize _itemList)-1,(_itemInfo select 0)];
_itemList lbSetPicture[(lbSize _itemList)-1,(_itemInfo select 2)];
_itemList lbSetValue[(lbSize _itemList)-1,(_x select 2)];
_price = _x select 2;
if (_price <= life_cash) then {
lbSetColor [38403, _idcItemlist, [0.039,0.722,0.027,1]];
}else{
lbSetColor [38403, _idcItemlist, [0.812,0.039,0.039,1]];
};
_idcItemlist = _idcItemlist + 1;
};
};
true
} count _config;
((findDisplay 38400) displayCtrl 38407) ctrlSetText localize "STR_Global_Weapons";
ctrlShow [38406,false];
ctrlShow [38407,true];
};
((findDisplay 38400) displayCtrl 38405) ctrlSetText localize "STR_Global_Buy";
ctrlShow [38402,false];
} else {
switch (_index) do {
case 0: {
_config = M_CONFIG(getArray,"WeaponShops",_shop,"items");
{
_bool = [_x] call life_fnc_levelCheck;
if (_bool) then {
_itemInfo = [_x select 0] call life_fnc_fetchCfgDetails;
_itemList lbAdd format ["%1",if (!((_x select 1) isEqualTo "")) then {_x select 1} else {_itemInfo select 1}];
_itemList lbSetData[(lbSize _itemList)-1,_itemInfo select 0];
_itemList lbSetPicture[(lbSize _itemList)-1,_itemInfo select 2];
_itemList lbSetValue[(lbSize _itemList)-1,_x select 2];
_price = _x select 2;
if (_price <= life_cash) then {
lbSetColor [38403, _idcItemlist, [0.039,0.722,0.027,1]];
}else{
lbSetColor [38403, _idcItemlist, [0.812,0.039,0.039,1]];
};
_idcItemlist = _idcItemlist + 1;
};
true
} count _config;
((findDisplay 38400) displayCtrl 38405) ctrlSetText localize "STR_Global_Buy";
((findDisplay 38400) displayCtrl 38406) ctrlSetText localize "STR_Global_Mags";
((findDisplay 38400) displayCtrl 38407) ctrlSetText localize "STR_Global_Accs";
ctrlShow [38402,true];
ctrlShow [38406,true];
ctrlShow [38407,true];
};
case 1: {
_config = [];
private _listedItems = [];
//Go through weapons
if (primaryWeapon player != "") then {_config pushBack primaryWeapon player;};
if (secondaryWeapon player != "") then {_config pushBack secondaryWeapon player;};
if (handgunWeapon player != "") then {_config pushBack handgunWeapon player;};
//Go through items
_config = _config + primaryWeaponItems player;
_config = _config + (assignedItems player);
_config = _config + (uniformItems player);
_config = _config + (vestItems player);
_config = _config + (backpackItems player);
((findDisplay 38400) displayCtrl 38405) ctrlSetText localize "STR_Global_Sell";
ctrlShow [38402,true];
ctrlShow [38406,false];
ctrlShow [38407,false];
private _itemArray = [];
_itemArray pushBack M_CONFIG(getArray,"WeaponShops",_shop,"items");
_itemArray pushBack M_CONFIG(getArray,"WeaponShops",_shop,"mags");
_itemArray pushBack M_CONFIG(getArray,"WeaponShops",_shop,"accs");
{
_y = _x;
{
if (!(_x in _listedItems) && _x != "") then {
_iS = [_x,_y] call TON_fnc_index;
if !(_iS isEqualTo -1) then {
_z = _y select _iS;
if (!((_z select 3) isEqualTo -1)) then {
_bool = [_z] call life_fnc_levelCheck;
if (_bool) then {
_itemInfo = [_x] call life_fnc_fetchCfgDetails;
_listedItems pushBack _x;
_itemCount = {_x == (_itemInfo select 0)} count _config;
if (_itemCount > 1) then {
_itemList lbAdd format ["[%2] %1",_itemInfo select 1,_itemCount];
} else {
_itemList lbAdd format ["%1",_itemInfo select 1];
};
_itemList lbSetData[(lbSize _itemList)-1,_itemInfo select 0];
_itemList lbSetPicture[(lbSize _itemList)-1,_itemInfo select 2];
};
};
};
};
true
} count _config;
true
} count _itemArray;
};
};
};
((findDisplay 38400) displayCtrl 38403) lbSetCurSel 0;
Alles anzeigen