mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
Improvements in textedit and hotkey manager
* Set textedit's cursor position to the end of text in some situations * Send hotkey messages to the current channel instead of default channel * Allow to overwrite sprites using otml and pngs
This commit is contained in:
@@ -33,6 +33,7 @@ public:
|
||||
void poll();
|
||||
|
||||
void clearTexturesCache();
|
||||
void preload(const std::string& fileName) { getTexture(fileName); }
|
||||
TexturePtr getTexture(const std::string& fileName);
|
||||
const TexturePtr& getEmptyTexture() { return m_emptyTexture; }
|
||||
|
||||
|
@@ -294,6 +294,7 @@ void Application::registerLuaFunctions()
|
||||
|
||||
// Textures
|
||||
g_lua.registerSingletonClass("g_textures");
|
||||
g_lua.bindSingletonFunction("g_textures", "preload", &TextureManager::preload, &g_textures);
|
||||
g_lua.bindSingletonFunction("g_textures", "clearTexturesCache", &TextureManager::clearTexturesCache, &g_textures);
|
||||
|
||||
// UI
|
||||
|
@@ -327,6 +327,9 @@ void UITextEdit::update(bool focusCursor)
|
||||
|
||||
void UITextEdit::setCursorPos(int pos)
|
||||
{
|
||||
if(pos < 0)
|
||||
pos = m_text.length();
|
||||
|
||||
if(pos != m_cursorPos) {
|
||||
if(pos < 0)
|
||||
m_cursorPos = 0;
|
||||
|
Reference in New Issue
Block a user