mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Make free slots display more accurate in gear
Use the cursorTarget at the time the gear dialog was opened instead of the cursorTarget at the time the script runs. The script can be delayed by several seconds (spawn is scheduled).
This commit is contained in:
@@ -4,10 +4,8 @@ class RscDisplayGear
|
|||||||
enableDisplay = 1;
|
enableDisplay = 1;
|
||||||
movingEnable = 0;
|
movingEnable = 0;
|
||||||
|
|
||||||
//onLoad = "[] spawn object_monitorGear; false call dz_fn_meleeMagazines; call gear_ui_init; call ui_gear_sound; if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; [_this,'onLoad'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";/* diag_log 'RscDisplayGear : : onLoad'; */
|
onLoad = "_this call fn_gearMenuChecks; false call dz_fn_meleeMagazines; dayz_gearThread = cursorTarget spawn object_monitorGear; call gear_ui_init; call ui_gear_sound; if (isNil 'IGUI_GEAR_activeFilter') then {IGUI_GEAR_activeFilter = 0}; [_this, 'onLoad'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
|
||||||
//onUnload = "false call dz_fn_meleeMagazines; call player_forceSave; call dayz_meleeMagazineCheck;"; /* diag_log 'RscDisplayGear : : onunLoad'; */
|
onUnload = "true call dz_fn_meleeMagazines; terminate dayz_gearThread; call player_selectWeapon; call player_forceSave;";
|
||||||
onLoad = "setMousePosition [0.5, 0.5];_this call fn_gearMenuChecks; false call dz_fn_meleeMagazines; [] spawn object_monitorGear; call gear_ui_init; call ui_gear_sound; if (isNil 'IGUI_GEAR_activeFilter') then {IGUI_GEAR_activeFilter = 0}; [_this, 'onLoad'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
|
|
||||||
onUnload = "true call dz_fn_meleeMagazines; call player_selectWeapon; call player_forceSave;";
|
|
||||||
onMouseMoving = "[] call gear_ui_hide;";
|
onMouseMoving = "[] call gear_ui_hide;";
|
||||||
onMouseHolding = "[] call gear_ui_hide;";
|
onMouseHolding = "[] call gear_ui_hide;";
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
setMousePosition [0.5, 0.5];
|
||||||
|
|
||||||
private ["_exit","_nearestObjects","_rID","_display","_cTarget","_dis","_friendlyTo","_lastSave","_startTime"];
|
private ["_exit","_nearestObjects","_rID","_display","_cTarget","_dis","_friendlyTo","_lastSave","_startTime"];
|
||||||
|
|
||||||
// players inside vehicle can always access its gear
|
// players inside vehicle can always access its gear
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ _valueIDCs = [9002,9004,9006];
|
|||||||
if (vehicle player != player) then {
|
if (vehicle player != player) then {
|
||||||
_object = vehicle player;
|
_object = vehicle player;
|
||||||
} else {
|
} else {
|
||||||
_object = cursorTarget;
|
_object = _this;
|
||||||
};
|
};
|
||||||
|
|
||||||
_type = typeOf _object;
|
_type = typeOf _object;
|
||||||
|
|||||||
@@ -196,4 +196,4 @@ player setVariable ["BIS_noCoreConversations",true];
|
|||||||
// publicVariable _playerObjName;
|
// publicVariable _playerObjName;
|
||||||
|
|
||||||
call dayz_meleeMagazineCheck;
|
call dayz_meleeMagazineCheck;
|
||||||
{player reveal _x} count (nearestObjects [getPosATL player,["AllVehicles","WeaponHolder","Land_A_tent","BuiltItems","ModularItems","DZE_Base_Object"],75]);
|
{player reveal _x} count (nearestObjects [_position,["AllVehicles","WeaponHolder","Land_A_tent","BuiltItems","ModularItems","DZE_Base_Object"],75]);
|
||||||
|
|||||||
Reference in New Issue
Block a user