From 5f72ec0277bb0e3e608a7d40e72619413fe3f646 Mon Sep 17 00:00:00 2001 From: siecvi <25997662+siecvi@users.noreply.github.com> Date: Sat, 28 Dec 2024 18:57:06 -0300 Subject: [PATCH] faster zoom animation --- Resources/Locales/es/openspades.po | 7 ++++++- Resources/Locales/pot/openspades.pot | 5 +++++ Resources/Scripts/Gui/Preferences.as | 6 +++++- Sources/Client/ClientPlayer.cpp | 10 ++++++---- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Resources/Locales/es/openspades.po b/Resources/Locales/es/openspades.po index 8207fb8..31fa71b 100644 --- a/Resources/Locales/es/openspades.po +++ b/Resources/Locales/es/openspades.po @@ -712,10 +712,15 @@ msgctxt "Preferences" msgid "NORMAL" msgstr "Normal" +#: Resources/Scripts/Gui/Preferences.as:1157 +msgctxt "Preferences" +msgid "FAST" +msgstr "Rápido" + #: Resources/Scripts/Gui/Preferences.as:1176 msgctxt "Preferences" msgid "SMALL" -msgstr "Pequeño/a" +msgstr "Pequeño" #: Resources/Scripts/Gui/Preferences.as:650 msgctxt "Preferences" diff --git a/Resources/Locales/pot/openspades.pot b/Resources/Locales/pot/openspades.pot index 2c22fda..5a93b8c 100644 --- a/Resources/Locales/pot/openspades.pot +++ b/Resources/Locales/pot/openspades.pot @@ -704,6 +704,11 @@ msgctxt "Preferences" msgid "NORMAL" msgstr "" +#: Resources/Scripts/Gui/Preferences.as:1157 +msgctxt "Preferences" +msgid "FAST" +msgstr "" + #: Resources/Scripts/Gui/Preferences.as:1176 msgctxt "Preferences" msgid "SMALL" diff --git a/Resources/Scripts/Gui/Preferences.as b/Resources/Scripts/Gui/Preferences.as index 16c2627..20735dc 100644 --- a/Resources/Scripts/Gui/Preferences.as +++ b/Resources/Scripts/Gui/Preferences.as @@ -1153,7 +1153,11 @@ namespace spades { layouter.AddToggleField(_Tr("Preferences", "Bullet Tracers"), "cg_tracers"); layouter.AddToggleField(_Tr("Preferences", "Firstperson Tracers"), "cg_tracersFirstPerson"); layouter.AddToggleField(_Tr("Preferences", "Eject Bullet Casings"), "cg_ejectBrass"); - layouter.AddToggleField(_Tr("Preferences", "Animations"), "cg_animations"); + layouter.AddChoiceField(_Tr("Preferences", "Animations"), "cg_animations", + array = {_Tr("Preferences", "FAST"), + _Tr("Preferences", "NORMAL"), + _Tr("Preferences", "OFF")}, + array = {2, 1, 0}); layouter.AddToggleField(_Tr("Preferences", "Hurt Screen Effects"), "cg_hurtScreenEffects"); layouter.AddChoiceField(_Tr("Preferences", "Camera Shake"), "cg_shake", array = {_Tr("Preferences", "MORE"), diff --git a/Sources/Client/ClientPlayer.cpp b/Sources/Client/ClientPlayer.cpp index 5c88a60..4e2d482 100644 --- a/Sources/Client/ClientPlayer.cpp +++ b/Sources/Client/ClientPlayer.cpp @@ -345,17 +345,19 @@ namespace spades { PlayerInput actualInput = player.GetInput(); WeaponInput actualWeapInput = player.GetWeaponInput(); + int zoomAnimation = cg_animations; + float speed = (zoomAnimation >= 2) ? 2.0F : 1.0F; if (player.IsToolWeapon() && actualWeapInput.secondary) { - if (cg_animations && isLocalPlayer) { - aimDownState += dt * 8.0F; + if (zoomAnimation && isLocalPlayer) { + aimDownState += dt * 8.0F * speed; if (aimDownState > 1.0F) aimDownState = 1.0F; } else { aimDownState = 1.0F; } } else { - if (cg_animations && isLocalPlayer) { - aimDownState -= dt * 3.0F; + if (zoomAnimation && isLocalPlayer) { + aimDownState -= dt * 3.0F * speed; if (aimDownState < 0.0F) aimDownState = 0.0F; } else {