mirror of
https://github.com/edubart/otclient.git
synced 2025-11-05 21:16:24 +01:00
Change cursor on textedit, remove possibility to close EnterGame window
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include <framework/core/clock.h>
|
||||
#include <framework/otml/otmlnode.h>
|
||||
#include <framework/core/application.h>
|
||||
#include <framework/input/mouse.h>
|
||||
|
||||
UITextEdit::UITextEdit()
|
||||
{
|
||||
@@ -391,6 +392,14 @@ std::string UITextEdit::getDisplayedText()
|
||||
return m_text;
|
||||
}
|
||||
|
||||
void UITextEdit::onHoverChange(bool hovered)
|
||||
{
|
||||
if(hovered)
|
||||
g_mouse.setTextCursor();
|
||||
else
|
||||
g_mouse.restoreCursor();
|
||||
}
|
||||
|
||||
void UITextEdit::onTextChange(const std::string& text, const std::string& oldText)
|
||||
{
|
||||
m_cursorPos = text.length();
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
bool isMultiline() { return m_multiline; }
|
||||
|
||||
protected:
|
||||
virtual void onHoverChange(bool hovered);
|
||||
virtual void onTextChange(const std::string& text, const std::string& oldText);
|
||||
virtual void onFontChange(const std::string& font);
|
||||
virtual void onStyleApply(const std::string& styleName, const OTMLNodePtr& styleNode);
|
||||
|
||||
Reference in New Issue
Block a user