mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
AirResit Module Setting / Charge Display ctrl
This commit is contained in:
parent
1726b787f7
commit
e71378f9b3
@ -33,9 +33,15 @@ class CfgVehicles {
|
|||||||
// icon = QUOTE(PATHTOF(UI\Icon_.paa));
|
// icon = QUOTE(PATHTOF(UI\Icon_.paa));
|
||||||
functionPriority = 0;
|
functionPriority = 0;
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class noComputer {
|
class disableComputerRangefinder {
|
||||||
displayName = "No Computer";
|
displayName = "Remove MK6 Computer/Rangefinder";
|
||||||
description = "Removes Computer and Rangefinder";
|
description = "Removes Computer and Rangefinder (these should be removed if you enable air resistance)";
|
||||||
|
typeName = "BOOL";
|
||||||
|
defaultValue = 1;
|
||||||
|
};
|
||||||
|
class airResistanceEnabled {
|
||||||
|
displayName = "Air Resitance";
|
||||||
|
description = "For Player Shots, Model Air Restiance and Wind Effects";
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
};
|
};
|
||||||
|
BIN
addons/mk6mortar/UI/ui_charges.paa
Normal file
BIN
addons/mk6mortar/UI/ui_charges.paa
Normal file
Binary file not shown.
@ -25,12 +25,12 @@ class ACE_Settings {
|
|||||||
isClientSetable = 1;
|
isClientSetable = 1;
|
||||||
displayName = "$STR_ACE_mk6mortar_useMils";
|
displayName = "$STR_ACE_mk6mortar_useMils";
|
||||||
};
|
};
|
||||||
// class GVAR(airResistance) {
|
class GVAR(airResistanceEnabled) {
|
||||||
// value = 0;
|
value = 0;
|
||||||
// typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
// isClientSetable = 0;
|
isClientSetable = 0;
|
||||||
// };
|
};
|
||||||
class GVAR(noComputer) {
|
class GVAR(disableComputerRangefinder) {
|
||||||
value = 0;
|
value = 0;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
isClientSetable = 0;
|
isClientSetable = 0;
|
||||||
|
@ -24,6 +24,12 @@ disableSerialization;
|
|||||||
|
|
||||||
PARAMS_7(_vehicle,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
PARAMS_7(_vehicle,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
||||||
|
|
||||||
|
if (!GVAR(airResistanceEnabled)) exitWith {};
|
||||||
|
|
||||||
|
if (_unit distance ACE_player > 3000) exitWith {false}; // Large enough distance to not simulate any wind deflection.
|
||||||
|
if (!GVAR(EnableForAI) && !([_unit] call EFUNC(common,isPlayer))) exitWith {false};
|
||||||
|
|
||||||
|
|
||||||
// if (_bullet isKindOf "BulletBase") then {
|
// if (_bullet isKindOf "BulletBase") then {
|
||||||
[{
|
[{
|
||||||
private ["_deltaT", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_dragRef", "_accelRef", "_drag", "_accel"];
|
private ["_deltaT", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_dragRef", "_accelRef", "_drag", "_accel"];
|
||||||
|
@ -17,15 +17,30 @@ PARAMS_2(_player,_newVehicle);
|
|||||||
if (isNull _newVehicle) exitWith {};
|
if (isNull _newVehicle) exitWith {};
|
||||||
if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
|
if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_chargeText = (findDisplay 46) ctrlCreate ["RscStructuredText", 80085];
|
||||||
|
|
||||||
|
_xPos = (profilenamespace getvariable ["IGUI_GRID_WEAPON_X", ((safezoneX + safezoneW) - (12.4 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))]);
|
||||||
|
_yPos = 2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getvariable ["IGUI_GRID_WEAPON_Y", (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]);
|
||||||
|
_wPos = 10 * (((safezoneW / safezoneH) min 1.2) / 40);
|
||||||
|
_hPos = 1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25);
|
||||||
|
|
||||||
|
_chargeText ctrlSetPosition [_xPos, _yPos, _wPos, _hPos];
|
||||||
|
_chargeText ctrlCommit 0;
|
||||||
|
|
||||||
[{
|
[{
|
||||||
PARAMS_2(_args,_pfID);
|
PARAMS_2(_args,_pfID);
|
||||||
EXPLODE_1_PVT(_args,_veh);
|
EXPLODE_2_PVT(_args,_veh,_chargeText);
|
||||||
|
|
||||||
if ((vehicle ACE_player) != _veh) then {
|
if ((vehicle ACE_player) != _veh) then {
|
||||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||||
|
ctrlDelete _chargeText;
|
||||||
} else {
|
} else {
|
||||||
if (shownArtilleryComputer && GVAR(noComputer)) then {
|
_text = format ["<t size='0.8'>%1: %2 <img image='%3'/></t>", "Charge", 1, QUOTE(PATHTOF(UI\ui_charges.paa))];
|
||||||
//Don't like this solution
|
_chargeText ctrlSetStructuredText parseText _text;
|
||||||
|
if (shownArtilleryComputer && GVAR(disableComputerRangefinder)) then {
|
||||||
|
//Don't like this solution, but it works
|
||||||
closeDialog 0;
|
closeDialog 0;
|
||||||
[parseText "Computer Disabled"] call EFUNC(common,displayTextStructured);
|
[parseText "Computer Disabled"] call EFUNC(common,displayTextStructured);
|
||||||
};
|
};
|
||||||
@ -39,7 +54,7 @@ if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
|
|||||||
(_display displayCtrl 80175) ctrlSetText str _elevDeg;
|
(_display displayCtrl 80175) ctrlSetText str _elevDeg;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(noComputer)) then {
|
if (GVAR(disableComputerRangefinder)) then {
|
||||||
(_display displayCtrl 80176) ctrlSetText "";
|
(_display displayCtrl 80176) ctrlSetText "";
|
||||||
} else {
|
} else {
|
||||||
_elevDeg = parseNumber ctrlText (_display displayCtrl 176);
|
_elevDeg = parseNumber ctrlText (_display displayCtrl 176);
|
||||||
@ -54,4 +69,4 @@ if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}, 0, [_newVehicle]] call CBA_fnc_addPerFrameHandler;
|
}, 0, [_newVehicle, _chargeText]] call CBA_fnc_addPerFrameHandler;
|
@ -22,4 +22,5 @@ PARAMS_3(_logic,_syncedUnits,_activated);
|
|||||||
if (!_activated) exitWith {WARNING("Module - placed but not active");};
|
if (!_activated) exitWith {WARNING("Module - placed but not active");};
|
||||||
if (!isServer) exitWith {};
|
if (!isServer) exitWith {};
|
||||||
|
|
||||||
[_logic, QGVAR(noComputer), "noComputer"] call EFUNC(common,readSettingFromModule);
|
[_logic, QGVAR(disableComputerRangefinder), "disableComputerRangefinder"] call EFUNC(common,readSettingFromModule);
|
||||||
|
[_logic, QGVAR(airResistanceEnabled), "airResistanceEnabled"] call EFUNC(common,readSettingFromModule);
|
||||||
|
@ -53,7 +53,7 @@ _fnc_hideControl = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
[_x, GVAR(noComputer)] call _fnc_hideControl;
|
[_x, GVAR(disableComputerRangefinder)] call _fnc_hideControl;
|
||||||
} forEach [CTRL_CA_HEADING, CTRL_CA_OPTICSPITCH, CTRL_CA_OPTICSZOOM, CTRL_CA_SOLUTION_TEXT, CTRL_CA_DISTANCE_TEXT, CTRL_CA_DISTANCE, CTRL_CA_TIME_TEXT, CTRL_CA_TIME, CTRL_CA_ELEV_NEED_TEXT, CTRL_CA_RANGEELEMENTS_GROUP];
|
} forEach [CTRL_CA_HEADING, CTRL_CA_OPTICSPITCH, CTRL_CA_OPTICSZOOM, CTRL_CA_SOLUTION_TEXT, CTRL_CA_DISTANCE_TEXT, CTRL_CA_DISTANCE, CTRL_CA_TIME_TEXT, CTRL_CA_TIME, CTRL_CA_ELEV_NEED_TEXT, CTRL_CA_RANGEELEMENTS_GROUP];
|
||||||
|
|
||||||
//Always hide these, handled by the mil convertions in handlePlayerVehChanged
|
//Always hide these, handled by the mil convertions in handlePlayerVehChanged
|
||||||
|
Loading…
Reference in New Issue
Block a user