on commence l'interface là ouais
This commit is contained in:
32
src/GraphicalUI/Keybinds.h
Normal file
32
src/GraphicalUI/Keybinds.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "../Core/Action.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
using sfKey = sf::Keyboard::Key;
|
||||
|
||||
|
||||
class Keybinds {
|
||||
private:
|
||||
std::map<Action, std::vector<sfKey>> keybinds;
|
||||
|
||||
public:
|
||||
Keybinds();
|
||||
|
||||
void loadKeybindsFromFile();
|
||||
|
||||
void saveKeybindsToFile() const;
|
||||
|
||||
void createDefaultKeybindsFile() const;
|
||||
|
||||
void addKey(Action action, sfKey key);
|
||||
|
||||
void clearKeys(Action action);
|
||||
|
||||
const std::vector<Action>& getActions(sfKey key) const;
|
||||
|
||||
const std::vector<sfKey>& getKeybinds(Action action) const;
|
||||
};
|
||||
Reference in New Issue
Block a user