aboutsummaryrefslogtreecommitdiff
path: root/include/Chatbar.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/Chatbar.hpp')
-rw-r--r--include/Chatbar.hpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/include/Chatbar.hpp b/include/Chatbar.hpp
index 27b57f9..5d69448 100644
--- a/include/Chatbar.hpp
+++ b/include/Chatbar.hpp
@@ -1,7 +1,8 @@
#pragma once
#include "StringView.hpp"
-#include <SFML/Graphics/Text.hpp>
+#include "Text.hpp"
+#include "Cache.hpp"
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Window/Event.hpp>
@@ -18,20 +19,10 @@ namespace dchat
public:
Chatbar();
- void addChar(sf::Uint32 codePoint);
- void addString(const std::string &strToAdd);
- const sf::String& getString() const;
- void removePreviousChar();
- void removeNextChar();
- void clear();
-
- void moveCaretLeft();
- void moveCaretRight();
-
bool isFocused() const;
void processEvent(const sf::Event &event, Channel *channel);
- void draw(sf::RenderWindow &window);
+ void draw(sf::RenderWindow &window, Cache &cache);
static float getHeight();
@@ -41,12 +32,9 @@ namespace dchat
private:
void processChatCommand(const StringView &cmd);
private:
- sf::Text text;
+ Text text;
sf::RectangleShape background;
sf::RectangleShape inputBackground;
- int caretIndex;
- sf::Vector2f caretOffset;
- sf::Clock blinkTimer;
bool focused;
};
}