mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Prototype - Show Mils on mk6
This commit is contained in:
parent
75351f2a5b
commit
e6c7758d3f
1
addons/mk6mortar/$PBOPREFIX$
Normal file
1
addons/mk6mortar/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
|||||||
|
z\ace\Addons\mk6mortar
|
10
addons/mk6mortar/CfgEventHandlers.hpp
Normal file
10
addons/mk6mortar/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Extended_PostInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
|
||||||
|
};
|
||||||
|
};
|
3
addons/mk6mortar/CfgMagazines.hpp
Normal file
3
addons/mk6mortar/CfgMagazines.hpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class CfgMagazines {
|
||||||
|
|
||||||
|
};
|
21
addons/mk6mortar/CfgVehicles.hpp
Normal file
21
addons/mk6mortar/CfgVehicles.hpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
class CfgVehicles {
|
||||||
|
class LandVehicle;
|
||||||
|
class StaticWeapon: LandVehicle {
|
||||||
|
class Turrets {
|
||||||
|
class MainTurret;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class StaticMortar: StaticWeapon {
|
||||||
|
class Turrets: Turrets {
|
||||||
|
class MainTurret: MainTurret {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Mortar_01_base_F: StaticMortar {
|
||||||
|
class Turrets: Turrets {
|
||||||
|
class MainTurret: MainTurret {
|
||||||
|
turretInfoType = "ACE_Mk6_RscWeaponRangeArtillery";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
3
addons/mk6mortar/CfgWeapons.hpp
Normal file
3
addons/mk6mortar/CfgWeapons.hpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class CfgWeapons {
|
||||||
|
|
||||||
|
};
|
10
addons/mk6mortar/README.md
Normal file
10
addons/mk6mortar/README.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
ace_mk6mortar
|
||||||
|
==========
|
||||||
|
|
||||||
|
Tweaks the mk6 mortar from Arma3
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
The people responsible for merging changes to this component or answering potential questions.
|
||||||
|
|
||||||
|
- [PabstMirror](https://github.com/PabstMirror)
|
34
addons/mk6mortar/RscInGameUI.hpp
Normal file
34
addons/mk6mortar/RscInGameUI.hpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
class RscControlsGroup;
|
||||||
|
class RscText;
|
||||||
|
|
||||||
|
class RscInGameUI {
|
||||||
|
class RscWeaponRangeArtillery {
|
||||||
|
class CA_IGUI_elements_group: RscControlsGroup {};
|
||||||
|
};
|
||||||
|
class ACE_Mk6_RscWeaponRangeArtillery: RscWeaponRangeArtillery {
|
||||||
|
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_Mk6_RscWeaponRangeArtillery',(_this select 0))]; _this call FUNC(turretDisplayLoaded););
|
||||||
|
controls[] = {"ACE_MILS_GROUP", "CA_IGUI_elements_group","CA_RangeElements_group"};
|
||||||
|
class ACE_MILS_GROUP: CA_IGUI_elements_group {
|
||||||
|
idc = 80170;
|
||||||
|
class controls {
|
||||||
|
class CA_Elev_MILS: RscText {
|
||||||
|
idc = 80175;
|
||||||
|
style = 1;
|
||||||
|
sizeEx = "0.038*SafezoneH";
|
||||||
|
colorText[] = {0.706,0.0745,0.0196,1};
|
||||||
|
shadow = 0;
|
||||||
|
font = "EtelkaMonospacePro";
|
||||||
|
text = "80.5";
|
||||||
|
x = "36.8 * (0.01875 * SafezoneH)";
|
||||||
|
y = "29.3 * (0.025 * SafezoneH)";
|
||||||
|
w = "5.2 * (0.01875 * SafezoneH)";
|
||||||
|
h = "1.2 * (0.025 * SafezoneH)";
|
||||||
|
};
|
||||||
|
class CA_Elev_Need_MILS: CA_Elev_MILS {
|
||||||
|
idc = 80176;
|
||||||
|
y = "30.8 * (0.025 * SafezoneH)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
6
addons/mk6mortar/XEH_clientInit.sqf
Normal file
6
addons/mk6mortar/XEH_clientInit.sqf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
|
["playerVehicleChanged", {_this call FUNC(handlePlayerVehicleChanged);}] call EFUNC(common,addEventHandler);
|
||||||
|
|
9
addons/mk6mortar/XEH_preInit.sqf
Normal file
9
addons/mk6mortar/XEH_preInit.sqf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP(handleFired);
|
||||||
|
PREP(handlePlayerVehicleChanged);
|
||||||
|
PREP(turretDisplayLoaded);
|
||||||
|
|
||||||
|
ADDON = true;
|
19
addons/mk6mortar/config.cpp
Normal file
19
addons/mk6mortar/config.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ADDON {
|
||||||
|
units[] = {};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
requiredAddons[] = {"ace_interaction"};
|
||||||
|
author[] = {"PabstMirror"};
|
||||||
|
authorUrl = "https://github.com/acemod";
|
||||||
|
VERSION_CONFIG;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
#include "CfgMagazines.hpp"
|
||||||
|
#include "CfgVehicles.hpp"
|
||||||
|
#include "CfgWeapons.hpp"
|
||||||
|
#include "RscInGameUI.hpp"
|
29
addons/mk6mortar/functions/fnc_handleFired.sqf
Normal file
29
addons/mk6mortar/functions/fnc_handleFired.sqf
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: mortar - Object the event handler is assigned to <OBJECT>
|
||||||
|
* 1: weapon - Fired weapon <STRING>
|
||||||
|
* 2: muzzle - Muzzle that was used <STRING>
|
||||||
|
* 3: mode - Current mode of the fired weapon <STRING>
|
||||||
|
* 4: ammo - Ammo used <STRING>
|
||||||
|
* 5: magazine - magazine name which was used <STRING>
|
||||||
|
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [clientFiredBIS-XEH] call ace_grenades_fnc_throwGrenade
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
disableSerialization;
|
||||||
|
|
||||||
|
PARAMS_7(_vehicle,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
PARAMS_2(_player,_newVehicle);
|
||||||
|
|
||||||
|
if (isNull _newVehicle) exitWith {};
|
||||||
|
if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
|
||||||
|
|
||||||
|
[{
|
||||||
|
PARAMS_2(_args,_pfID);
|
||||||
|
EXPLODE_1_PVT(_args,_veh);
|
||||||
|
|
||||||
|
if ((vehicle ACE_player) != _veh) then {
|
||||||
|
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||||
|
} else {
|
||||||
|
_display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull];
|
||||||
|
if (isNull _display) exitWith {systemChat "null";};
|
||||||
|
|
||||||
|
_hideRangefinder = false;
|
||||||
|
|
||||||
|
_elevDeg = parseNumber ctrlText (_display displayCtrl 175);
|
||||||
|
if (true) then {
|
||||||
|
(_display displayCtrl 80175) ctrlSetText str round (_elevDeg * 6400 / 360);
|
||||||
|
hintSilent str (_elevDeg * 6400 / 360);
|
||||||
|
} else {
|
||||||
|
(_display displayCtrl 80175) ctrlSetText str _elevDeg;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_hideRangefinder) then {
|
||||||
|
(_display displayCtrl 80176) ctrlSetText "";
|
||||||
|
} else {
|
||||||
|
_elevDeg = parseNumber ctrlText (_display displayCtrl 176);
|
||||||
|
if (_elevDeg <= 0) then {
|
||||||
|
(_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176));
|
||||||
|
} else {
|
||||||
|
if (true) then {
|
||||||
|
(_display displayCtrl 80176) ctrlSetText str round (_elevDeg * 6400 / 360);
|
||||||
|
} else {
|
||||||
|
(_display displayCtrl 80176) ctrlSetText str _elevDeg;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}, 0, [_newVehicle]] call CBA_fnc_addPerFrameHandler;
|
62
addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf
Normal file
62
addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#define CTRL_CA_HEADING (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_Heading")
|
||||||
|
#define CTRL_CA_OPTICSPITCH (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSPITCH")
|
||||||
|
#define CTRL_CA_OPTICSZOOM (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSZOOM")
|
||||||
|
#define CTRL_CA_SOLUTION_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_SOLUTION_TEXT")
|
||||||
|
#define CTRL_CA_DISTANCE_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_DISTANCE_TEXT")
|
||||||
|
#define CTRL_CA_DISTANCE (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_DISTANCE")
|
||||||
|
#define CTRL_CA_TIME_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_TIME_TEXT")
|
||||||
|
#define CTRL_CA_TIME (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_TIME")
|
||||||
|
#define CTRL_CA_ELEV_NEED_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV_NEED_TEXT")
|
||||||
|
#define CTRL_CA_RANGEELEMENTS_GROUP (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_RangeElements_group")
|
||||||
|
|
||||||
|
#define CTRL_CA_ELEV (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV")
|
||||||
|
#define CTRL_CA_ELEV_NEED (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV_NEED")
|
||||||
|
|
||||||
|
|
||||||
|
disableSerialization;
|
||||||
|
|
||||||
|
// PARAMS_1(_display);
|
||||||
|
_display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull];
|
||||||
|
if (isNull _display) exitWith {};
|
||||||
|
|
||||||
|
_hideRangefinder = true;
|
||||||
|
|
||||||
|
_fnc_hideControl = {
|
||||||
|
PARAMS_2(_path,_hideCtrl);
|
||||||
|
_idc = getNumber (_path >> "IDC");
|
||||||
|
_pos = [];
|
||||||
|
if (_hideCtrl) then {
|
||||||
|
_pos = [-9,-9,0,0];
|
||||||
|
} else {
|
||||||
|
{
|
||||||
|
if (isNumber (_path >> _x)) then {
|
||||||
|
_pos pushBack (getNumber (_path >> _x));
|
||||||
|
} else {
|
||||||
|
_pos pushBack (call compile (getText (_path >> _x)));
|
||||||
|
};
|
||||||
|
} forEach ["x", "y", "w", "h"];
|
||||||
|
};
|
||||||
|
(_display displayCtrl _idc) ctrlSetPosition _pos;
|
||||||
|
(_display displayCtrl _idc) ctrlCommit 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
{
|
||||||
|
[_x, _hideRangefinder] 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];
|
||||||
|
|
||||||
|
[CTRL_CA_ELEV, true] call _fnc_hideControl;
|
||||||
|
[CTRL_CA_ELEV_NEED, true] call _fnc_hideControl;
|
1
addons/mk6mortar/functions/script_component.hpp
Normal file
1
addons/mk6mortar/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "\z\ace\addons\mk6mortar\script_component.hpp"
|
12
addons/mk6mortar/script_component.hpp
Normal file
12
addons/mk6mortar/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#define COMPONENT mk6mortar
|
||||||
|
#include "\z\ace\Addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_MK6MORTAR
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_MK6MORTAR
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_MK6MORTAR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\Addons\main\script_macros.hpp"
|
6
addons/mk6mortar/stringtable.xml
Normal file
6
addons/mk6mortar/stringtable.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Edited with tabler - 2015-01-31 -->
|
||||||
|
<Project name="ACE">
|
||||||
|
<Package name="mk6mortar">
|
||||||
|
</Package>
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user