Skip to content

Commit

Permalink
faster zoom animation
Browse files Browse the repository at this point in the history
  • Loading branch information
siecvi committed Dec 28, 2024
1 parent 541311e commit 5f72ec0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
7 changes: 6 additions & 1 deletion Resources/Locales/es/openspades.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions Resources/Locales/pot/openspades.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion Resources/Scripts/Gui/Preferences.as
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> = {_Tr("Preferences", "FAST"),
_Tr("Preferences", "NORMAL"),
_Tr("Preferences", "OFF")},
array<int> = {2, 1, 0});
layouter.AddToggleField(_Tr("Preferences", "Hurt Screen Effects"), "cg_hurtScreenEffects");
layouter.AddChoiceField(_Tr("Preferences", "Camera Shake"), "cg_shake",
array<string> = {_Tr("Preferences", "MORE"),
Expand Down
10 changes: 6 additions & 4 deletions Sources/Client/ClientPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5f72ec0

Please sign in to comment.