Add Wipe glasses self interaction (#7307)

This commit is contained in:
Filip Maciejewski 2019-12-18 18:30:53 +01:00 committed by jonpas
parent 654feca3a1
commit 7f62067a7b
9 changed files with 68 additions and 6 deletions

View File

@ -148,6 +148,7 @@ Tonic
Tourorist <tourorist@gmail.com>
Tuupertunut
Valentin Torikian <valentin.torikian@gmail.com>
veteran29
voiper
VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
Winter <simon@agius-muscat.net>

View File

@ -0,0 +1,14 @@
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class ACE_Equipment {
class GVAR(wipeGlasses) {
displayName = CSTRING(WipeGlasses);
condition = QUOTE(GVAR(showClearGlasses) && {call FUNC(canWipeGlasses)});
statement = QUOTE(call FUNC(clearGlasses));
};
};
};
};
};

View File

@ -17,6 +17,7 @@ PREP(isGogglesVisible);
PREP(isInRotorWash);
// general
PREP(canWipeGlasses);
PREP(clearGlasses);
PREP(getExplosionIndex);

View File

@ -3,12 +3,12 @@
if (!hasInterface) exitWith {};
["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), {
if (GVAR(effects) != 2) exitWith {false}; //Can only wipe if full effects setting is set
if (!GETVAR(ace_player,ACE_isUnconscious,false)) exitWith {
// Conditions: specific
if !(call FUNC(canWipeGlasses)) exitWith {false};
call FUNC(clearGlasses);
true
};
false
},
{false},
[20, [true, true, false]], false] call CBA_fnc_addKeybind;

View File

@ -6,4 +6,6 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
ADDON = true;

View File

@ -16,6 +16,7 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#define COMBAT_GOGGLES ACE_Overlay = QPATHTOF(textures\HUD\CombatGoggles.paa); \
ACE_OverlayCracked = QPATHTOF(textures\HUD\CombatGogglesCracked.paa); \

View File

@ -0,0 +1,18 @@
#include "script_component.hpp"
/*
* Author: veteran29
* Checks if player can wipe goggles.
*
* Arguments:
* None
*
* Return Value:
* Can wipe goggles <BOOL>
*
* Example:
* [] call ace_goggles_fnc_canWipeGlasses
*
* Public: No
*/
GVAR(effects) == 2 && {!GETVAR(ACE_player,ACE_isUnconscious,false)} // return

View File

@ -0,0 +1,8 @@
[
QGVAR(showClearGlasses),
"CHECKBOX",
[LSTRING(SettingShowClearGlasses), LSTRING(SettingShowClearGlasses)],
localize LSTRING(SettingsName),
false, // default value
0 // isGlobal
] call CBA_fnc_addSetting;

View File

@ -14,6 +14,19 @@
<Portuguese>Óculos</Portuguese>
<French>Lunettes</French>
</Key>
<Key ID="STR_ACE_Goggles_SettingsName">
<English>ACE Goggles</English>
<German>ACE Schutzbrille</German>
<Italian>ACE Occhiali</Italian>
<Chinese>ACE 護目鏡</Chinese>
<Chinesesimp>ACE 护目镜</Chinesesimp>
<Japanese>ACE ゴーグル</Japanese>
<Korean>ACE 고글</Korean>
<Polish>ACE Gogle</Polish>
<Russian>ACE Очки</Russian>
<Portuguese>ACE Óculos</Portuguese>
<French>ACE Lunettes</French>
</Key>
<Key ID="STR_ACE_Goggles_ShowInThirdPerson">
<English>Show Goggle Effects in Third Person</English>
<German>Brilleneffekt in dritter Person anzeigen</German>
@ -85,5 +98,9 @@
<Chinese>染色 + 影響</Chinese>
<Portuguese>Cor + Efeitos</Portuguese>
</Key>
<Key ID="STR_ACE_Goggles_SettingShowClearGlasses">
<English>Show Wipe Goggles self interaction</English>
<Polish>Pokaż interakcję Wyczyść Gogle</Polish>
</Key>
</Package>
</Project>