This commit is contained in:
2022-04-21 16:15:41 +03:00
commit 9d4fc88901
601 changed files with 66252 additions and 0 deletions

View File

@ -0,0 +1,39 @@
/*
Filename: hud_getImages.sqf
Author: Relentless
Description: Function to get images for Weapon HUD
*/
private ["_hasPainkiller","_hasBandage","_display"];
disableSerialization;
/* Variables */
_hasPainkiller = 'ItemPainkiller' in magazines player;
_hasBandage = 'ItemBandage' in magazines player;
_display = uiNamespace getVariable["rlnt_rlnt_weaponhud_2_items", displayNull];
/* Delay so the display spawns first */
sleep 1;
/* Set Images */
//Primary Weapon
(_display displayCtrl 1200) ctrlSetText(gettext(configFile >> 'cfgWeapons' >> (primaryWeapon player) >> 'picture'));
//Seccond Primary Weapon
(_display displayCtrl 1201) ctrlSetText(gettext(configFile >> 'cfgWeapons' >> dayz_onBack >> 'picture'));
//Handgun Weapon
{
if ((getNumber (configFile >> 'cfgWeapons' >> _x >> 'Type')) == 2) exitWith {
(_display displayCtrl 1202) ctrlSetText(getText(configFile >> 'cfgWeapons' >> _x >> 'picture'));
};
} forEach weapons player;
//Painkiller
if (_hasPainkiller) then {
(_display displayCtrl 1203) ctrlSetText(gettext(configFile >> 'cfgMagazines' >> 'itempainkiller' >> 'picture'));
};
//Bandage
if (_hasBandage) then {
(_display displayCtrl 1204) ctrlSetText(gettext(configFile >> 'cfgMagazines' >> 'itembandage' >> 'picture'));
};

View File

@ -0,0 +1,51 @@
/*
Filename: hud_updateImages.sqf
Author: Relentless
Description: Function to refresh images for Weapon HUD
*/
private ["_display","_rifle1Update","_rifle2Update","_secondaryUpdate","_painkillerUpdate","_bandageUpdate","_hasPainkiller","_hasBandage","_handgun"];
disableSerialization;
/* Variables */
_display = uiNamespace getVariable["rlnt_weaponhud_2_items", displayNull];
_rifle1Update = _display displayCtrl 1200;
_rifle2Update = _display displayCtrl 1201;
_secondaryUpdate = _display displayCtrl 1202;
_painkillerUpdate = _display displayCtrl 1203;
_bandageUpdate = _display displayCtrl 1204;
_hasPainkiller = 'ItemPainkiller' in magazines player;
_hasBandage = 'ItemBandage' in magazines player;
_handgun = "";
/* Refresh images */
//Primary Weapon
_rifle1Update ctrlSetText(gettext(configFile >> 'cfgWeapons' >> (primaryWeapon player) >> 'picture'));
//Seccond Primary Weapon
_rifle2Update ctrlSetText(gettext(configFile >> 'cfgWeapons' >> dayz_onBack >> 'picture'));
//Handgun Weapon
{
if ((getNumber(configFile >> 'cfgWeapons' >> _x >> 'Type')) == 2) then {
_handgun = _x;
};
} forEach weapons player;
if (_handgun == "") then {
_secondaryUpdate ctrlSetText("");
} else {
_secondaryUpdate ctrlSetText(getText(configFile >> 'cfgWeapons' >> _handgun >> 'picture'));
};
//Painkiller
if (_hasPainkiller) then {
_painkillerUpdate ctrlSetText(gettext(configFile >> 'cfgMagazines' >> 'itempainkiller' >> 'picture'));
} else {
_painkillerUpdate ctrlSetText("");
};
//Bandage
if (_hasBandage) then {
_bandageUpdate ctrlSetText(gettext(configFile >> 'cfgMagazines' >> 'itembandage' >> 'picture'));
} else {
_bandageUpdate ctrlSetText("");
};