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:
Eduardo Bart
2013-01-24 18:36:04 -02:00
parent a8fbd6cdfc
commit d5b4e0929f
8 changed files with 38 additions and 17 deletions

View File

@@ -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; }

View File

@@ -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

View File

@@ -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;