Advanced Fatigue - Move sway to common and add enable sway setting (#9872)

* Move sway from fatigue to common

* Added enable sway setting

* Update addons/common/stringtable.xml

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/common/stringtable.xml

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/common/stringtable.xml

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
johnb432 2024-03-24 22:28:14 +01:00 committed by GitHub
parent 86f1b6b142
commit 80417b114d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 139 additions and 118 deletions

View File

@ -25,20 +25,6 @@ if (!hasInterface) exitWith {};
}; };
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor); }, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
["multiplier", {
switch (true) do {
case (isWeaponRested ACE_player): {
GVAR(swayFactor) * GVAR(restedSwayFactor)
};
case (isWeaponDeployed ACE_player): {
GVAR(swayFactor) * GVAR(deployedSwayFactor)
};
default {
GVAR(swayFactor)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
// - Post process effect ------------------------------------------------------ // - Post process effect ------------------------------------------------------
GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220]; GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220];
GVAR(ppeBlackout) ppEffectEnable true; GVAR(ppeBlackout) ppEffectEnable true;

View File

@ -80,30 +80,3 @@
[0, 5, 1, 1], [0, 5, 1, 1],
true true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
[
QGVAR(swayFactor),
"SLIDER",
[LSTRING(SwayFactor), LSTRING(SwayFactor_Description)],
LSTRING(DisplayName),
[0, 5, 1, 1],
true
] call CBA_fnc_addSetting;
[
QGVAR(restedSwayFactor),
"SLIDER",
[LSTRING(RestedSwayFactor), LSTRING(RestedSwayFactor_Description)],
LSTRING(DisplayName),
[0, 5, 1, 2],
true
] call CBA_fnc_addSetting;
[
QGVAR(deployedSwayFactor),
"SLIDER",
[LSTRING(DeployedSwayFactor), LSTRING(DeployedSwayFactor_Description)],
LSTRING(DisplayName),
[0, 5, 1, 2],
true
] call CBA_fnc_addSetting;

View File

@ -154,76 +154,6 @@
<Portuguese>Define o quanto que um terreno íngrime aumenta na perda de estamina. Quanto maior, maior a perda de estamina.</Portuguese> <Portuguese>Define o quanto que um terreno íngrime aumenta na perda de estamina. Quanto maior, maior a perda de estamina.</Portuguese>
<Czech>Nastavuje, o kolik strmý terén zvyšuje ztrátu výdrže. Vyšší znamená vyšší ztrátu výdrže.</Czech> <Czech>Nastavuje, o kolik strmý terén zvyšuje ztrátu výdrže. Vyšší znamená vyšší ztrátu výdrže.</Czech>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Fatigue_SwayFactor">
<English>Sway factor</English>
<Spanish>Factor de balanceo de mira</Spanish>
<German>Verwacklungsfaktor</German>
<Japanese>手ぶれ因数</Japanese>
<Chinesesimp>抖动系数</Chinesesimp>
<Chinese>抖動因素</Chinese>
<French>Facteur de tremblement</French>
<Italian>Fattore di Oscillazione</Italian>
<Polish>Czynnik kołysania</Polish>
<Russian>Фактор колебания прицела</Russian>
<Portuguese>Fator de Balanço de Mira</Portuguese>
<Czech>Faktor kývání</Czech>
<Korean>손떨림 정도</Korean>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_SwayFactor_Description">
<English>Influences the amount of weapon sway. Higher means more sway.</English>
<Spanish>Afecta al la estabilidad de la mira. Más alto significa más balanceo</Spanish>
<German>Beeinflusst, wie ruhig man eine Waffe halten kann. Ein höherer Wert bedeutet weniger Stabilisierung.</German>
<Japanese>武器の手ぶれの量に影響します。値が高いほど、手ぶれが強くなります。</Japanese>
<Chinesesimp>影响手持武器的晃动程度,数值越高,抖动的越厉害。</Chinesesimp>
<Chinese>影響手持武器晃動程度,數值越高抖動越厲害</Chinese>
<French>Influe sur l'amplitude du tremblement de l'arme. Une valeur plus élevée signifie plus de tremblement.</French>
<Italian>Influenza l'aumento di oscillazione dell'arma quando affaticato. Maggiore significa più oscillazione.</Italian>
<Polish>Wpływa na poziom kołysania broni. Większa ilość znaczy większe kołysanie.</Polish>
<Russian>Влияет на колебания прицела оружия. Чем выше - тем больше.</Russian>
<Portuguese>Influencia a quantidade de balanço da mira da arma. Quanto maior, mais balanço.</Portuguese>
<Czech>Ovlivňuje množství kývání zbraní. Vyšší znamená více kývání.</Czech>
<Korean>손떨림의 정도를 정합니다. 높을 수록 많이 휘적입니다.</Korean>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_RestedSwayFactor">
<English>Rested sway factor</English>
<French>Facteur de balancement au repos</French>
<Korean>휴식 시 손떨림 정도</Korean>
<Portuguese>Fator de balanço de mira em repouso</Portuguese>
<German>Verwacklungsfaktor, wenn aufgelegt</German>
<Italian>Fattore di Oscillazione Appoggiato</Italian>
<Japanese>静止時の手ぶれ係数</Japanese>
<Russian>Коэффициент колебания прицела в состоянии покоя</Russian>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_RestedSwayFactor_Description">
<English>Influences the amount of weapon sway while weapon is rested.</English>
<French>Influence le degré de balancement de l'arme au repos.</French>
<Korean>무기가 아무런 행동도 하지 않는 동안 무기가 흔들리는 정도를 정합니다.</Korean>
<Portuguese>Influencia a quantidade de balanço de mira enquanto a arma está em repouso.</Portuguese>
<German>Beeinflusst, wie ruhig man die Waffe hält, während sie aufgelegt ist.</German>
<Italian>Determina la quantità di oscillazione dell'arma quando questa è appoggiata.</Italian>
<Japanese>静止している時の武器の手ぶれの量に影響します。</Japanese>
<Russian>Влияет на величину колебания прицела оружия в состоянии покоя.</Russian>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_DeployedSwayFactor">
<English>Deployed sway factor</English>
<French>Facteur de balancement déployé</French>
<Korean>거치 시 손떨림 정도</Korean>
<Portuguese>Fator de balanço de mira em posição de tiro</Portuguese>
<German>Verwacklungsfaktor, wenn Zweibein aufgestellt ist.</German>
<Italian>Fattore di Oscillazione su Bipode</Italian>
<Japanese>展開時の手ぶれ係数</Japanese>
<Russian>Коэффициент колебания прицела при развертывании</Russian>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_DeployedSwayFactor_Description">
<English>Influences the amount of weapon sway while weapon is deployed.</English>
<French>Influence le degré de balancement de l'arme déployée.</French>
<Korean>무기를 거치하는 동안 무기를 흔드는 정도를 정합니다.</Korean>
<Portuguese>Influencia a quantidade de balanço de mira enquanto a arma está em posição de tiro.</Portuguese>
<German>Beeinflusst, wie ruhig man die Waffen hält, während das Zweibein aufgestellt ist.</German>
<Italian>Determina la quantità di oscillazione dell'arma quando questa è stabilizzata usando il bipode.</Italian>
<Japanese>武器の展開(Cキー)時の武器の手ぶれの量に影響します。</Japanese>
<Russian>Влияет на величину колебания прицела оружия при его развертывании.</Russian>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_Enabled"> <Key ID="STR_ACE_Advanced_Fatigue_Enabled">
<English>Enabled</English> <English>Enabled</English>
<Spanish>Activada</Spanish> <Spanish>Activada</Spanish>

View File

@ -499,10 +499,24 @@ GVAR(reloadMutex_lastMagazines) = [];
// Start the sway loop // Start the sway loop
////////////////////////////////////////////////// //////////////////////////////////////////////////
["CBA_settingsInitialized", { ["CBA_settingsInitialized", {
["multiplier", {
switch (true) do {
case (isWeaponRested ACE_player): {
GVAR(swayFactor) * GVAR(restedSwayFactor)
};
case (isWeaponDeployed ACE_player): {
GVAR(swayFactor) * GVAR(deployedSwayFactor)
};
default {
GVAR(swayFactor)
};
};
}, QUOTE(ADDON)] call FUNC(addSwayFactor);
[{ [{
// frame after settingsInitialized to ensure all other addons have added their factors // frame after settingsInitialized to ensure all other addons have added their factors
if ((GVAR(swayFactorsBaseline) + GVAR(swayFactorsMultiplier)) isNotEqualTo []) then { if (GVAR(enableSway)) then {
call FUNC(swayLoop) call FUNC(swayLoop);
}; };
// check for pre-3.16 sway factors being added // check for pre-3.16 sway factors being added
if (!isNil {missionNamespace getVariable "ACE_setCustomAimCoef"}) then { if (!isNil {missionNamespace getVariable "ACE_setCustomAimCoef"}) then {

View File

@ -17,12 +17,12 @@
private _baseline = 1; private _baseline = 1;
if (GVAR(swayFactorsBaseline) isNotEqualTo []) then { if (GVAR(swayFactorsBaseline) isNotEqualTo []) then {
_baseline = 1 max ([missionNamespace, "ACE_setCustomAimCoef_baseline", "max"] call EFUNC(common,arithmeticGetResult)); _baseline = 1 max ([missionNamespace, "ACE_setCustomAimCoef_baseline", "max"] call FUNC(arithmeticGetResult));
}; };
private _multiplier = 1; private _multiplier = 1;
if (GVAR(swayFactorsMultiplier) isNotEqualTo []) then { if (GVAR(swayFactorsMultiplier) isNotEqualTo []) then {
_multiplier = [missionNamespace, "ACE_setCustomAimCoef_multiplier", "product"] call EFUNC(common,arithmeticGetResult); _multiplier = [missionNamespace, "ACE_setCustomAimCoef_multiplier", "product"] call FUNC(arithmeticGetResult);
}; };
ACE_player setCustomAimCoef (_baseline * _multiplier); ACE_player setCustomAimCoef (_baseline * _multiplier);

View File

@ -1,5 +1,6 @@
private _category = format ["ACE %1", LLSTRING(DisplayName)]; private _category = format ["ACE %1", LLSTRING(DisplayName)];
private _categoryColors = [_category, format ["| %1 |", LLSTRING(subcategory_colors)]]; private _categoryColors = [_category, LSTRING(subcategory_colors)];
private _categorySway = [_category, LSTRING(subcategory_sway)];
[ [
QGVAR(checkPBOsAction), QGVAR(checkPBOsAction),
@ -87,7 +88,7 @@ private _categoryColors = [_category, format ["| %1 |", LLSTRING(subcategory_col
QGVAR(epilepsyFriendlyMode), QGVAR(epilepsyFriendlyMode),
"CHECKBOX", "CHECKBOX",
[LSTRING(EpilepsyFriendlyMode), LSTRING(EpilepsyFriendlyModeTooltip)], [LSTRING(EpilepsyFriendlyMode), LSTRING(EpilepsyFriendlyModeTooltip)],
format ["ACE %1", localize LSTRING(DisplayName)], _category,
false, false,
2 2
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
@ -96,7 +97,45 @@ private _categoryColors = [_category, format ["| %1 |", LLSTRING(subcategory_col
QGVAR(progressBarInfo), QGVAR(progressBarInfo),
"LIST", "LIST",
[LSTRING(progressBarInfoName), LSTRING(progressBarInfoDesc)], [LSTRING(progressBarInfoName), LSTRING(progressBarInfoDesc)],
format ["ACE %1", localize LSTRING(DisplayName)], _category,
[[0, 1, 2], [LSTRING(None), LSTRING(progressBarInfoPercentage), LSTRING(progressBarInfoTime)], 2], [[0, 1, 2], [LSTRING(None), LSTRING(progressBarInfoPercentage), LSTRING(progressBarInfoTime)], 2],
0 0
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
[
QGVAR(enableSway),
"CHECKBOX",
[LSTRING(enableSway), LSTRING(enableSway_Description)],
_categorySway,
true,
1,
{},
true
] call CBA_fnc_addSetting;
[
QGVAR(swayFactor),
"SLIDER",
[LSTRING(SwayFactor), LSTRING(SwayFactor_Description)],
_categorySway,
[0, 5, 1, 2],
1
] call CBA_fnc_addSetting;
[
QGVAR(restedSwayFactor),
"SLIDER",
[LSTRING(RestedSwayFactor), LSTRING(RestedSwayFactor_Description)],
_categorySway,
[0, 5, 1, 2],
1
] call CBA_fnc_addSetting;
[
QGVAR(deployedSwayFactor),
"SLIDER",
[LSTRING(DeployedSwayFactor), LSTRING(DeployedSwayFactor_Description)],
_categorySway,
[0, 5, 1, 2],
1
] call CBA_fnc_addSetting;

View File

@ -1828,5 +1828,84 @@
<Chinese>下方</Chinese> <Chinese>下方</Chinese>
<Turkish>Alt</Turkish> <Turkish>Alt</Turkish>
</Key> </Key>
<Key ID="STR_ACE_Common_subcategory_sway">
<English>Sway</English>
</Key>
<Key ID="STR_ACE_Common_EnableSway">
<English>Enable ACE Sway</English>
</Key>
<Key ID="STR_ACE_Common_EnableSway_Description">
<English>Enables weapon sway influenced by sway factors, such as stance, fatigue and medical condition.\nDisabling this setting will defer sway to vanilla or other mods.</English>
</Key>
<Key ID="STR_ACE_Common_SwayFactor">
<English>Sway factor</English>
<Spanish>Factor de balanceo de mira</Spanish>
<German>Verwacklungsfaktor</German>
<Japanese>手ぶれ因数</Japanese>
<Chinesesimp>抖动系数</Chinesesimp>
<Chinese>抖動因素</Chinese>
<French>Facteur de tremblement</French>
<Italian>Fattore di Oscillazione</Italian>
<Polish>Czynnik kołysania</Polish>
<Russian>Фактор колебания прицела</Russian>
<Portuguese>Fator de Balanço de Mira</Portuguese>
<Czech>Faktor kývání</Czech>
<Korean>손떨림 정도</Korean>
</Key>
<Key ID="STR_ACE_Common_SwayFactor_Description">
<English>Influences the amount of weapon sway. Higher means more sway.</English>
<Spanish>Afecta al la estabilidad de la mira. Más alto significa más balanceo</Spanish>
<German>Beeinflusst, wie ruhig man eine Waffe halten kann. Ein höherer Wert bedeutet weniger Stabilisierung.</German>
<Japanese>武器の手ぶれの量に影響します。値が高いほど、手ぶれが強くなります。</Japanese>
<Chinesesimp>影响手持武器的晃动程度,数值越高,抖动的越厉害。</Chinesesimp>
<Chinese>影響手持武器晃動程度,數值越高抖動越厲害</Chinese>
<French>Influe sur l'amplitude du tremblement de l'arme. Une valeur plus élevée signifie plus de tremblement.</French>
<Italian>Influenza l'aumento di oscillazione dell'arma quando affaticato. Maggiore significa più oscillazione.</Italian>
<Polish>Wpływa na poziom kołysania broni. Większa ilość znaczy większe kołysanie.</Polish>
<Russian>Влияет на колебания прицела оружия. Чем выше - тем больше.</Russian>
<Portuguese>Influencia a quantidade de balanço da mira da arma. Quanto maior, mais balanço.</Portuguese>
<Czech>Ovlivňuje množství kývání zbraní. Vyšší znamená více kývání.</Czech>
<Korean>손떨림의 정도를 정합니다. 높을 수록 많이 휘적입니다.</Korean>
</Key>
<Key ID="STR_ACE_Common_RestedSwayFactor">
<English>Rested sway factor</English>
<French>Facteur de balancement au repos</French>
<Korean>휴식 시 손떨림 정도</Korean>
<Portuguese>Fator de balanço de mira em repouso</Portuguese>
<German>Verwacklungsfaktor, wenn aufgelegt</German>
<Italian>Fattore di Oscillazione Appoggiato</Italian>
<Japanese>静止時の手ぶれ係数</Japanese>
<Russian>Коэффициент колебания прицела в состоянии покоя</Russian>
</Key>
<Key ID="STR_ACE_Common_RestedSwayFactor_Description">
<English>Influences the amount of weapon sway while weapon is rested.</English>
<French>Influence le degré de balancement de l'arme au repos.</French>
<Korean>무기가 아무런 행동도 하지 않는 동안 무기가 흔들리는 정도를 정합니다.</Korean>
<Portuguese>Influencia a quantidade de balanço de mira enquanto a arma está em repouso.</Portuguese>
<German>Beeinflusst, wie ruhig man die Waffe hält, während sie aufgelegt ist.</German>
<Italian>Determina la quantità di oscillazione dell'arma quando questa è appoggiata.</Italian>
<Japanese>静止している時の武器の手ぶれの量に影響します。</Japanese>
<Russian>Влияет на величину колебания прицела оружия в состоянии покоя.</Russian>
</Key>
<Key ID="STR_ACE_Common_DeployedSwayFactor">
<English>Deployed sway factor</English>
<French>Facteur de balancement déployé</French>
<Korean>거치 시 손떨림 정도</Korean>
<Portuguese>Fator de balanço de mira em posição de tiro</Portuguese>
<German>Verwacklungsfaktor, wenn Zweibein aufgestellt ist.</German>
<Italian>Fattore di Oscillazione su Bipode</Italian>
<Japanese>展開時の手ぶれ係数</Japanese>
<Russian>Коэффициент колебания прицела при развертывании</Russian>
</Key>
<Key ID="STR_ACE_Common_DeployedSwayFactor_Description">
<English>Influences the amount of weapon sway while weapon is deployed.</English>
<French>Influence le degré de balancement de l'arme déployée.</French>
<Korean>무기를 거치하는 동안 무기를 흔드는 정도를 정합니다.</Korean>
<Portuguese>Influencia a quantidade de balanço de mira enquanto a arma está em posição de tiro.</Portuguese>
<German>Beeinflusst, wie ruhig man die Waffen hält, während das Zweibein aufgestellt ist.</German>
<Italian>Determina la quantità di oscillazione dell'arma quando questa è stabilizzata usando il bipode.</Italian>
<Japanese>武器の展開(Cキー)時の武器の手ぶれの量に影響します。</Japanese>
<Russian>Влияет на величину колебания прицела оружия при его развертывании.</Russian>
</Key>
</Package> </Package>
</Project> </Project>