mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Update compiles - 2 more files to do
fn_selfActions.sqf player_updateGui.sqf
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
private["_countMagazines","_countWeapons","_countBackpacks","_countFreeSlots","_getControlText","_setControlText","_object","_objectName","_controlText","_magazinesMax","_weaponsMax","_backpacksMax","_distance","_isVehicle","_isMan","_isStorage","_isOK","_magazines","_weapons","_backpacks","_freeSlots","_timeout"];
|
||||
disableSerialization;
|
||||
|
||||
_countWeapons = {
|
||||
private["_weapons","_return"];
|
||||
@@ -38,7 +39,6 @@ _countFreeSlots = {
|
||||
|
||||
_getControlText = {
|
||||
private["_control","_return"];
|
||||
disableSerialization;
|
||||
_control = (findDisplay 106) displayCtrl 156;
|
||||
_return = ctrlText _control;
|
||||
_return;
|
||||
@@ -46,11 +46,18 @@ _getControlText = {
|
||||
|
||||
_setControlText = {
|
||||
private["_control"];
|
||||
disableSerialization;
|
||||
/*for [{_i = 0}, {_i < (count _valueIDCs)}, {_i = _i + 1}] do {
|
||||
_control = _display displayCtrl (_valueIDCs select _i);
|
||||
_control ctrlSetText format ["%1", (_freeSlots select _i)];
|
||||
}; */
|
||||
_control = (findDisplay 106) displayCtrl 156;
|
||||
_control ctrlSetText format["%1 (%2/%3/%4)", _objectName, _freeSlots select 0, _freeSlots select 1, _freeSlots select 2];
|
||||
};
|
||||
|
||||
_titleIDC = 1001;
|
||||
_imageIDCs = [9001,9003,9005];
|
||||
_valueIDCs = [9002,9004,9006];
|
||||
|
||||
if (vehicle player != player) then {
|
||||
_object = vehicle player;
|
||||
} else {
|
||||
@@ -67,23 +74,43 @@ waitUntil { !(isNull (findDisplay 106)) || (_timeout < time) };
|
||||
|
||||
//diag_log format["object_monitorGear.sqf: _object: %1 _isStorage: %4 _isVehicle: %2 _isMan: %3 _display: %5", _object, _isVehicle, _isMan, _isStorage, findDisplay 106];
|
||||
|
||||
if ((_isVehicle || _isStorage || _isnewstorage) && (!_isMan) && (!(isNull (findDisplay 106)))) then {
|
||||
_objectName = getText (configFile >> "CfgVehicles" >> (typeof _object) >> "displayName");
|
||||
_controlText = [] call _getControlText;
|
||||
|
||||
if (_objectName == _controlText) then {
|
||||
_weaponsMax = getNumber (configFile >> "CfgVehicles" >> (typeof _object) >> "transportMaxWeapons");
|
||||
_magazinesMax = getNumber (configFile >> "CfgVehicles" >> (typeof _object) >> "transportMaxMagazines");
|
||||
_backpacksMax = getNumber (configFile >> "CfgVehicles" >> (typeof _object) >> "transportMaxBackpacks");
|
||||
|
||||
while {!(isNull (findDisplay 106))} do {
|
||||
_weapons = [] call _countWeapons;
|
||||
_magazines = [] call _countMagazines;
|
||||
_backpacks = [] call _countBackpacks;
|
||||
_freeSlots = [] call _countFreeSlots;
|
||||
if (!(isNull (findDisplay 106))) then {
|
||||
_display = findDisplay 106;
|
||||
|
||||
[] call _setControlText;
|
||||
uiSleep 0.01;
|
||||
if ((_isVehicle or _isStorage || _isnewstorage) and (!_isMan)) then {
|
||||
_objectName = getText (configFile >> "CfgVehicles" >> (typeof _object) >> "displayName");
|
||||
_controlText = [] call _getControlText;
|
||||
|
||||
|
||||
if (_objectName == _controlText) then {
|
||||
_weaponsMax = getNumber (configFile >> "CfgVehicles" >> (typeof _object) >> "transportMaxWeapons");
|
||||
_magazinesMax = getNumber (configFile >> "CfgVehicles" >> (typeof _object) >> "transportMaxMagazines");
|
||||
_backpacksMax = getNumber (configFile >> "CfgVehicles" >> (typeof _object) >> "transportMaxBackpacks");
|
||||
|
||||
|
||||
while {!(isNull (findDisplay 106))} do {
|
||||
_weapons = [] call _countWeapons;
|
||||
_magazines = [] call _countMagazines;
|
||||
_backpacks = [] call _countBackpacks;
|
||||
_freeSlots = [] call _countFreeSlots;
|
||||
|
||||
[] call _setControlText;
|
||||
uiSleep 0.01;
|
||||
};
|
||||
} else {
|
||||
(_display displayCtrl _titleIDC) ctrlShow false;
|
||||
|
||||
for [{_i = 0}, {_i < (count _valueIDCs)}, {_i = _i + 1}] do {
|
||||
(_display displayCtrl (_imageIDCs select _i)) ctrlShow false;
|
||||
(_display displayCtrl (_valueIDCs select _i)) ctrlShow false;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
(_display displayCtrl _titleIDC) ctrlShow false;
|
||||
|
||||
for [{_i = 0}, {_i < (count _valueIDCs)}, {_i = _i + 1}] do {
|
||||
(_display displayCtrl (_imageIDCs select _i)) ctrlShow false;
|
||||
(_display displayCtrl (_valueIDCs select _i)) ctrlShow false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user