summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Romeo <vittorio.romeo@outlook.com>2021-11-04 19:49:32 +0000
committerVittorio Romeo <vittorio.romeo@outlook.com>2021-11-04 19:49:32 +0000
commitb4189bd021ccdb313089237c30b768970ac588eb (patch)
tree19eaf6aa6948e3f0195b9a203d765b289feaba0e
parent58010b5cdeb122391018426e2561a876cbd2ac66 (diff)
Add camera shake multiplier option, slightly tone down shake
-rw-r--r--include/SSVOpenHexagon/Global/Config.hpp3
-rw-r--r--src/SSVOpenHexagon/Core/HexagonGame.cpp2
-rw-r--r--src/SSVOpenHexagon/Core/MenuGame.cpp2
-rw-r--r--src/SSVOpenHexagon/Global/Config.cpp11
4 files changed, 16 insertions, 2 deletions
diff --git a/include/SSVOpenHexagon/Global/Config.hpp b/include/SSVOpenHexagon/Global/Config.hpp
index 7924c8ed..dbb9e9a7 100644
--- a/include/SSVOpenHexagon/Global/Config.hpp
+++ b/include/SSVOpenHexagon/Global/Config.hpp
@@ -82,6 +82,7 @@ void setServerLevelWhitelist(const std::vector<std::string>& levelValidators);
void setSaveLastLoginUsername(bool mX);
void setLastLoginUsername(const std::string& mX);
void setShowLoginAtStartup(bool mX);
+void setCameraShakeMultiplier(float x);
[[nodiscard]] bool getOfficial();
[[nodiscard]] const std::string& getUneligibilityReason();
@@ -114,7 +115,6 @@ void setShowLoginAtStartup(bool mX);
[[nodiscard]] unsigned int getHeight();
[[nodiscard]] bool getShowMessages();
[[nodiscard]] bool getRotateToStart();
-
[[nodiscard]] bool getDebug();
[[nodiscard]] bool getPulse();
[[nodiscard]] bool getBeatPulse();
@@ -149,6 +149,7 @@ void setShowLoginAtStartup(bool mX);
[[nodiscard]] bool getSaveLastLoginUsername();
[[nodiscard]] const std::string& getLastLoginUsername();
[[nodiscard]] bool getShowLoginAtStartup();
+[[nodiscard]] float getCameraShakeMultiplier();
// keyboard binds
diff --git a/src/SSVOpenHexagon/Core/HexagonGame.cpp b/src/SSVOpenHexagon/Core/HexagonGame.cpp
index c1bb1b72..9899c6ae 100644
--- a/src/SSVOpenHexagon/Core/HexagonGame.cpp
+++ b/src/SSVOpenHexagon/Core/HexagonGame.cpp
@@ -789,7 +789,7 @@ void HexagonGame::death_shakeCamera()
backgroundCamera->setCenter(ssvs::zeroVec2f);
- status.cameraShake = 50.f;
+ status.cameraShake = 45.f * Config::getCameraShakeMultiplier();
}
void HexagonGame::death_flashEffect()
diff --git a/src/SSVOpenHexagon/Core/MenuGame.cpp b/src/SSVOpenHexagon/Core/MenuGame.cpp
index 34681cfb..ba47ad66 100644
--- a/src/SSVOpenHexagon/Core/MenuGame.cpp
+++ b/src/SSVOpenHexagon/Core/MenuGame.cpp
@@ -1392,6 +1392,8 @@ void MenuGame::initMenus()
visfx.create<i::Toggle>("pulse", &Config::getPulse, &Config::setPulse) |
whenNotOfficial;
visfx.create<i::Toggle>("flash", &Config::getFlash, &Config::setFlash);
+ visfx.create<i::Slider>("shake mult.", &Config::getCameraShakeMultiplier,
+ &Config::setCameraShakeMultiplier, 0.f, 5.f, 0.1f);
visfx.create<i::GoBack>("back");
auto& fps(optionsMenu.createCategory("fps settings"));
diff --git a/src/SSVOpenHexagon/Global/Config.cpp b/src/SSVOpenHexagon/Global/Config.cpp
index c29f3141..84a15c67 100644
--- a/src/SSVOpenHexagon/Global/Config.cpp
+++ b/src/SSVOpenHexagon/Global/Config.cpp
@@ -214,6 +214,7 @@ using cil = std::initializer_list<cmb>;
X(saveLastLoginUsername, bool, "save_last_login_username", true) \
X(lastLoginUsername, std::string, "last_login_username", "") \
X(showLoginAtStartup, bool, "show_login_at_startup", false) \
+ X(cameraShakeMultiplier, float, "camera_shake_multiplier", 1.f) \
X_LINKEDVALUES_BINDS
namespace hg::Config {
@@ -730,6 +731,11 @@ void setShowLoginAtStartup(bool mX)
showLoginAtStartup() = mX;
}
+void setCameraShakeMultiplier(float x)
+{
+ cameraShakeMultiplier() = x;
+}
+
[[nodiscard]] bool getOfficial()
{
return official();
@@ -1055,6 +1061,11 @@ void setShowLoginAtStartup(bool mX)
return showLoginAtStartup();
}
+[[nodiscard]] float getCameraShakeMultiplier()
+{
+ return cameraShakeMultiplier();
+}
+
//***********************************************************
//
// KEYBOARD/MOUSE BINDS