mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Initial commit
This commit is contained in:
parent
f98c7dc285
commit
edb76ffae4
8
addons/nightvision/ACE_Settings.hpp
Normal file
8
addons/nightvision/ACE_Settings.hpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
class ACE_Settings {
|
||||||
|
class GVAR(disableNVGsWithSights) {
|
||||||
|
displayName = CSTRING(DisableNVGsWithSights_DisplayName);
|
||||||
|
description = CSTRING(DisableNVGsWithSights_description);
|
||||||
|
typeName = "BOOL";
|
||||||
|
value = 1;
|
||||||
|
};
|
||||||
|
};
|
@ -14,4 +14,28 @@ class CfgVehicles {
|
|||||||
MACRO_ADDITEM(ACE_NVG_Wide,6);
|
MACRO_ADDITEM(ACE_NVG_Wide,6);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ACE_Module;
|
||||||
|
class GVAR(ModuleSettings): ACE_Module {
|
||||||
|
scope = 2;
|
||||||
|
displayName = CSTRING(Module_DisplayName);
|
||||||
|
icon = QUOTE(PATHTOF(UI\Icon_Module_ca.paa));
|
||||||
|
category = "ACE";
|
||||||
|
function = QUOTE(FUNC(initModule));
|
||||||
|
functionPriority = 1;
|
||||||
|
isGlobal = 1;
|
||||||
|
isTriggerActivated = 0;
|
||||||
|
author = "BaerMitUmlaut";
|
||||||
|
class Arguments {
|
||||||
|
class disableNVGsWithSights {
|
||||||
|
displayName = CSTRING(DisableNVGsWithSights_DisplayName);
|
||||||
|
description = CSTRING(DisableNVGsWithSights_Description);
|
||||||
|
typeName = "BOOL";
|
||||||
|
defaultValue = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class ModuleDescription {
|
||||||
|
description = CSTRING(Module_Description);
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
BIN
addons/nightvision/UI/Icon_Module_ca.paa
Normal file
BIN
addons/nightvision/UI/Icon_Module_ca.paa
Normal file
Binary file not shown.
@ -30,9 +30,15 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
|||||||
|
|
||||||
// Setup the event handlers
|
// Setup the event handlers
|
||||||
["playerInventoryChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
["playerInventoryChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||||
["playerVisionModeChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
["playerVisionModeChanged", {
|
||||||
|
_this call FUNC(updatePPEffects);
|
||||||
|
_this call FUNC(handleNVGs);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
["zeusDisplayChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
["zeusDisplayChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||||
["cameraViewChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
["cameraViewChanged", {
|
||||||
|
_this call FUNC(updatePPEffects);
|
||||||
|
_this call FUNC(handleNVGs);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||||
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
@ -64,3 +70,5 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
|||||||
},
|
},
|
||||||
{false},
|
{false},
|
||||||
[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT
|
[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT
|
||||||
|
|
||||||
|
GVAR(reenableNVGs) = false;
|
||||||
|
@ -4,6 +4,8 @@ ADDON = false;
|
|||||||
|
|
||||||
PREP(blending);
|
PREP(blending);
|
||||||
PREP(changeNVGBrightness);
|
PREP(changeNVGBrightness);
|
||||||
|
PREP(handleNVGs);
|
||||||
|
PREP(initModule);
|
||||||
PREP(updatePPEffects);
|
PREP(updatePPEffects);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -15,3 +15,4 @@ class CfgPatches {
|
|||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
#include "CfgWeapons.hpp"
|
#include "CfgWeapons.hpp"
|
||||||
|
#include "ACE_Settings.hpp"
|
||||||
|
31
addons/nightvision/functions/fnc_handleNVGs.sqf
Normal file
31
addons/nightvision/functions/fnc_handleNVGs.sqf
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Author: BaerMitUmlaut
|
||||||
|
* Disables NVGs when the player aims down his sight.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unit <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player] call ace_nightvision_fnc_disableNVGs
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
|
if (GVAR(disableNVGsWithSights) && {(vehicle _unit == _unit) || {isTurnedOut _unit}}) then {
|
||||||
|
if ((cameraView == "GUNNER") && {currentVisionMode _unit > 0}) then {
|
||||||
|
_unit action ["NVGogglesOff", _unit];
|
||||||
|
GVAR(reenableNVGs) = true;
|
||||||
|
} else {
|
||||||
|
if (GVAR(reenableNVGs) && {cameraView != "GUNNER"}) then {
|
||||||
|
_unit action ["NVGoggles", _unit];
|
||||||
|
GVAR(reenableNVGs) = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
21
addons/nightvision/functions/fnc_initModule.sqf
Normal file
21
addons/nightvision/functions/fnc_initModule.sqf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Author: BaerMitUmlaut
|
||||||
|
* Initializes the settings for the disable NVGs in sight module.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Module <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [_module] call ace_nightvision_fnc_initModule
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_module"];
|
||||||
|
|
||||||
|
[_module, QGVAR(disableNVGsWithSights), "disableNVGsWithSights"] call EFUNC(common,readSettingFromModule);
|
@ -133,5 +133,21 @@
|
|||||||
<Portuguese>Diminuir Luminosidade do EVN</Portuguese>
|
<Portuguese>Diminuir Luminosidade do EVN</Portuguese>
|
||||||
<Italian>Riduci la luminosità dell'NVG</Italian>
|
<Italian>Riduci la luminosità dell'NVG</Italian>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_NightVision_Module_DisplayName">
|
||||||
|
<English>Nightvision</English>
|
||||||
|
<German>Nachtsicht</German>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_NightVision_Module_Description">
|
||||||
|
<English>Settings for night vision.</English>
|
||||||
|
<German>Einstellungen für Nachtsichtgeräte.</German>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_NightVision_DisableNVGsWithSights_DisplayName">
|
||||||
|
<English>Disable NVGs in scope</English>
|
||||||
|
<German>Deakt. NVGs mit Visier</German>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_NightVision_DisableNVGsWithSights_Description">
|
||||||
|
<English>Blocks the usage of night vision goggles whilst aiming down the sight.</English>
|
||||||
|
<German>Blockiert das Benutzen von Nachtsichtbrillen beim Benutzen des Visiers.</German>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
Binary file not shown.
After Width: | Height: | Size: 552 B |
Loading…
Reference in New Issue
Block a user