mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
528
SQF/dayz_code/BIS_scripts/handleGear.sqf
Normal file
528
SQF/dayz_code/BIS_scripts/handleGear.sqf
Normal file
@@ -0,0 +1,528 @@
|
||||
disableSerialization;
|
||||
private ["_control","_display","_temp","_event","_data","_x","_stopTheKey","_keyLeft","_i","_index","_size","_indices","_lbcontrol"];
|
||||
private ["_key","_keyRight","_keyTop","_keyBottom","_secondColumn","_activateControl","_output","_doFilter"];
|
||||
private ["_event","_data","_display","_control","_primaryWeaponControl","_IDCsArray","_lbIDC","_lbColumn","_sum"];
|
||||
/*
|
||||
IGUI_GEAR_filterPrimaryWeapon = (_activeFilter select 0);
|
||||
IGUI_GEAR_filterSecondaryWeapon = (_activeFilter select 1);
|
||||
IGUI_GEAR_filterAmmo = (_activeFilter select 2);
|
||||
IGUI_GEAR_filterBinocular = (_activeFilter select 3);
|
||||
IGUI_GEAR_filterInventory = (_activeFilter select 4);
|
||||
IGUI_GEAR_filterPistols = (_activeFilter select 5);
|
||||
IGUI_GEAR_filterPistolAmmo = (_activeFilter select 6); */
|
||||
|
||||
_filterSets = [
|
||||
//Primary Weapon, Secondary weapon, Ammo, Binocular, Inventory, Pistols, Pistols Ammo
|
||||
[false,false,false,false,false,false,false],
|
||||
[false,true,false,true,true,true,true],
|
||||
[true,false,false,true,true,true,true],
|
||||
[true,true,true,false,false,true,true], // all but pistol, pistols ammo
|
||||
[true,true,true,true,true,true,true]
|
||||
];
|
||||
|
||||
_icons = [
|
||||
"\ca\ui\data\igui_buyUnit_filter_1_ca.paa",
|
||||
"\ca\ui\data\igui_buyUnit_filter_2_ca.paa",
|
||||
"\ca\ui\data\igui_buyUnit_filter_3_ca.paa",
|
||||
"\ca\ui\data\igui_buyUnit_filter_4_ca.paa",
|
||||
"\ca\ui\data\igui_buyUnit_filter_5_ca.paa"
|
||||
];
|
||||
|
||||
_event = _this select 1;
|
||||
_data = _this select 0;
|
||||
|
||||
_dofilter = false;
|
||||
|
||||
/*-------------------------------------------*/
|
||||
if(typeName(_data select 0) == "DISPLAY")then
|
||||
{
|
||||
_display = (_data select 0);
|
||||
};
|
||||
|
||||
if(typeName(_data select 0) == "CONTROL")then
|
||||
{
|
||||
_control = (_data select 0);
|
||||
_display = ctrlParent _control;
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------*/
|
||||
_lbSelectedItem = {
|
||||
private ["_index","_selectedItem","_n"];
|
||||
_lbcontrol = _display displayctrl _lbIDC;
|
||||
_index = lbCurSel _lbcontrol;
|
||||
_selectedItem = "";
|
||||
_n = 0;
|
||||
|
||||
while {(_selectedItem == "")&&(_n<6)} do {
|
||||
_selectedItem = _lbcontrol lnbData [_index,1];
|
||||
uisleep 0.001;
|
||||
_n = _n + 1;
|
||||
};
|
||||
|
||||
_selectedItem;
|
||||
};
|
||||
|
||||
_arrowsEnable = {
|
||||
private ["_index","_selectedItem"];
|
||||
|
||||
_lbcontrol = _display displayctrl _lbIDC;
|
||||
|
||||
_controlLeftArrow = _display displayctrl 147;
|
||||
_controlRightArrow = _display displayctrl 146;
|
||||
_index = lbCurSel _lbcontrol;
|
||||
_selectedItemCountLeft = _lbcontrol lnbText [_index,0];
|
||||
_selectedItemCountRight = _lbcontrol lnbText [_index,2];
|
||||
};
|
||||
|
||||
|
||||
_isWeapon = {
|
||||
private ["_item","_return"];
|
||||
_item = _this select 0;
|
||||
_return = (str(configfile >> "cfgWeapons" >> _item) != "");
|
||||
_return;
|
||||
};
|
||||
|
||||
_isMagazine = {
|
||||
private ["_item","_return"];
|
||||
_item = _this select 0;
|
||||
_return = (str(configfile >> "cfgMagazines" >> _item) != "");
|
||||
_return;
|
||||
};
|
||||
|
||||
|
||||
_IDCsArray = [
|
||||
[107],
|
||||
[121],
|
||||
[108],
|
||||
[107],
|
||||
[122,123,124,125,126,127,128,129],
|
||||
[107],
|
||||
[107],
|
||||
[107],
|
||||
[109,110,111,112,113,114,115,116,117,118,119,120],
|
||||
[109,110,111,112,113,114,115,116,117,118,119,120],
|
||||
[108],
|
||||
[107],
|
||||
[130,131],
|
||||
[107],
|
||||
[107],
|
||||
[107],
|
||||
[107],
|
||||
[134,135,136,137,138,139,140,141,142,143,144,145],
|
||||
[107],
|
||||
[107],
|
||||
[107],
|
||||
[107]
|
||||
];
|
||||
|
||||
|
||||
_showAllIDCs = {
|
||||
private ["_slotArray","_j","_i"];
|
||||
for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do {
|
||||
_slotArray = _IDCsArray select _i;
|
||||
|
||||
for [{_j=0},{_j<count(_slotArray)}, {_j = _j + 1} ] do {
|
||||
_primaryWeaponControl = _display displayctrl (_slotArray select _j);
|
||||
_primaryWeaponControl ctrlSetFade 0.5;
|
||||
_primaryWeaponControl ctrlCommit 0.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_higlightIDCs = {
|
||||
private ["_slotArray","_j","_i"];
|
||||
for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do {
|
||||
_slotArray = _IDCsArray select _i;
|
||||
for [{_j=0},{_j<count(_slotArray)}, {_j = _j + 1} ] do {
|
||||
if (_selectedItemSlotIDCs find (_slotArray select _j)>-1 ) then {
|
||||
_itemSlot = _display displayctrl (_slotArray select _j);
|
||||
_itemSlot ctrlSetFade 0.0;
|
||||
_itemSlot ctrlCommit 0.3;
|
||||
|
||||
} else {
|
||||
_itemSlot = _display displayctrl (_slotArray select _j);
|
||||
_itemSlot ctrlSetFade 0.5;
|
||||
_itemSlot ctrlCommit 0.3;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/* for [{_i=0},{_i<count(_selectedItemSlotIDCs)}, {_i = _i + 1} ] do
|
||||
{
|
||||
_slotControl = _display displayctrl (_selectedItemSlotIDCs select _i);
|
||||
_slotControl ctrlSetFade 0;
|
||||
_slotControl ctrlCommit 0.3;
|
||||
}; */
|
||||
};
|
||||
_returnSlotIDCs = {
|
||||
_flags = (_this select 0);
|
||||
_outputArray = [];
|
||||
_sum = 0;
|
||||
for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do
|
||||
{
|
||||
_sum = _sum + (_flags select _i);
|
||||
if ((_flags select _i) == 1) then {
|
||||
_outputArray = _outputArray + (_IDCsArray select _i);
|
||||
|
||||
};
|
||||
};
|
||||
if (_sum == 0) then {
|
||||
_outputArray = (_IDCsArray select 2);
|
||||
};
|
||||
_outputArray;
|
||||
};
|
||||
_isPrimaryWeapon = {
|
||||
_flags = (_this select 0);
|
||||
if ( (_flags select 0) == 1) then {
|
||||
true;
|
||||
} else {
|
||||
false;
|
||||
};
|
||||
};
|
||||
|
||||
_isSecondaryWeapon = {
|
||||
_flags = (_this select 0);
|
||||
if ( (_flags select 0) == 1) then {
|
||||
true;
|
||||
} else {
|
||||
false;
|
||||
};
|
||||
};
|
||||
|
||||
_itemSlot = {
|
||||
private ["_item", "_return"];
|
||||
_item = _this select 0;
|
||||
_return = 0;
|
||||
if ([_item] call _isWeapon) then {
|
||||
_return = getNumber(configfile >> "cfgWeapons" >> _item >> "type");
|
||||
};
|
||||
if ([_item] call _isMagazine) then {
|
||||
_return = getNumber(configfile >> "cfgMagazines" >> _item >> "type");
|
||||
};
|
||||
_return;
|
||||
};
|
||||
|
||||
_highlightIDCs = {
|
||||
_hlIDCs = _this select 0;
|
||||
for [{_i=0},{_i<count(_hlIDCs)}, {_i = _i + 1} ] do {
|
||||
};
|
||||
};
|
||||
|
||||
_returnBitArray = {
|
||||
private ["_i","_bitArray","_valResult","_val","_n","_i"];
|
||||
_val = _this select 0;
|
||||
_bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
_n = 524288;
|
||||
for [{_i=19},{_i>=0}, {_i = _i - 1} ] do
|
||||
{
|
||||
|
||||
_valResult = _val mod _n;
|
||||
if (_valResult != _val) then {
|
||||
_bitArray set [_i, 1];
|
||||
};
|
||||
_n = _n / 2;
|
||||
_val = _valResult;
|
||||
};
|
||||
_bitArray
|
||||
};
|
||||
|
||||
_highlightGearSlots ={
|
||||
// [] call _showAllIDCs;
|
||||
_selectedItem = [] call _lbSelectedItem;
|
||||
_selectedItemSlot = [_selectedItem] call _itemSlot;
|
||||
_selectedItemSlotFlags = [_selectedItemSlot] call _returnBitArray;
|
||||
_selectedItemSlotIDCs = [_selectedItemSlotFlags] call _returnSlotIDCs;
|
||||
[_selectedItemSlotIDCs] call _higlightIDCs;
|
||||
};
|
||||
_weaponsLBSetFocus = {
|
||||
_lbcontrol = _display displayctrl _lbIDC;
|
||||
/** Temporary disabled to prevent bug news:hov5k4$f6f$1@new-server.localdomain **/
|
||||
//ctrlSetFocus _lbcontrol;
|
||||
};
|
||||
_setFilterIcon = {
|
||||
_ctrlIcon = _display displayctrl 148;
|
||||
_ctrlIcon ctrlSetText (_icons select IGUI_GEAR_activeFilter);
|
||||
};
|
||||
|
||||
|
||||
_keyActions = {
|
||||
_keyLeft = [203,327700,327686];
|
||||
_keyRight = [205,327696,327687];
|
||||
_keyTop = [200,327697,327684];
|
||||
_keyBottom = [208,327701,327685];
|
||||
_key = _data select 1;
|
||||
if((_keyLeft find _key)>=0)then {
|
||||
_control = _display displayctrl 146;
|
||||
ctrlActivate _control;
|
||||
_output = true;
|
||||
};
|
||||
if((_keyRight find _key)>=0)then {
|
||||
_control = _display displayctrl 147;
|
||||
ctrlActivate _control;
|
||||
_output = true;
|
||||
};
|
||||
if((_keyTop find _key)>=0)then {
|
||||
|
||||
};
|
||||
if((_keyBottom find _key)>=0)then {
|
||||
|
||||
};
|
||||
};
|
||||
//_bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
/*
|
||||
#define WeaponNoSlot 0 // dummy weapons
|
||||
#define WeaponSlotPrimary 1 // primary weapons
|
||||
#define WeaponSlotSecondary 4 // secondary weapons
|
||||
#define WeaponSlotHandGun 2 // HandGun
|
||||
#define WeaponSlotHandGunItem 16 // HandGun magazines
|
||||
#define WeaponSlotItem 256 // items
|
||||
#define WeaponSlotBinocular 4096 // binocular
|
||||
#define WeaponHardMounted 65536
|
||||
#define WeaponSlotInventory 131072 // inventory items
|
||||
*/
|
||||
|
||||
_setFilterGlobals = {
|
||||
_activeFilter = _this;
|
||||
IGUI_GEAR_filterPrimaryWeapon = (_activeFilter select 0);
|
||||
IGUI_GEAR_filterSecondaryWeapon = (_activeFilter select 1);
|
||||
IGUI_GEAR_filterAmmo = (_activeFilter select 2);
|
||||
IGUI_GEAR_filterBinocular = (_activeFilter select 3);
|
||||
IGUI_GEAR_filterInventory = (_activeFilter select 4);
|
||||
IGUI_GEAR_filterPistols = (_activeFilter select 5);
|
||||
IGUI_GEAR_filterPistolAmmo = (_activeFilter select 6);
|
||||
};
|
||||
|
||||
//1201
|
||||
_highlightFilterIcons = {
|
||||
for [{_i=0},{_i<6}, {_i = _i + 1} ] do
|
||||
{
|
||||
_control = _display displayctrl (1200 + _i);
|
||||
_control ctrlSetTextColor [0.6000,0.8392,0.4706,1.0];
|
||||
};
|
||||
_control = _display displayctrl (1200 + _this);
|
||||
_control ctrlSetTextColor [1,1,1,1];
|
||||
};
|
||||
|
||||
_matchesFilter = {
|
||||
private ["_itemValue","_itemBitArray"];
|
||||
_output = false;
|
||||
|
||||
_itemValue = _this select 0;
|
||||
_itemBitArray = [_itemValue] call _returnBitArray;
|
||||
|
||||
|
||||
if (_itemValue == 1 && IGUI_GEAR_filterPrimaryWeapon) then {
|
||||
_output = true;
|
||||
};
|
||||
|
||||
if (_itemValue == 5 && IGUI_GEAR_filterPrimaryWeapon) then {
|
||||
_output = true;
|
||||
|
||||
};
|
||||
|
||||
if (_itemValue == 4 && IGUI_GEAR_filterSecondaryWeapon) then {
|
||||
_output = true;
|
||||
};
|
||||
|
||||
if (_itemValue == 2 && IGUI_GEAR_filterPistols) then {
|
||||
_output = true;
|
||||
};
|
||||
if (_itemValue == 16 && IGUI_GEAR_filterPistolAmmo) then {
|
||||
_output = true;
|
||||
};
|
||||
|
||||
if (_itemValue == 131072 && IGUI_GEAR_filterInventory) then {
|
||||
_output = true;
|
||||
};
|
||||
|
||||
if (_itemValue == 512 && IGUI_GEAR_filterAmmo) then {
|
||||
_output = true;
|
||||
};
|
||||
if (_itemValue == 256 && IGUI_GEAR_filterAmmo) then {
|
||||
_output = true;
|
||||
};
|
||||
|
||||
if (_itemValue == 4096 && IGUI_GEAR_filterBinocular) then {
|
||||
_output = true;
|
||||
};
|
||||
_output;
|
||||
};
|
||||
|
||||
_filterItems = {
|
||||
private ["_n","_itemType"];
|
||||
_deleteIndexes = [];
|
||||
_lbcontrol = _display displayctrl _lbIDC;
|
||||
_n = (lnbSize _lbcontrol) select 0;
|
||||
_j = 0;
|
||||
for [{_i=_n},{_i>=0}, {_i = _i - 1} ] do
|
||||
{
|
||||
_item = _lbcontrol lnbData [_i,1];
|
||||
_itemType = [_item] call _itemSlot;
|
||||
|
||||
if ([_itemType] call _matchesFilter) then {
|
||||
_j = _j + 1;
|
||||
_deleteIndexes set [(_j-1), _i];
|
||||
};
|
||||
};
|
||||
LB_CTRL = _lbcontrol;
|
||||
{
|
||||
_lbcontrol lnbDeleteRow _x;
|
||||
} forEach _deleteIndexes;
|
||||
};
|
||||
|
||||
_itemPicture = {
|
||||
private ["_item"];
|
||||
_item = _this select 0;
|
||||
|
||||
_return = "";
|
||||
|
||||
if ([_item] call _isWeapon) then {
|
||||
_return = getText(configfile >> "cfgWeapons" >> _item >> "picture");
|
||||
};
|
||||
if ([_item] call _isMagazine) then {
|
||||
_return = getText(configfile >> "cfgMagazines" >> _item >> "picture");
|
||||
};
|
||||
_return;
|
||||
};
|
||||
|
||||
_itemDescription = {
|
||||
private ["_inputItem","_return"];
|
||||
_inputItem = _this select 0;
|
||||
_return = "";
|
||||
if ([_inputItem] call _isWeapon) then {
|
||||
_name = getText(configfile >> "cfgWeapons" >> _inputItem >> "descriptionShort");
|
||||
_return = (_name);
|
||||
};
|
||||
|
||||
if ([_inputItem] call _isMagazine) then {
|
||||
_name = getText(configfile >> "cfgMagazines" >> _inputItem >> "descriptionShort");
|
||||
_return = (_name);
|
||||
};
|
||||
_return;
|
||||
};
|
||||
|
||||
_itemName = {
|
||||
private ["_item"];
|
||||
_item = _this select 0;
|
||||
|
||||
_return = "";
|
||||
|
||||
if ([_item] call _isWeapon) then {
|
||||
_name = getText(configfile >> "cfgWeapons" >> _item >> "displayName");
|
||||
_return = ( _name);
|
||||
};
|
||||
|
||||
if ([_item] call _isMagazine) then {
|
||||
_name = getText(configfile >> "cfgMagazines" >> _item >> "displayName");
|
||||
_return = ( _name);
|
||||
};
|
||||
|
||||
_return;
|
||||
};
|
||||
_displayItemIcon = {
|
||||
private ["_selectedItem","_itemPicturePath"];
|
||||
_selectedItem = [] call _lbSelectedItem;
|
||||
_itemPicturePath = [_selectedItem] call _itemPicture;
|
||||
_pictureControl = _display displayctrl 1104;
|
||||
_pictureControl ctrlSetText _itemPicturePath;
|
||||
};
|
||||
|
||||
_displayItemDescription = {
|
||||
private ["_descriptionControl","_selectedItemDescription","_selectedItemN"];
|
||||
_selectedItemN = [] call _lbSelectedItem;
|
||||
_selectedItemDescription = [_selectedItemN] call _itemDescription;
|
||||
_descriptionControl = _display displayctrl 1106;
|
||||
|
||||
_descriptionControl ctrlSetStructuredText parseText(_selectedItemDescription);
|
||||
};
|
||||
|
||||
_displayItemName = {
|
||||
private ["_nameControl","_itemDescription"];
|
||||
_selectedItem = [] call _lbSelectedItem;
|
||||
_itemName = [_selectedItem] call _itemName;
|
||||
_nameControl = _display displayctrl 1101;
|
||||
_nameControl ctrlSetText _itemName;
|
||||
};
|
||||
|
||||
|
||||
_output = true;
|
||||
_lbIDC = 105;
|
||||
|
||||
|
||||
switch _event do {
|
||||
case "initDialog": {
|
||||
[] call _showAllIDCs;
|
||||
};
|
||||
case "onLoad": {
|
||||
[] call _weaponsLBSetFocus;
|
||||
[] call _arrowsEnable;
|
||||
[] call _displayItemIcon;
|
||||
[] call _displayItemName;
|
||||
[] call _displayItemDescription;
|
||||
[] call _showAllIDCs;
|
||||
//[] call _arrowsEnable;
|
||||
//[] call _highlightGearSlots;
|
||||
};
|
||||
|
||||
//used for buyUnits
|
||||
case "filter": {
|
||||
IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1;
|
||||
if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then {
|
||||
IGUI_GEAR_activeFilter = 0;
|
||||
};
|
||||
_doFilter = true;
|
||||
};
|
||||
|
||||
//changing IGUI_GEAR_activeFilter, but not filter picture (used for buyGear)
|
||||
case "filterNotSet": {
|
||||
IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1;
|
||||
if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then {
|
||||
IGUI_GEAR_activeFilter = 0;
|
||||
};
|
||||
//_doFilter = true;
|
||||
};
|
||||
|
||||
case "filter_left": {
|
||||
IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter - 1;
|
||||
if (IGUI_GEAR_activeFilter < 0) then {
|
||||
IGUI_GEAR_activeFilter = ((count _filterSets)-1 );
|
||||
};
|
||||
_doFilter = true;
|
||||
};
|
||||
|
||||
|
||||
case "onFocus": {
|
||||
[] call _weaponsLBSetFocus;
|
||||
//[] call _arrowsEnable;
|
||||
};
|
||||
|
||||
case "onKeyDown": {
|
||||
[] call _keyActions;
|
||||
};
|
||||
case "onLBSelChanged": {
|
||||
[] call _displayItemIcon;
|
||||
[] call _displayItemName;
|
||||
[] call _displayItemDescription;
|
||||
//[] call _arrowsEnable;
|
||||
[] call _highlightGearSlots;
|
||||
};
|
||||
case "onKillFocus": {
|
||||
[] call _weaponsLBSetFocus;
|
||||
};
|
||||
default {
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
/* Filter removed, moving to engine */
|
||||
if _doFilter then {
|
||||
(_filterSets select IGUI_GEAR_activeFilter) call _setFilterGlobals;
|
||||
// [] call _filterItems;
|
||||
// [] call _setFilterIcon;
|
||||
};
|
||||
|
||||
|
||||
_output;
|
||||
false;
|
||||
@@ -893,7 +893,7 @@ class RscDisplayGear
|
||||
idd = 106;
|
||||
enableDisplay = 1;
|
||||
// 177 based
|
||||
//onLoad = "_this call fn_gearMenuChecks;[] spawn object_monitorGear; {player removeMagazines _x} forEach MeleeMagazines; call gear_ui_init; if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'initDialog'] call compile preprocessFile '\ca\ui\scripts\handleGear.sqf'; _dummy = [_this,'onLoad'] execVM '\ca\ui\scripts\handleGear.sqf'; _dummy;";
|
||||
//onLoad = "_this call fn_gearMenuChecks;[] spawn object_monitorGear; {player removeMagazines _x} forEach MeleeMagazines; call gear_ui_init; if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'initDialog'] call compile preprocessFile '\z\addons\dayz_code\BIS_scripts\handleGear.sqf'; _dummy = [_this,'onLoad'] execVM '\z\addons\dayz_code\BIS_scripts\handleGear.sqf'; _dummy;";
|
||||
onUnload = "call player_gearSync; call dayz_forceSave;";
|
||||
|
||||
class controls
|
||||
@@ -1053,8 +1053,8 @@ class RscDisplayGear
|
||||
idc = 146;
|
||||
x = -2;
|
||||
style = 2048;
|
||||
onSetFocus = "private [""_dummy""]; _dummy = [_this,""onFocus""] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onButtonClick = "private [""_dummy""]; _dummy = [_this,""onLBListSelChanged""] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onSetFocus = "private [""_dummy""]; _dummy = [_this,""onFocus""] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
onButtonClick = "private [""_dummy""]; _dummy = [_this,""onLBListSelChanged""] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
text = "<";
|
||||
};
|
||||
class Available_items: RscIGUIListNBox
|
||||
@@ -1065,10 +1065,10 @@ class RscDisplayGear
|
||||
idcRight = 147;
|
||||
idcLeft = 146;
|
||||
colorPlayerItem[] = {0.8784,0.8471,0.651,1};
|
||||
onKeyDown = "private [""_dummy""]; _dummy = [_this,""onKeyDown"",0,107,0,107] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onLBSelChanged = "private [""_dummy""]; _dummy = [_this,""onLBSelChanged""] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onLBListSelChanged = "private [""_dummy""]; _dummy = [_this,""onLBListSelChanged""] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onKillFocus = "private [""_dummy""]; _dummy = [_this,""onKillFocus""] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onKeyDown = "private [""_dummy""]; _dummy = [_this,""onKeyDown"",0,107,0,107] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
onLBSelChanged = "private [""_dummy""]; _dummy = [_this,""onLBSelChanged""] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
onLBListSelChanged = "private [""_dummy""]; _dummy = [_this,""onLBListSelChanged""] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
onKillFocus = "private [""_dummy""]; _dummy = [_this,""onKillFocus""] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0.46;
|
||||
@@ -1079,8 +1079,8 @@ class RscDisplayGear
|
||||
{
|
||||
idc = 147;
|
||||
x = -2;
|
||||
onSetFocus = "private [""_dummy""]; _dummy = [_this,""onFocus""] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onButtonClick = "private [""_dummy""]; _dummy = [_this,""onLBListSelChanged""] execVM ""\ca\ui\scripts\handleGear.sqf""; _dummy;";
|
||||
onSetFocus = "private [""_dummy""]; _dummy = [_this,""onFocus""] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
onButtonClick = "private [""_dummy""]; _dummy = [_this,""onLBListSelChanged""] execVM ""\z\addons\dayz_code\BIS_scripts\handleGear.sqf""; _dummy;";
|
||||
text = ">";
|
||||
};
|
||||
};
|
||||
@@ -1619,7 +1619,7 @@ class RscDisplayGear
|
||||
emptyMag2 = "\ca\ui\data\ui_gear_mag2_gs.paa";
|
||||
emptyHGun = "\ca\ui\data\ui_gear_hgun_gs.paa";
|
||||
emptyHGunMag = "\ca\ui\data\ui_gear_hgunmag_gs.paa";
|
||||
onLoad = "_this call fn_gearMenuChecks;[] spawn object_monitorGear; call gear_ui_init; call ui_gear_sound;if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'initDialog'] call compile preprocessFile '\ca\ui\scripts\handleGear.sqf'; _dummy = [_this,'onLoad'] execVM '\ca\ui\scripts\handleGear.sqf'; _dummy;";
|
||||
onLoad = "_this call fn_gearMenuChecks;[] spawn object_monitorGear; call gear_ui_init; call ui_gear_sound;if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'initDialog'] call compile preprocessFile '\z\addons\dayz_code\BIS_scripts\handleGear.sqf'; _dummy = [_this,'onLoad'] execVM '\z\addons\dayz_code\BIS_scripts\handleGear.sqf'; _dummy;";
|
||||
class ControlsBackground
|
||||
{
|
||||
class Mainback: RscPicture
|
||||
|
||||
@@ -648,7 +648,7 @@ class KeypadUI
|
||||
y = 0.121749;
|
||||
w = 0.126596;
|
||||
h = 0.153191;
|
||||
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak;((ctrlParent (_this select 0)) closeDisplay 3000); if(!isNull dayz_selectedVault and (typeOf dayz_selectedVault) in DZE_LockedStorage) then {dayz_selectedVault spawn player_unlockVault;};";
|
||||
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak;((ctrlParent (_this select 0)) closeDisplay 3000); if(!isNull dayz_selectedVault) then {dayz_selectedVault spawn player_unlockVault;};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -123,7 +123,8 @@ if ((count _upgrade) > 0) then {
|
||||
|
||||
// Reset the character ID on locked doors before they inherit the newclassname
|
||||
if (_classname in DZE_DoorsLocked) then {
|
||||
_object setVariable ["CharacterID",dayz_characterID,true];
|
||||
_object setVariable ["CharacterID",dayz_characterID,true];
|
||||
_objectCharacterID = dayz_characterID;
|
||||
};
|
||||
|
||||
_classname = _newclassname;
|
||||
@@ -140,7 +141,7 @@ if ((count _upgrade) > 0) then {
|
||||
|
||||
cutText [format[(localize "str_epoch_player_142"),_text], "PLAIN DOWN", 5];
|
||||
|
||||
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location],_classname,_obj,_objectID,_objectUID,(getPlayerUID player)];
|
||||
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location],_classname,_obj,_objectID,_objectUID,player];
|
||||
publicVariableServer "PVDZE_obj_Swap";
|
||||
|
||||
player reveal _object;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
private ["_ok"];
|
||||
|
||||
if(DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_PLAYER_21") , "PLAIN DOWN"]; };
|
||||
DZE_ActionInProgress = true;
|
||||
|
||||
dayz_selectedVault = _this select 3;
|
||||
dayz_combination = "";
|
||||
|
||||
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
|
||||
s_player_unlockvault = 1;
|
||||
|
||||
if(!isNull dayz_selectedVault) then {
|
||||
|
||||
@@ -14,4 +15,4 @@ if(!isNull dayz_selectedVault) then {
|
||||
};
|
||||
};
|
||||
|
||||
s_player_unlockvault = -1;
|
||||
DZE_ActionInProgress = false;
|
||||
@@ -466,10 +466,11 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
|
||||
if(_typeOfCursorTarget in DZE_LockedStorage) then {
|
||||
if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then {
|
||||
_combi = player addAction [format["Open %1",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
|
||||
s_player_combi set [count s_player_combi,_combi];
|
||||
} else {
|
||||
_combi = player addAction [format["Unlock %1",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
|
||||
s_player_combi set [count s_player_combi,_combi];
|
||||
};
|
||||
s_player_combi set [count s_player_combi,_combi];
|
||||
s_player_unlockvault = 1;
|
||||
} else {
|
||||
if(_ownerID != dayz_combination and _ownerID != dayz_playerUID) then {
|
||||
|
||||
@@ -14,6 +14,11 @@ s_player_unlockvault = 1;
|
||||
_obj = _this;
|
||||
_objType = typeOf _obj;
|
||||
|
||||
if (!(_objType in DZE_LockedStorage)) exitWith {
|
||||
s_player_unlockvault = -1;
|
||||
DZE_ActionInProgress = false;
|
||||
};
|
||||
|
||||
_playerNear = _obj call dze_isnearest_player;
|
||||
if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_20") , "PLAIN DOWN"]; };
|
||||
|
||||
|
||||
@@ -7,11 +7,13 @@ private ["_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_remov
|
||||
if(DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_PLAYER_52") , "PLAIN DOWN"]; };
|
||||
DZE_ActionInProgress = true;
|
||||
|
||||
// look for nearest vehicle
|
||||
if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText ["\n\nYou cannot perform an upgrade while still inside a vehicle.", "PLAIN DOWN"]};
|
||||
|
||||
// look for nearest empty vehicle
|
||||
_findNearestVehicles = nearestObjects [player, ["LandVehicle"], 10];
|
||||
_findNearestVehicle = [];
|
||||
{
|
||||
if (alive _x) exitWith {
|
||||
if (alive _x and (count (crew _x)) == 0) exitWith {
|
||||
_findNearestVehicle set [(count _findNearestVehicle),_x];
|
||||
};
|
||||
} foreach _findNearestVehicles;
|
||||
|
||||
@@ -25,7 +25,11 @@ if (r_player_unconscious && _vehicle == player && _type == "zombie") then {
|
||||
_move = "Dog_Attack";
|
||||
};
|
||||
};
|
||||
_dir = [_unit,player] call BIS_Fnc_dirTo;
|
||||
|
||||
_tPos = visiblePositionASL _vehicle;
|
||||
_zPos = visiblePositionASL _unit;
|
||||
|
||||
_dir = [_zpos,_tPos] call BIS_Fnc_dirTo;
|
||||
_unit setDir _dir;
|
||||
|
||||
// _unit playMove _move;
|
||||
@@ -64,7 +68,6 @@ if (_vehicle != player) then {
|
||||
|
||||
//diag_log ("Hitpoints " +str(_wound) +str(_total));
|
||||
|
||||
//["PVDZE_plr_HitV",[_vehicle, _wound,_total, _unit,"zombie"]] call broadcastRpcCallAll;
|
||||
if (_dam >= 1) then {
|
||||
if (r_player_blood < (r_player_bloodTotal * 0.8)) then {
|
||||
_cnt = count (DAYZ_woundHit select 1);
|
||||
@@ -80,22 +83,14 @@ if (_vehicle != player) then {
|
||||
_damage = 0.1 + random (1.2);
|
||||
//diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//PVDZE_plr_Hit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "PVDZE_plr_Hit";
|
||||
[_unit,"hit",2,false] call dayz_zombieSpeak;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
//Did he hit?
|
||||
//_currentAnim = animationState _unit;
|
||||
//diag_log ("Animation state: " +(_currentAnim));
|
||||
//"amovpercmstpsnonwnondnon",
|
||||
_attackanimations = ["zombiestandingattack1","zombiestandingattack2","zombiestandingattack3","zombiestandingattack4","zombiestandingattack5","zombiestandingattack6","zombiestandingattack7","zombiestandingattack8","zombiestandingattack9","zombiestandingattack10","zombiefeed1","zombiefeed2","zombiefeed3","zombiefeed4","zombiefeed5"];
|
||||
if (((_unit distance player) <= dayz_areaAffect) and ((animationState _unit) in _attackanimations)) then {
|
||||
//check LOS
|
||||
private[];
|
||||
_tPos = (getPosASL _vehicle);
|
||||
_zPos = (getPosASL _unit);
|
||||
_inAngle = [_zPos,(getdir _unit),50,_tPos] call fnc_inAngleSector;
|
||||
if (_inAngle) then {
|
||||
//LOS check
|
||||
@@ -116,22 +111,7 @@ if (_vehicle != player) then {
|
||||
|
||||
//diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//PVDZE_plr_Hit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "PVDZE_plr_Hit";
|
||||
[_unit,"hit",2,false] call dayz_zombieSpeak;
|
||||
} else {
|
||||
//diag_log ("NO LOS: Player Hit on " + str(_unit) + " for " + str(_vehicle));
|
||||
/*
|
||||
_isZombieInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||
if (_isPlayerInside) then {
|
||||
_damage = 0.1 + random (1.2);
|
||||
diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//PVDZE_plr_Hit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "PVDZE_plr_Hit";
|
||||
[_unit,"hit",2,false] call dayz_zombieSpeak;
|
||||
};
|
||||
*/
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -494,7 +494,7 @@ DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ"
|
||||
|
||||
// These work with just a running generator
|
||||
dayz_fuelpumparray = ["FuelPump_DZ","Land_A_FuelStation_Feed","Land_Ind_FuelStation_Feed_EP1","Land_FuelStation_Feed_PMC","FuelStation","Land_ibr_FuelStation_Feed","Land_fuelstation_army","Land_fuelstation","land_fuelstation_w","Land_benzina_schnell"];
|
||||
DZE_fueltruckarray = ["KamazRefuel_DZ","UralRefuel_TK_EP1_DZ","MtvrRefuel_DES_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ"];
|
||||
DZE_fueltruckarray = ["KamazRefuel_DZ","UralRefuel_TK_EP1_DZ","MtvrRefuel_DES_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ","MtvrRefuel_DZ"];
|
||||
|
||||
// Standard Fuel sources
|
||||
dayz_fuelsources = ["Land_Ind_TankSmall","Land_fuel_tank_big","Land_fuel_tank_stairs","Land_fuel_tank_stairs_ep1","Land_wagon_tanker","Land_fuelstation","Land_fuelstation_army","land_fuelstation_w","Land_benzina_schnell"];
|
||||
|
||||
@@ -7,13 +7,14 @@ player removeMagazine "ItemBandage";
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
[1,1] call dayz_HungerThirst;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
[1,1] call dayz_HungerThirst;
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
@@ -38,26 +39,36 @@ while {r_doLoop} do {
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
//["usecBandage",[_unit,player]] call broadcastRpcCallAll;
|
||||
usecBandage = [_unit,player];
|
||||
publicVariable "usecBandage";
|
||||
|
||||
if (_unit == player) then {
|
||||
//Self Healing
|
||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
|
||||
dayz_sourceBleeding = objNull;
|
||||
} else {
|
||||
//PVDZE_plr_HumanityChange = [player,20];
|
||||
[player,20] call player_humanityChange;
|
||||
};
|
||||
|
||||
{_unit setVariable[_x,false,true];} forEach USEC_woundHit;
|
||||
_unit setVariable ["USEC_injured",false,true];
|
||||
_num_removed = ([player,"ItemBandage"] call BIS_fnc_invRemove);
|
||||
if(_num_removed == 1) then {
|
||||
|
||||
if (vehicle player != player) then {
|
||||
_display = findDisplay 106;
|
||||
_display closeDisplay 0;
|
||||
};
|
||||
|
||||
//["usecBandage",[_unit,player]] call broadcastRpcCallAll;
|
||||
usecBandage = [_unit,player];
|
||||
publicVariable "usecBandage";
|
||||
|
||||
if (_unit == player) then {
|
||||
//Self Healing
|
||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
|
||||
dayz_sourceBleeding = objNull;
|
||||
} else {
|
||||
//PVDZE_plr_HumanityChange = [player,20];
|
||||
[player,20] call player_humanityChange;
|
||||
};
|
||||
|
||||
{_unit setVariable[_x,false,true];} forEach USEC_woundHit;
|
||||
_unit setVariable ["USEC_injured",false,true];
|
||||
|
||||
};
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
player addMagazine "ItemBandage";
|
||||
};
|
||||
@@ -38,6 +38,12 @@ r_doLoop = false;
|
||||
if (_finished) then {
|
||||
_num_removed = ([player,"ItemMorphine"] call BIS_fnc_invRemove);
|
||||
if(_num_removed == 1) then {
|
||||
|
||||
if (vehicle player != player) then {
|
||||
_display = findDisplay 106;
|
||||
_display closeDisplay 0;
|
||||
};
|
||||
|
||||
if (_unit == player) then {
|
||||
//Self Healing
|
||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
|
||||
|
||||
@@ -11,6 +11,11 @@ r_action = false;
|
||||
_num_removed = ([player,"ItemPainkiller"] call BIS_fnc_invRemove);
|
||||
if(_num_removed == 1) then {
|
||||
|
||||
if (vehicle player != player) then {
|
||||
_display = findDisplay 106;
|
||||
_display closeDisplay 0;
|
||||
};
|
||||
|
||||
_unit setVariable ["USEC_inPain", false, true];
|
||||
|
||||
if (vehicle player == player) then {
|
||||
|
||||
@@ -10,11 +10,13 @@ _lastused = _unit getVariable ["LastTransfusion", time];
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
// not possible to transfuse while in a vehicle
|
||||
if (vehicle player != player) exitWith { };
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[1,1] call dayz_HungerThirst;
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -212,38 +212,33 @@ BuildingList = [];
|
||||
} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]);
|
||||
|
||||
spawn_vehicles = {
|
||||
private ["_weights","_isOverLimit","_isAbort","_counter","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];
|
||||
private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];
|
||||
|
||||
if (isDedicated) then {
|
||||
|
||||
_isOverLimit = true;
|
||||
_isAbort = false;
|
||||
_counter = 0;
|
||||
while {_isOverLimit} do {
|
||||
|
||||
waitUntil{!isNil "BIS_fnc_selectRandom"};
|
||||
_index = AllowedVehiclesList call BIS_fnc_selectRandom;
|
||||
while {count AllowedVehiclesList > 0} do {
|
||||
// BIS_fnc_selectRandom replaced because the index may be needed to remove the element
|
||||
_index = floor random count AllowedVehiclesList;
|
||||
_random = AllowedVehiclesList select _index;
|
||||
|
||||
_vehicle = _index select 0;
|
||||
_velimit = _index select 1;
|
||||
_vehicle = _random select 0;
|
||||
_velimit = _random select 1;
|
||||
|
||||
_qty = {_x == _vehicle} count serverVehicleCounter;
|
||||
|
||||
// If under limit allow to proceed
|
||||
if(_qty <= _velimit) then {
|
||||
_isOverLimit = false;
|
||||
};
|
||||
if (_qty <= _velimit) exitWith {};
|
||||
|
||||
// counter to stop after 5 attempts
|
||||
_counter = _counter + 1;
|
||||
|
||||
if(_counter >= 5) then {
|
||||
_isOverLimit = false;
|
||||
_isAbort = true;
|
||||
// vehicle limit reached, remove vehicle from list
|
||||
// since elements cannot be removed from an array, overwrite it with the last element and cut the last element of (as long as order is not important)
|
||||
_lastIndex = (count AllowedVehiclesList) - 1;
|
||||
if (_lastIndex != _index) then {
|
||||
AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex];
|
||||
};
|
||||
AllowedVehiclesList resize _lastIndex;
|
||||
};
|
||||
|
||||
if (_isAbort) then {
|
||||
if (count AllowedVehiclesList == 0) then {
|
||||
diag_log("DEBUG: unable to find suitable vehicle to spawn");
|
||||
} else {
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ class Mission
|
||||
"cacharacters_pmc",
|
||||
"ca_modules_functions",
|
||||
"glt_m300t",
|
||||
|
||||
"csj_gyroac",
|
||||
"map_eu",
|
||||
"jetskiyanahuiaddon"
|
||||
@@ -1278,7 +1277,7 @@ class Mission
|
||||
};
|
||||
class Item15
|
||||
{
|
||||
position[]={14062.486,68.227501,12673.197};
|
||||
position[]={14271.439,39.959999,12410.709};
|
||||
name="TradercityBag";
|
||||
text="Trader City Bag";
|
||||
type="mil_circle";
|
||||
|
||||
Reference in New Issue
Block a user