aboutsummaryrefslogtreecommitdiff
path: root/include/Chatbar.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-04-08 21:04:12 +0200
committerdec05eba <dec05eba@protonmail.com>2019-04-08 21:04:17 +0200
commit725ea566a2b6a12e0a02e4f570b6e99102e2d21b (patch)
treed35a338392e15f50402c2055d520e7b1c3ea36a2 /include/Chatbar.hpp
parent4aac8df198e3a5bd9c6efc95cdf4c520c2e05401 (diff)
Refactor, remove a lot of code and use dchat core instead
Diffstat (limited to 'include/Chatbar.hpp')
-rw-r--r--include/Chatbar.hpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/Chatbar.hpp b/include/Chatbar.hpp
index 10bbebd..701220a 100644
--- a/include/Chatbar.hpp
+++ b/include/Chatbar.hpp
@@ -1,18 +1,20 @@
#pragma once
-#include "StringView.hpp"
#include "Text.hpp"
-#include "Cache.hpp"
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Window/Event.hpp>
#include <SFML/System/Clock.hpp>
+#include <dchat/StringView.hpp>
#include <string>
#include <unordered_map>
+#include <memory>
namespace dchat
{
- class Channel;
+ class Cache;
+ class Room;
+ class MessageBoard;
class Chatbar
{
@@ -21,8 +23,8 @@ namespace dchat
bool isFocused() const;
- void processEvent(const sf::Event &event, Cache &cache, Channel *channel);
- void draw(sf::RenderWindow &window, Cache &cache);
+ void processEvent(const sf::Event &event, Cache *cache, std::shared_ptr<Room> room, MessageBoard *messageBoard);
+ void draw(sf::RenderWindow &window, Cache *cache);
static sf::Vector2f getInputPosition(sf::RenderWindow &window);
static sf::Vector2f getInputSize(sf::RenderWindow &window);
@@ -30,6 +32,7 @@ namespace dchat
static bool addBind(const std::string &key, const std::string &value, bool updateFile = true);
static bool removeBind(const std::string &key, bool updateFile = true);
+ static void loadBindsFromFile();
static const std::unordered_map<std::string, std::string>& getBinds();
private:
void processChatCommand(const StringView &cmd);