Integrated the Kestrel 4500 into the ace interaction menu

This commit is contained in:
ulteq 2015-04-07 19:57:42 +02:00
parent 9fb26c2d18
commit a4c70fe616
6 changed files with 60 additions and 10 deletions

View File

@ -2,14 +2,34 @@ class CfgVehicles {
class Man; class Man;
class CAManBase: Man { class CAManBase: Man {
class ACE_SelfActions { class ACE_SelfActions {
class ACE_OpenKestrel4500 { class ACE_Equipment {
displayName = "$STR_ACE_Kestrel4500_OpenKestrelDialog"; class GVAR(open) {
condition = QUOTE('ACE_Kestrel4500' in items _player && {!GVAR(Kestrel4500)}); displayName = "$STR_ACE_Kestrel4500_OpenKestrel";
condition = QUOTE(call FUNC(canShow) && !GVAR(Kestrel4500));
statement = QUOTE(call FUNC(createKestrelDialog)); statement = QUOTE(call FUNC(createKestrelDialog));
showDisabled = 0; showDisabled = 0;
priority = 2; priority = 0.1;
icon = PATHTOF(UI\Kestrel4500_Icon.paa); icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa));
hotkey = "K"; exceptions[] = {"notOnMap"};
};
class GVAR(show) {
displayName = "$STR_ACE_Kestrel4500_ShowKestrel";
condition = QUOTE(call FUNC(canShow) && !GVAR(Kestrel4500_Overlay));
statement = QUOTE(call FUNC(displayKestrel));
showDisabled = 0;
priority = 0.2;
icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa));
exceptions[] = {"notOnMap"};
};
class GVAR(hide) {
displayName = "$STR_ACE_Kestrel4500_HideKestrel";
condition = QUOTE(GVAR(Kestrel4500_Overlay));
statement = QUOTE(call FUNC(displayKestrel));
showDisabled = 0;
priority = 0.3;
icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa));
exceptions[] = {"notOnMap"};
};
}; };
}; };
}; };

View File

@ -1,6 +1,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "initKeybinds.sqf" //#include "initKeybinds.sqf"
GVAR(Kestrel4500_Menus) = ["Direction", "Wind SPD m/s", "CROSSWIND m/s", "HEADWIND m/s", "TEMP °C", "HUMIDITY %", "BARO hPA", "ALTITUDE m", "User Screen 1", "User Screen 2"]; GVAR(Kestrel4500_Menus) = ["Direction", "Wind SPD m/s", "CROSSWIND m/s", "HEADWIND m/s", "TEMP °C", "HUMIDITY %", "BARO hPA", "ALTITUDE m", "User Screen 1", "User Screen 2"];

View File

@ -3,6 +3,7 @@
ADDON = false; ADDON = false;
PREP(buttonPressed); PREP(buttonPressed);
PREP(canShow);
PREP(collectData); PREP(collectData);
PREP(createKestrelDialog); PREP(createKestrelDialog);
PREP(displayKestrel); PREP(displayKestrel);

View File

@ -0,0 +1,22 @@
/*
* Authors: Ruthberg
* Tests if the Kestrel 4500 can be shown
*
* Arguments:
* Nothing
*
* Return Value:
* canShow (bool)
*
* Example:
* [mode] call ace_kestrel4500_fnc_canShow
*
* Public: No
*/
#include "script_component.hpp"
private ["_returnValue"];
_returnValue = ("ACE_Kestrel4500" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)} && {!(underwater ACE_player)};
_returnValue

View File

@ -26,6 +26,7 @@ createDialog 'Kestrel4500_Display';
[{ [{
if (!dialog || !GVAR(Kestrel4500)) exitWith { if (!dialog || !GVAR(Kestrel4500)) exitWith {
GVAR(Kestrel4500) = false;
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -16,9 +16,15 @@
<Key ID="STR_ACE_Kestrel_Description"> <Key ID="STR_ACE_Kestrel_Description">
<English>Kestrel 4500 Pocket Weather Tracker</English> <English>Kestrel 4500 Pocket Weather Tracker</English>
</Key> </Key>
<Key ID="STR_ACE_Kestrel4500_OpenKestrelDialog"> <Key ID="STR_ACE_Kestrel4500_OpenKestrel">
<English>Open Kestrel 4500</English> <English>Open Kestrel 4500</English>
</Key> </Key>
<Key ID="STR_ACE_Kestrel4500_ShowKestrel">
<English>Show Kestrel 4500</English>
</Key>
<Key ID="STR_ACE_Kestrel4500_HideKestrel">
<English>Hide Kestrel 4500</English>
</Key>
<Key ID="STR_ACE_Kestrel4500_KestrelDialogKey"> <Key ID="STR_ACE_Kestrel4500_KestrelDialogKey">
<English>Open Kestrel 4500</English> <English>Open Kestrel 4500</English>
</Key> </Key>