9#ifndef RTYPE_CLIENT_CORE_SETTINGS_HPP_
10 #define RTYPE_CLIENT_CORE_SETTINGS_HPP_
16#include <SFML/Window/Keyboard.hpp>
24#include <unordered_map>
73 std::string
getKeyName(sf::Keyboard::Key key)
const;
244 bool save(
const std::string &filename =
"config/settings.cfg");
245 bool load(
const std::string &filename =
"config/settings.cfg");
252 sf::Keyboard::Key
stringToKey(
const std::string &keyName)
const;
Logger declaration with support for multiple log levels.
Manages game settings and preferences.
void setDifficulty(Difficulty difficulty)
std::string getKeyName(sf::Keyboard::Key key) const
void setKey(KeyAction action, sf::Keyboard::Key key)
Language getLanguage() const
void setMusicVolume(float volume)
void onLanguageChanged(LanguageCallback callback)
std::string getWeaponName(ecs::components::WeaponKind weapon) const
void setGamepadPauseButton(unsigned int button)
void setGamepadReloadButton(unsigned int button)
unsigned int _gamepadReloadButton
float getMusicVolume() const
std::function< void(Language)> LanguageCallback
std::vector< VolumeCallback > _onMusicVolumeChanged
sf::Keyboard::Key stringToKey(const std::string &keyName) const
unsigned int _gamepadShootButton
std::string getDifficultyName(Difficulty difficulty) const
std::unordered_map< KeyAction, sf::Keyboard::Key > _keyBindings
unsigned int getGamepadReloadButton() const
Difficulty getDifficulty() const
ecs::components::WeaponKind getSelectedWeapon() const
sf::Keyboard::Key getKey(KeyAction action) const
ColorBlindMode getColorBlindMode() const
void setSfxVolume(float volume)
void setGamepadCursorSpeed(float speed)
void setGamepadEnabled(bool enabled)
bool loadFromClientJson(const std::string &filename)
void onSfxVolumeChanged(VolumeCallback callback)
void setLanguage(Language lang)
float getMasterVolume() const
std::vector< VolumeCallback > _onMasterVolumeChanged
bool getGamepadEnabled() const
void setColorBlindMode(ColorBlindMode mode)
unsigned int getGamepadPauseButton() const
void setSelectedWeapon(ecs::components::WeaponKind weapon)
std::string getColorBlindModeName(ColorBlindMode mode) const
void setHighContrast(bool enabled)
bool save(const std::string &filename="config/settings.cfg")
float _gamepadCursorSpeed
void initDefaultKeyBindings()
void setMasterVolume(float volume)
bool getHighContrast() const
void setGamepadValidateButton(unsigned int button)
void setGamepadDeadzone(float deadzone)
ColorBlindMode _colorBlindMode
unsigned int _gamepadPauseButton
std::string getLanguageName(Language lang) const
std::vector< VolumeCallback > _onSfxVolumeChanged
ecs::components::WeaponKind _selectedWeapon
unsigned int _gamepadValidateButton
unsigned int getGamepadShootButton() const
void setGamepadShootButton(unsigned int button)
float getGamepadCursorSpeed() const
void onMusicVolumeChanged(VolumeCallback callback)
unsigned int getGamepadValidateButton() const
float getSfxVolume() const
std::vector< LanguageCallback > _onLanguageChanged
float getGamepadDeadzone() const
void onMasterVolumeChanged(VolumeCallback callback)
bool load(const std::string &filename="config/settings.cfg")
std::function< void(float)> VolumeCallback
ColorBlindMode
Color blind assistance modes.
KeyAction
Actions that can be bound to keys.
Difficulty
Game difficulty levels (solo mode only)
Language
Supported languages.
WeaponKind
Types of player weapons.
@ Classic
Default spam/charge laser.