mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Merge branch 'experimental' into Community-Stats-#1
This commit is contained in:
commit
6a78895879
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
Author: Aaron Clark - EpochMod.com
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Function to check HitPointDamageAverage.
|
||||||
|
|
||||||
|
Licence:
|
||||||
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||||
|
|
||||||
|
Github:
|
||||||
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_fnc_getHitPointsDamageAverage.sqf
|
||||||
|
|
||||||
|
Example:
|
||||||
|
_average = [cursorObject, "steering", 1] call EPOCH_fnc_getHitPointsDamageAverage;;
|
||||||
|
|
||||||
|
Parameter(s):
|
||||||
|
_this select 0: OBJECT - Object to check Hitpoints
|
||||||
|
_this select 1: STRING - String to find in Hitpointname (e.g. "wheel");
|
||||||
|
_this select 2: SCALAR - Sub-Array in getAllHitPointsDamage to search for String (default = 0)
|
||||||
|
_this select 3: SCALAR - Sub-Array for Hitpoint-Values in getAllHitPointsDamage (default = 2)
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
SCALAR
|
||||||
|
*/
|
||||||
|
params [ "_object", "_match", ["_indexIn", 0], ["_indexOut", 2] ];
|
||||||
|
_dmg = 0;
|
||||||
|
_parts = 0;
|
||||||
|
_allHitPoints = getAllHitPointsDamage _object;
|
||||||
|
{
|
||||||
|
if ((toLower(_x) find _match) != -1) then {
|
||||||
|
_dmg = _dmg + ((_allHitPoints select _indexOut) select _forEachIndex);
|
||||||
|
_parts = _parts + 1;
|
||||||
|
};
|
||||||
|
} forEach (_allHitPoints select _indexIn);
|
||||||
|
(_dmg / _parts)
|
@ -38,12 +38,19 @@ if (_handled) exitWith{ true };
|
|||||||
if !(alive player) exitWith{ false };
|
if !(alive player) exitWith{ false };
|
||||||
|
|
||||||
EPOCH_doRotate = false;
|
EPOCH_doRotate = false;
|
||||||
|
|
||||||
|
if !(EPOCH_modKeys isequalto [_shift,_ctrl,_alt]) then {
|
||||||
EPOCH_modKeys = [_shift,_ctrl,_alt];
|
EPOCH_modKeys = [_shift,_ctrl,_alt];
|
||||||
'modifier' spawn epoch_favBar_draw;
|
call epoch_favBar_modifier;
|
||||||
|
};
|
||||||
|
|
||||||
//Favorites bar
|
//Favorites bar
|
||||||
if (_dikCode in [EPOCH_keysfav1,EPOCH_keysfav2,EPOCH_keysfav3,EPOCH_keysfav4,EPOCH_keysfav5]) then {
|
if (_dikCode in [EPOCH_keysfav1,EPOCH_keysfav2,EPOCH_keysfav3,EPOCH_keysfav4,EPOCH_keysfav5]) then {
|
||||||
|
if (isnull EPOCH_Target) then {
|
||||||
_this call epoch_favBar_action;
|
_this call epoch_favBar_action;
|
||||||
|
} else {
|
||||||
|
"Can't use while in building mode!" call epoch_message;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// increase vol
|
// increase vol
|
||||||
@ -107,7 +114,7 @@ if (_dikCode == EPOCH_keysAction) then {
|
|||||||
// Player only code
|
// Player only code
|
||||||
if (vehicle player == player) then {
|
if (vehicle player == player) then {
|
||||||
|
|
||||||
if (_dikCode == EPOCH_keysBuildMode1 && EPOCH_buildMode > 0) then {
|
if ((_dikCode == EPOCH_keysBuildMode1 && !EPOCH_favBar_itemConsumed) && EPOCH_buildMode > 0) then {
|
||||||
EPOCH_buildMode = 0;
|
EPOCH_buildMode = 0;
|
||||||
["Build Mode: Disabled", 5] call Epoch_message;
|
["Build Mode: Disabled", 5] call Epoch_message;
|
||||||
EPOCH_Target = objNull;
|
EPOCH_Target = objNull;
|
||||||
@ -231,6 +238,8 @@ if (vehicle player == player) then {
|
|||||||
|
|
||||||
}; // end player only code
|
}; // end player only code
|
||||||
|
|
||||||
|
EPOCH_favBar_itemConsumed = false;
|
||||||
|
|
||||||
if (_dikCode in (actionKeys "Salute")) then {
|
if (_dikCode in (actionKeys "Salute")) then {
|
||||||
if (_ctrl) then {
|
if (_ctrl) then {
|
||||||
player playactionNow "GestureFinger";
|
player playactionNow "GestureFinger";
|
||||||
|
@ -34,8 +34,10 @@ _handled = false;
|
|||||||
_this call Epoch_custom_EH_KeyUp;
|
_this call Epoch_custom_EH_KeyUp;
|
||||||
if (_handled) exitWith{ true };
|
if (_handled) exitWith{ true };
|
||||||
|
|
||||||
|
if !(EPOCH_modKeys isequalto [_shift,_ctrl,_alt]) then {
|
||||||
EPOCH_modKeys = [_shift,_ctrl,_alt];
|
EPOCH_modKeys = [_shift,_ctrl,_alt];
|
||||||
'modifier' spawn epoch_favBar_draw;
|
call epoch_favBar_modifier;
|
||||||
|
};
|
||||||
|
|
||||||
//Main actions
|
//Main actions
|
||||||
if (_dikCode == EPOCH_keysAction) then {
|
if (_dikCode == EPOCH_keysAction) then {
|
||||||
|
@ -30,21 +30,21 @@
|
|||||||
4 - not enough space
|
4 - not enough space
|
||||||
5 - accessory not compatible
|
5 - accessory not compatible
|
||||||
*/
|
*/
|
||||||
private ["_item","_drop","_forceEquip"];
|
private ["_item","_drop","_forceEquip","_return","_loadout","_slot","_uniform","_vest","_bpack","_uniformItems","_vestItems","_bPackItems","_itemInInventory",
|
||||||
|
"_fnc_dropItem","_fnc_findItemInContainers","_fnc_moveWeaponFromContainer","_fnc_MoveWeaponToContainer","_fnc_canMoveToContainer","_fnc_dropEquipWeapon","_fnc_dropAssign",
|
||||||
|
"_fnc_MoveShellToContainer","_fnc_moveShellFromContainer","_fnc_dropEquipShells","_fnc_findAccessorySlot","_fnc_dropEquipAccessories"];
|
||||||
params [["_item","",[""]],["_drop",false,[false]],["_forceEquip",false,[false]]];
|
params [["_item","",[""]],["_drop",false,[false]],["_forceEquip",false,[false]]];
|
||||||
|
|
||||||
_return = 0;
|
_return = 0;
|
||||||
if (_item == "") exitWith {_return};
|
if (_item == "") exitWith {_return};
|
||||||
_slot = _item call epoch_itemTypeSlot;
|
_slot = _item call epoch_itemTypeSlot;
|
||||||
_loadout = getUnitLoadout player;
|
_loadout = getUnitLoadout player;
|
||||||
_loadout params ["_pSlot","_sSlot","_hSlot","_uniform","_vest","_bpack","_helm","_goggles","_bino","_assigned"];
|
_uniform = _loadout param [3,[]];
|
||||||
_pSlot params ["_pWeapon","_pSilencer","_pLaser","_pOptic","_pMag","_pMag2","_pBipod"];
|
_vest = _loadout param [4,[]];
|
||||||
_sSlot params ["_sWeapon","_sSilencer","_sLaser","_sOptic","_sMag","_sBipod"];
|
_bpack = _loadout param [5,[]];
|
||||||
_hSlot params ["_hWeapon","_hSilencer","_hLaser","_hOptic","_hMag","_hBipod"];
|
|
||||||
_uniformItems = _uniform param [1,[]];
|
_uniformItems = _uniform param [1,[]];
|
||||||
_vestItems = _vest param [1,[]];
|
_vestItems = _vest param [1,[]];
|
||||||
_bPackItems = _bPack param [1,[]];
|
_bPackItems = _bPack param [1,[]];
|
||||||
_binoculars = _bino param [0,[]];
|
|
||||||
|
|
||||||
_itemInInventory = _item in ((magazines player) + (items player));
|
_itemInInventory = _item in ((magazines player) + (items player));
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ _fnc_dropItem = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_fnc_findItemInContainers = {
|
_fnc_findItemInContainers = {
|
||||||
private "_item";
|
private ["_item","_container","_index","_found","_currItem"];
|
||||||
params ["_item"];
|
params ["_item"];
|
||||||
|
|
||||||
_container = 0;
|
_container = 0;
|
||||||
@ -96,7 +96,7 @@ _fnc_findItemInContainers = {
|
|||||||
if _found exitWith {};
|
if _found exitWith {};
|
||||||
} forEach [_uniformItems,_vestItems,_bPackItems];
|
} forEach [_uniformItems,_vestItems,_bPackItems];
|
||||||
|
|
||||||
[_container,_index,_found];
|
[_container,_index,_found]
|
||||||
};
|
};
|
||||||
|
|
||||||
_fnc_moveWeaponFromContainer = {
|
_fnc_moveWeaponFromContainer = {
|
||||||
@ -292,7 +292,7 @@ _fnc_dropEquipShells = {
|
|||||||
_fnc_findAccessorySlot = {
|
_fnc_findAccessorySlot = {
|
||||||
_item = toLower _item;
|
_item = toLower _item;
|
||||||
|
|
||||||
private ["_found","_slot","_accessory"];
|
private ["_found","_slot","_accessory","_compatibleMuzzles","_compatibleCows","_compatiblePointers","_compatibleBipods"];
|
||||||
_slot = 0;
|
_slot = 0;
|
||||||
_accessory = 0;
|
_accessory = 0;
|
||||||
_found = false;
|
_found = false;
|
||||||
@ -322,7 +322,7 @@ _fnc_findAccessorySlot = {
|
|||||||
if (_item in _compatibleBipods) exitWith {_found = true; _accessory = 6};
|
if (_item in _compatibleBipods) exitWith {_found = true; _accessory = 6};
|
||||||
} forEach [(primaryWeapon player),(secondaryWeapon player),(handgunWeapon player)];
|
} forEach [(primaryWeapon player),(secondaryWeapon player),(handgunWeapon player)];
|
||||||
|
|
||||||
[_found,_slot,_accessory];
|
[_found,_slot,_accessory]
|
||||||
};
|
};
|
||||||
|
|
||||||
_fnc_dropEquipAccessories = {
|
_fnc_dropEquipAccessories = {
|
||||||
@ -339,7 +339,7 @@ _fnc_dropEquipAccessories = {
|
|||||||
_item = toLower _item;
|
_item = toLower _item;
|
||||||
_itemEquipped = _item in _itemsPlayer;
|
_itemEquipped = _item in _itemsPlayer;
|
||||||
_equipped = (_loadout select _slot) select _accessory;
|
_equipped = (_loadout select _slot) select _accessory;
|
||||||
systemChat str [_item,_equipped];
|
|
||||||
if (!_itemInInventory && !_itemEquipped) exitWith {_return = 3};
|
if (!_itemInInventory && !_itemEquipped) exitWith {_return = 3};
|
||||||
if (_equipped != "") then {
|
if (_equipped != "") then {
|
||||||
_equipped = (_loadout select _slot) select _accessory;
|
_equipped = (_loadout select _slot) select _accessory;
|
||||||
@ -369,7 +369,7 @@ _fnc_dropEquipAccessories = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
player selectWeapon ((_loadout select _slot) select 0);
|
player selectWeapon ((_loadout select _slot) select 0);
|
||||||
if (!EPOCH_fav_FastWeaponSwitching) then {
|
if !(["CfgEpochClient", "Fav_FastWeaponSwitching", false] call EPOCH_fnc_returnConfigEntryV2) then {
|
||||||
player playAction "reloadMagazine";
|
player playAction "reloadMagazine";
|
||||||
};
|
};
|
||||||
_return
|
_return
|
||||||
@ -452,6 +452,7 @@ switch _slot do {
|
|||||||
};
|
};
|
||||||
case 12: //mines
|
case 12: //mines
|
||||||
{
|
{
|
||||||
|
private ["_allMuzzles","_muzzle","_found","_mags"];
|
||||||
if (_itemInInventory) then {
|
if (_itemInInventory) then {
|
||||||
_allMuzzles = getArray (configFile >> "CfgWeapons" >> "Put" >> "Muzzles");
|
_allMuzzles = getArray (configFile >> "CfgWeapons" >> "Put" >> "Muzzles");
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
17 - Grenades
|
17 - Grenades
|
||||||
17 - Unsure about these, modify script as required, but don't change existing structure
|
17 - Unsure about these, modify script as required, but don't change existing structure
|
||||||
*/
|
*/
|
||||||
private ["_item"];
|
private ["_item","_cat","_type"];
|
||||||
params [["_item","",[""]]];
|
params [["_item","",[""]]];
|
||||||
if (_item == "") exitWith {false};
|
if (_item == "") exitWith {false};
|
||||||
|
|
||||||
@ -62,14 +62,3 @@ if (_type == "Grenade") exitWith {17};
|
|||||||
if (_type in ["Magazine","Shotgun","FirstAidKit","LaserDesignator","Medikit","MineDetector","Toolkit","VehicleWeapon","Unknown","UnknownEquipment","UnknownWeapon"]) exitWith {18};
|
if (_type in ["Magazine","Shotgun","FirstAidKit","LaserDesignator","Medikit","MineDetector","Toolkit","VehicleWeapon","Unknown","UnknownEquipment","UnknownWeapon"]) exitWith {18};
|
||||||
|
|
||||||
0
|
0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,9 +162,6 @@ if (EPOCH_debugMode) then {
|
|||||||
// player to player trade loop
|
// player to player trade loop
|
||||||
call EPOCH_TradeLoop;
|
call EPOCH_TradeLoop;
|
||||||
|
|
||||||
//Updates favorites bar
|
|
||||||
call epoch_favBar_refresh;
|
|
||||||
|
|
||||||
// blank out unused hud elements and prepare for next loop
|
// blank out unused hud elements and prepare for next loop
|
||||||
_hudIndex = missionNamespace getVariable [format["EPOCH_dynHUD_%1","topRight"],1];
|
_hudIndex = missionNamespace getVariable [format["EPOCH_dynHUD_%1","topRight"],1];
|
||||||
for "_i" from _hudIndex to 9 do {
|
for "_i" from _hudIndex to 9 do {
|
||||||
|
2
Sources/epoch_code/compile/setup/masterLoop/Event8.sqf
Normal file
2
Sources/epoch_code/compile/setup/masterLoop/Event8.sqf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
//Updates favorites bar
|
||||||
|
call epoch_favBar_refresh;
|
35
Sources/epoch_code/compile/traders/EPOCH_calcDamageCost.sqf
Normal file
35
Sources/epoch_code/compile/traders/EPOCH_calcDamageCost.sqf
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
Author: Raimonds Virtoss - EpochMod.com
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
|
||||||
|
Description: Takes in total cost of vehicle and returns new price with damage % taken into account
|
||||||
|
|
||||||
|
Licence:
|
||||||
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||||
|
|
||||||
|
Github:
|
||||||
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/scripts/favBar/epoch_favBar_refresh.sqf
|
||||||
|
|
||||||
|
Usage: [_vehOBJ,_costINT] call EPOCH_calcDamageCost;
|
||||||
|
*/
|
||||||
|
|
||||||
|
private ["_dmg","_hitPoints"];
|
||||||
|
params [["_obj",objNull, [objNull]],["_cost",0, [0]]];
|
||||||
|
|
||||||
|
if (_obj isEqualTo objNull) exitWith {-1};
|
||||||
|
|
||||||
|
_hitPoints = getAllHitPointsDamage _obj;
|
||||||
|
_totalHPoints = count (_hitPoints select 1);
|
||||||
|
_totalDamagedPoints = 0;
|
||||||
|
{
|
||||||
|
_dmg = _hitPoints select 2 select _forEachIndex;
|
||||||
|
if (_dmg > 0) then {
|
||||||
|
_totalDamagedPoints = _totalDamagedPoints +1;
|
||||||
|
};
|
||||||
|
} forEach (_hitPoints select 1);
|
||||||
|
|
||||||
|
_math = round (_totalDamagedPoints / _totalHPoints * 100);
|
||||||
|
_newCost = _cost - _math;
|
||||||
|
|
||||||
|
_newCost
|
@ -1,5 +1,5 @@
|
|||||||
//[[[cog import generate_private_arrays ]]]
|
//[[[cog import generate_private_arrays ]]]
|
||||||
private ["_aiItems","_allowAdd","_array","_config","_cryptoCount","_index","_item","_itemClasses","_itemQtys","_itemTax","_itemWorth","_limit","_qtyIndex","_sizeOut","_slot","_stockLimit","_tax","_uiItem","_worth"];
|
private ["_errormsg","_aiItems","_allowAdd","_array","_config","_cryptoCount","_index","_item","_itemClasses","_itemQtys","_itemTax","_itemWorth","_limit","_qtyIndex","_sizeOut","_slot","_stockLimit","_tax","_uiItem","_worth"];
|
||||||
//[[[end]]]
|
//[[[end]]]
|
||||||
params ["_control","_selected"];
|
params ["_control","_selected"];
|
||||||
|
|
||||||
@ -8,6 +8,7 @@ if !(isNull EPOCH_lastNPCtradeTarget) then {
|
|||||||
_allowAdd = true;
|
_allowAdd = true;
|
||||||
_stockLimit = false;
|
_stockLimit = false;
|
||||||
_uiItem = (_selected select 0) lbData (_selected select 1);
|
_uiItem = (_selected select 0) lbData (_selected select 1);
|
||||||
|
_errormsg = "Limit one per trade";
|
||||||
|
|
||||||
_config = 'CfgPricing' call EPOCH_returnConfig;
|
_config = 'CfgPricing' call EPOCH_returnConfig;
|
||||||
if (isClass(_config >> _uiItem)) then{
|
if (isClass(_config >> _uiItem)) then{
|
||||||
@ -33,6 +34,23 @@ if !(isNull EPOCH_lastNPCtradeTarget) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (_uiItem isKindOf "Air" || _uiItem isKindOf "Ship" || _uiItem isKindOf "LandVehicle" || _uiItem isKindOf "Tank") then {
|
if (_uiItem isKindOf "Air" || _uiItem isKindOf "Ship" || _uiItem isKindOf "LandVehicle" || _uiItem isKindOf "Tank") then {
|
||||||
|
if (["CfgEpochClient", "DisallowSellOnDamage", false] call EPOCH_fnc_returnConfigEntryV2) then {
|
||||||
|
{
|
||||||
|
_vehicle = _x;
|
||||||
|
if (local _vehicle && (typeof _vehicle) isequalto _uiItem) then {
|
||||||
|
{
|
||||||
|
if ((["wheel",tolower _x] call bis_fnc_instring) || _x isequalto "HitEngine") then {
|
||||||
|
if (((getAllHitPointsDamage _vehicle) select 2 select _foreachindex) >= 1) then {
|
||||||
|
_allowAdd = false;
|
||||||
|
_errormsg = "Cannot be sold - too much damage";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (!_allowAdd) exitwith {};
|
||||||
|
} foreach ((getAllHitPointsDamage _vehicle) select 0);
|
||||||
|
};
|
||||||
|
if (!_allowAdd) exitwith {};
|
||||||
|
} foreach (EPOCH_lastNPCtradeTarget nearEntities[[_uiItem], 30]);
|
||||||
|
};
|
||||||
|
|
||||||
// check if a vehicle is already on the list
|
// check if a vehicle is already on the list
|
||||||
_sizeOut = lbSize 41501;
|
_sizeOut = lbSize 41501;
|
||||||
@ -94,7 +112,7 @@ if !(isNull EPOCH_lastNPCtradeTarget) then {
|
|||||||
if (_stockLimit) then{
|
if (_stockLimit) then{
|
||||||
["Trader has the maximum amount of this item", 5] call Epoch_message;
|
["Trader has the maximum amount of this item", 5] call Epoch_message;
|
||||||
} else {
|
} else {
|
||||||
["Limit one per trade", 5] call Epoch_message;
|
[_errormsg, 5] call Epoch_message;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
Usage: none
|
Usage: none
|
||||||
*/
|
*/
|
||||||
private ["_item","_slot"];
|
private ["_item","_slot","_dsp","_kee","_tileIdx","_itemHasInteraction","_force","_errorCode","_curSlot","_Fav_DropIfOverflow","_Fav_FastWeaponSwitching"];
|
||||||
params ["_dsp","_kee"];
|
params ["_dsp","_kee"];
|
||||||
|
|
||||||
_tileIdx = switch (_kee) do {
|
_tileIdx = switch (_kee) do {
|
||||||
@ -30,15 +30,18 @@ _itemHasInteraction = str(missionConfigFile >> "CfgItemInteractions" >> _item) !
|
|||||||
if (_itemHasInteraction) then {
|
if (_itemHasInteraction) then {
|
||||||
EPOCH_InteractedItem = ["",_item,""];
|
EPOCH_InteractedItem = ["",_item,""];
|
||||||
[] call EPOCH_consumeItem;
|
[] call EPOCH_consumeItem;
|
||||||
|
EPOCH_favBar_itemConsumed = true;
|
||||||
} else {
|
} else {
|
||||||
|
_Fav_DropIfOverflow = ["CfgEpochClient", "Fav_DropIfOverflow", false] call EPOCH_fnc_returnConfigEntryV2;
|
||||||
_slot = _item call epoch_itemTypeSlot;
|
_slot = _item call epoch_itemTypeSlot;
|
||||||
_force = if (_slot in [3,4,5,7,8,10,11,16]) then {true} else {false}; //see how it works with other items, definitely keep true for weapons
|
_force = if (_slot in [3,4,5,7,8,10,11,16]) then {true} else {false}; //see how it works with other items, definitely keep true for weapons
|
||||||
_errorCode = [_item,EPOCH_fav_DropIfOverflow,_force] call epoch_equip;
|
_errorCode = [_item,_Fav_DropIfOverflow,_force] call epoch_equip;
|
||||||
player selectWeapon _item;
|
player selectWeapon _item;
|
||||||
|
|
||||||
if (_slot in [3,4,5]) then {
|
if (_slot in [3,4,5]) then {
|
||||||
_curSlot = _item call epoch_itemTypeSlot;
|
_curSlot = _item call epoch_itemTypeSlot;
|
||||||
if (_curSlot == _slot && !EPOCH_fav_FastWeaponSwitching && _errorCode in [1,2]) then {player playAction "reloadMagazine";};
|
_Fav_FastWeaponSwitching = ["CfgEpochClient", "Fav_FastWeaponSwitching", false] call EPOCH_fnc_returnConfigEntryV2;
|
||||||
|
if (_curSlot == _slot && !_Fav_FastWeaponSwitching && _errorCode in [1,2]) then {player playAction "reloadMagazine";};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_errorCode isEqualTo 2) then {"Not enough space, item dropped on the ground!" call epoch_message;};
|
if (_errorCode isEqualTo 2) then {"Not enough space, item dropped on the ground!" call epoch_message;};
|
||||||
@ -46,5 +49,4 @@ if (_itemHasInteraction) then {
|
|||||||
if (_errorCode isEqualTo 3) then {"Item not found!" call epoch_message;};
|
if (_errorCode isEqualTo 3) then {"Item not found!" call epoch_message;};
|
||||||
if (_errorCode isEqualTo 5) then {"No compatible weapon found!" call epoch_message;};
|
if (_errorCode isEqualTo 5) then {"No compatible weapon found!" call epoch_message;};
|
||||||
};
|
};
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -14,22 +14,27 @@
|
|||||||
Usage: none
|
Usage: none
|
||||||
*/
|
*/
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
private ["_action","_idx","_bidx","_mod","_baritems","_Fav_BannedItems"];
|
||||||
params ["_action","_idx","_bidx","_mod"];
|
params ["_action","_idx","_bidx","_mod"];
|
||||||
|
_Fav_BannedItems = ["CfgEpochClient", "Fav_BannedItems", []] call EPOCH_fnc_returnConfigEntryV2;
|
||||||
|
|
||||||
switch _action do {
|
switch _action do {
|
||||||
case "load":
|
case "load":
|
||||||
{
|
{
|
||||||
if (EPOCH_fav_resetOnLogin) then {
|
private ["_tmp","_c","_p"];
|
||||||
profileNamespace setVariable ["rmx_var_favBar_MNone",nil];
|
|
||||||
profileNamespace setVariable ["rmx_var_favBar_MCtrl",nil];
|
|
||||||
profileNamespace setVariable ["rmx_var_favBar_MShift",nil];
|
|
||||||
profileNamespace setVariable ["rmx_var_favBar_MAlt",nil];
|
|
||||||
};
|
|
||||||
rmx_var_favBar_MNone = profileNamespace getVariable ["rmx_var_favBar_MNone",["","","","",""]];
|
rmx_var_favBar_MNone = profileNamespace getVariable ["rmx_var_favBar_MNone",["","","","",""]];
|
||||||
rmx_var_favBar_MCtrl = profileNamespace getVariable ["rmx_var_favBar_MCtrl",["","","","",""]];
|
rmx_var_favBar_MCtrl = profileNamespace getVariable ["rmx_var_favBar_MCtrl",["","","","",""]];
|
||||||
rmx_var_favBar_MShift = profileNamespace getVariable ["rmx_var_favBar_MShift",["","","","",""]];
|
rmx_var_favBar_MShift = profileNamespace getVariable ["rmx_var_favBar_MShift",["","","","",""]];
|
||||||
rmx_var_favBar_MAlt = profileNamespace getVariable ["rmx_var_favBar_MAlt",["","","","",""]];
|
rmx_var_favBar_MAlt = profileNamespace getVariable ["rmx_var_favBar_MAlt",["","","","",""]];
|
||||||
|
{
|
||||||
|
_baritems = _x;
|
||||||
|
{
|
||||||
|
if (_x in _Fav_BannedItems) then {
|
||||||
|
_baritems set [_foreachindex,""];
|
||||||
|
};
|
||||||
|
} foreach _x;
|
||||||
|
} foreach [rmx_var_favBar_MNone,rmx_var_favBar_MCtrl,rmx_var_favBar_MShift,rmx_var_favBar_MAlt];
|
||||||
|
|
||||||
rmx_var_favBar_current = rmx_var_favBar_MNone;
|
rmx_var_favBar_current = rmx_var_favBar_MNone;
|
||||||
|
|
||||||
waitUntil {uiSleep 0.1; ctrlShown (["fav_equipped", 1] call epoch_getHUDCtrl)};
|
waitUntil {uiSleep 0.1; ctrlShown (["fav_equipped", 1] call epoch_getHUDCtrl)};
|
||||||
@ -46,19 +51,13 @@ switch _action do {
|
|||||||
_c ctrlCommit 0;
|
_c ctrlCommit 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
"draw_current" call epoch_favBar_draw;
|
call epoch_favBar_drawCurrent;
|
||||||
call epoch_favBar_refresh;
|
call epoch_favBar_refresh;
|
||||||
};
|
};
|
||||||
case "draw_current":
|
|
||||||
{
|
|
||||||
for "_i" from 0 to 4 do {
|
|
||||||
_c = (["fav_pic", _i+1] call epoch_getHUDCtrl);
|
|
||||||
_c ctrlSetText ((rmx_var_favBar_current select _i) call EPOCH_itemPicture);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
case "add":
|
case "add":
|
||||||
{
|
{
|
||||||
if (rmx_var_favBar_Item in EPOCH_fav_BannedItems) exitWith {"Item is not allowed in favorites!" call epoch_message; false};
|
private ["_type","_isBanned","_isAmmo","_isChemlight","_itemIsWeapon","_itemHasInteraction","_c"];
|
||||||
|
if (rmx_var_favBar_Item in _Fav_BannedItems) exitWith {"Item is not allowed in favorites!" call epoch_message; false};
|
||||||
if (rmx_var_favBar_Item in rmx_var_favBar_current) exitWith {"Item already exists in favorites!" call epoch_message; false}; //if duplicate
|
if (rmx_var_favBar_Item in rmx_var_favBar_current) exitWith {"Item already exists in favorites!" call epoch_message; false}; //if duplicate
|
||||||
|
|
||||||
_type = (rmx_var_favBar_Item call BIS_fnc_itemType) select 1;
|
_type = (rmx_var_favBar_Item call BIS_fnc_itemType) select 1;
|
||||||
@ -115,31 +114,10 @@ switch _action do {
|
|||||||
_c ctrlSetText "";
|
_c ctrlSetText "";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "modifier":
|
|
||||||
{
|
|
||||||
switch EPOCH_modKeys do {
|
|
||||||
case [true,false,false]: //shift
|
|
||||||
{
|
|
||||||
rmx_var_favBar_current = rmx_var_favBar_MShift;
|
|
||||||
};
|
|
||||||
case [false,true,false]: //Ctrl
|
|
||||||
{
|
|
||||||
rmx_var_favBar_current = rmx_var_favBar_MCtrl;
|
|
||||||
};
|
|
||||||
case [false,false,true]: //Alt
|
|
||||||
{
|
|
||||||
rmx_var_favBar_current = rmx_var_favBar_MAlt;
|
|
||||||
};
|
|
||||||
default { //Any other combo or no modifier
|
|
||||||
rmx_var_favBar_current = rmx_var_favBar_MNone;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
'draw_current' call epoch_favBar_draw;
|
|
||||||
call epoch_favBar_refresh;
|
|
||||||
};
|
|
||||||
default {systemChat "fail"};
|
default {systemChat "fail"};
|
||||||
};
|
};
|
||||||
|
|
||||||
for "_i" from 1 to 5 do {
|
for "_i" from 1 to 5 do {
|
||||||
(["fav_pic_bg", _i] call epoch_getHUDCtrl) ctrlSetText "x\addons\a3_epoch_code\Data\UI\favbar\fav_bg.paa";
|
(["fav_pic_bg", _i] call epoch_getHUDCtrl) ctrlSetText "x\addons\a3_epoch_code\Data\UI\favbar\fav_bg.paa";
|
||||||
};
|
};
|
||||||
|
true
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
for "_i" from 0 to 4 do {
|
||||||
|
_c = (["fav_pic", _i+1] call epoch_getHUDCtrl);
|
||||||
|
_c ctrlSetText ((rmx_var_favBar_current select _i) call EPOCH_itemPicture);
|
||||||
|
};
|
||||||
|
true
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
RETURNS: classname for item in inventory
|
RETURNS: classname for item in inventory
|
||||||
*/
|
*/
|
||||||
|
private ["_return","_dispName","_idx","_className"];
|
||||||
(_this select 1 select 0) params ["_dispName","_idx","_className"];
|
(_this select 1 select 0) params ["_dispName","_idx","_className"];
|
||||||
_return = "";
|
_return = "";
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
Usage: none
|
Usage: none
|
||||||
*/
|
*/
|
||||||
|
private ["_item","_ammo","_cnt"];
|
||||||
//switch
|
//switch
|
||||||
|
|
||||||
_item = switch (_this) do {
|
_item = switch (_this) do {
|
||||||
|
@ -24,8 +24,9 @@
|
|||||||
|
|
||||||
Usage: none
|
Usage: none
|
||||||
*/
|
*/
|
||||||
//TODO: Maybe - spawn IDC cleanup thread, wait until display closes
|
private ["_display","_c","_gIdx","_g"];
|
||||||
if !(EPOCH_fav_enableFavoriteBar) exitWith {false};
|
|
||||||
|
if !(["CfgEpochClient", "Fav_enableFavoriteBar", true] call EPOCH_fnc_returnConfigEntryV2) exitWith {false};
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
waitUntil {!isNull findDisplay 602};
|
waitUntil {!isNull findDisplay 602};
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ rmx_var_fav_selected = false;
|
|||||||
//(_this select 1 select 0 select 2)
|
//(_this select 1 select 0 select 2)
|
||||||
{
|
{
|
||||||
_c = _display displayCtrl _x;
|
_c = _display displayCtrl _x;
|
||||||
_c ctrlAddEventHandler ["MouseButtonDown",(format ["'modifier' spawn epoch_favBar_draw; rmx_var_favBar_Item = %1 call epoch_favBar_getItemByIDC; rmx_var_fav_selected = true",_x])];
|
_c ctrlAddEventHandler ["MouseButtonDown",(format ["call epoch_favBar_modifier; rmx_var_favBar_Item = %1 call epoch_favBar_getItemByIDC; rmx_var_fav_selected = true",_x])];
|
||||||
} forEach [610,620,641,622,621,644,623,611,624,642,626,625,627,612,628,643,630,629,631,6240,6216,6217,6238];
|
} forEach [610,620,641,622,621,644,623,611,624,642,626,625,627,612,628,643,630,629,631,6240,6216,6217,6238];
|
||||||
|
|
||||||
_gIdx = 0;
|
_gIdx = 0;
|
||||||
@ -74,6 +75,7 @@ for "_i" from 1 to 5 do {
|
|||||||
(["fav_pic_bg", _i] call epoch_getHUDCtrl) ctrlShow true;
|
(["fav_pic_bg", _i] call epoch_getHUDCtrl) ctrlShow true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
true
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
_crl = _display displayCtrl _x;
|
_crl = _display displayCtrl _x;
|
||||||
@ -86,19 +88,3 @@ _c ctrlCommit 0;
|
|||||||
//Listboxes?
|
//Listboxes?
|
||||||
//6325,1241
|
//6325,1241
|
||||||
//619,638,633
|
//619,638,633
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
switch EPOCH_modKeys do {
|
||||||
|
case [true,false,false]:{rmx_var_favBar_current = rmx_var_favBar_MShift;};
|
||||||
|
case [false,true,false]:{rmx_var_favBar_current = rmx_var_favBar_MCtrl;};
|
||||||
|
case [false,false,true]:{rmx_var_favBar_current = rmx_var_favBar_MAlt;};
|
||||||
|
default {rmx_var_favBar_current = rmx_var_favBar_MNone;};
|
||||||
|
};
|
||||||
|
call epoch_favBar_drawCurrent;
|
||||||
|
call epoch_favBar_refresh;
|
||||||
|
true
|
@ -14,7 +14,8 @@
|
|||||||
Usage: none
|
Usage: none
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if !(EPOCH_fav_enableFavoriteBar) exitWith {false};
|
if !(["CfgEpochClient", "Fav_enableFavoriteBar", true] call EPOCH_fnc_returnConfigEntryV2) exitWith {false};
|
||||||
|
private ["_playerItems","_equipped","_mod","_txt"];
|
||||||
|
|
||||||
_playerItems = itemsWithMagazines player;
|
_playerItems = itemsWithMagazines player;
|
||||||
_equipped = [primaryWeapon player, secondaryWeapon player, handgunWeapon player, headgear player, goggles player, hmd player, binocular player];
|
_equipped = [primaryWeapon player, secondaryWeapon player, handgunWeapon player, headgear player, goggles player, hmd player, binocular player];
|
||||||
@ -59,3 +60,4 @@ for "_i" from 1 to 5 do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}forEach rmx_var_favBar_current;
|
}forEach rmx_var_favBar_current;
|
||||||
|
true
|
@ -62,20 +62,10 @@ rmx_var_dynamicHUD_groups = [];
|
|||||||
rmx_var_dynamicHUD_groupCTRL = [];
|
rmx_var_dynamicHUD_groupCTRL = [];
|
||||||
|
|
||||||
//Favorites bar
|
//Favorites bar
|
||||||
|
EPOCH_favBar_itemConsumed = false;
|
||||||
rmx_var_favBar_Item = "";
|
rmx_var_favBar_Item = "";
|
||||||
EPOCH_modKeys = [false,false,false];
|
EPOCH_modKeys = [false,false,false];
|
||||||
|
|
||||||
//If disabled, players will not be able to use favorite bar
|
|
||||||
EPOCH_fav_enableFavoriteBar = true;
|
|
||||||
//If enabled, same slot weapons from favorites bar are equipped instantly, otherwise reload action is played (recommended for immersion)
|
|
||||||
EPOCH_fav_FastWeaponSwitching = false;
|
|
||||||
//If enabled and inventory full, equipped weapon will be dropped on ground in favor for the new selected weapon, otherwise action will fail with message and weapon will not be equipped
|
|
||||||
EPOCH_fav_DropIfOverflow = false;
|
|
||||||
//Items that users are not allowed to pin
|
|
||||||
EPOCH_fav_BannedItems = ["FAK"]; //add items that can be abused here
|
|
||||||
//Reset all favorite items on every login (players will be required to re-add everything again).
|
|
||||||
EPOCH_fav_resetOnLogin = true;
|
|
||||||
|
|
||||||
["EPOCH_onEachFrame", "onEachFrame", EPOCH_onEachFrame] call BIS_fnc_addStackedEventHandler;
|
["EPOCH_onEachFrame", "onEachFrame", EPOCH_onEachFrame] call BIS_fnc_addStackedEventHandler;
|
||||||
|
|
||||||
// Custom Keys
|
// Custom Keys
|
||||||
|
@ -72,6 +72,7 @@ class CfgClientFunctions
|
|||||||
class tradeFilter {};
|
class tradeFilter {};
|
||||||
class takeCrypto {};
|
class takeCrypto {};
|
||||||
class startBankTransfer {};
|
class startBankTransfer {};
|
||||||
|
class calcDamageCost {};
|
||||||
};
|
};
|
||||||
class interface_event_handlers
|
class interface_event_handlers
|
||||||
{
|
{
|
||||||
@ -137,6 +138,7 @@ class CfgClientFunctions
|
|||||||
class fnc_spawnEffects {};
|
class fnc_spawnEffects {};
|
||||||
class fnc_arrayStringToBool {};
|
class fnc_arrayStringToBool {};
|
||||||
class client_updatePlayerStat {};
|
class client_updatePlayerStat {};
|
||||||
|
class fnc_getHitPointsDamageAverage {};
|
||||||
};
|
};
|
||||||
class environment
|
class environment
|
||||||
{
|
{
|
||||||
@ -325,11 +327,13 @@ class CfgClientFunctions
|
|||||||
class favBar {
|
class favBar {
|
||||||
file = "epoch_code\gui\scripts\favBar";
|
file = "epoch_code\gui\scripts\favBar";
|
||||||
class favBar_draw {};
|
class favBar_draw {};
|
||||||
|
class favBar_drawCurrent {};
|
||||||
class favBar_refresh {};
|
class favBar_refresh {};
|
||||||
class favBar_action{};
|
class favBar_action{};
|
||||||
class favBar_getItemByIDC {};
|
class favBar_getItemByIDC {};
|
||||||
class favBar_inventory {};
|
class favBar_inventory {};
|
||||||
class favBar_getGearItem {};
|
class favBar_getGearItem {};
|
||||||
|
class favBar_modifier {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -93,9 +93,17 @@ class CfgEpochClient
|
|||||||
playerRevengeMinAliveTime = 900;
|
playerRevengeMinAliveTime = 900;
|
||||||
bankTransferTime[] = {0.0006,1.2,0.06};
|
bankTransferTime[] = {0.0006,1.2,0.06};
|
||||||
|
|
||||||
|
// Favorite Bar
|
||||||
|
Fav_enableFavoriteBar = "true"; // If disabled, players will not be able to use favorite bar
|
||||||
|
Fav_DropIfOverflow = "false"; // If enabled and inventory full, equipped weapon will be dropped on ground in favor for the new selected weapon, otherwise action will fail with message and weapon will not be equipped
|
||||||
|
Fav_FastWeaponSwitching = "false"; // If enabled, same slot weapons from favorites bar are equipped instantly, otherwise reload action is played (recommended for immersion)
|
||||||
|
Fav_BannedItems[] = {"FAK"}; // Items that users are not allowed to pin
|
||||||
|
|
||||||
|
// Advanced Vehicle Repair
|
||||||
|
UseAdvancedVehicleRepair = "true"; // Switch On / Off Advanced Vehicle Repair (Does not effect SuppressedCraftingItems !)
|
||||||
|
DisallowSellOnDamage = "false"; // Prevent from selling Vehicles with one or more fully damaged wheel or engine
|
||||||
SuppressedCraftingItems[] = {"VehicleRepair","VehicleRepairLg"}; // Suppresed for usage of "Advanced Vehicle Repair"
|
SuppressedCraftingItems[] = {"VehicleRepair","VehicleRepairLg"}; // Suppresed for usage of "Advanced Vehicle Repair"
|
||||||
UseAdvancedVehicleRepair = "true";
|
VehicleRepairs[] = { // {Hitpoint, dmg to repair, dmg to replace, mat to repair, mat to replace}
|
||||||
VehicleRepairs[] = {
|
|
||||||
{"HitHull",0.33,0.66,"ItemScraps","ItemCorrugated"},
|
{"HitHull",0.33,0.66,"ItemScraps","ItemCorrugated"},
|
||||||
{"HitBody",0.33,1,"ItemScraps","ItemCorrugated"},
|
{"HitBody",0.33,1,"ItemScraps","ItemCorrugated"},
|
||||||
{"HitLFWheel",0.33,1,"VehicleRepair","SpareTire"},
|
{"HitLFWheel",0.33,1,"VehicleRepair","SpareTire"},
|
||||||
|
@ -44,6 +44,10 @@ class CfgMasterLoop
|
|||||||
{
|
{
|
||||||
delay = 600;
|
delay = 600;
|
||||||
};
|
};
|
||||||
|
class Event8
|
||||||
|
{
|
||||||
|
delay = 5; //used for FavBar, adjust as required
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
3
Tools/BAT/paa2png.bat
Normal file
3
Tools/BAT/paa2png.bat
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
rem Adjust path to Pal2PacE.exe below
|
||||||
|
rem Put this batch inside the same folder as your .paa textures, handy for mass extracting data if you have unRapped your game into P:\ drive
|
||||||
|
for %%f in (*.paa) do ( "D:\SteamLibrary\steamapps\common\Arma 3 Tools\TexView2\Pal2PacE.exe" "%%~nf.paa" "%%~nf.png" )
|
1
Tools/BAT/paa2tga.bat
Normal file
1
Tools/BAT/paa2tga.bat
Normal file
@ -0,0 +1 @@
|
|||||||
|
for %%f in (*.paa) do ( "D:\SteamLibrary\steamapps\common\Arma 3 Tools\TexView2\Pal2PacE.exe" "%%~nf.paa" "%%~nf.tga" )
|
Loading…
Reference in New Issue
Block a user