mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +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:
@@ -91,6 +91,7 @@ function EnterGame.init()
|
||||
if port == nil or port == 0 then port = 7171 end
|
||||
|
||||
enterGame:getChildById('accountNameTextEdit'):setText(account)
|
||||
enterGame:getChildById('accountNameTextEdit'):setCursorPos(-1)
|
||||
enterGame:getChildById('accountPasswordTextEdit'):setText(password)
|
||||
enterGame:getChildById('serverHostTextEdit'):setText(host)
|
||||
enterGame:getChildById('serverPortTextEdit'):setText(port)
|
||||
|
@@ -223,6 +223,7 @@ end
|
||||
|
||||
function setTextEditText(text)
|
||||
consoleTextEdit:setText(text)
|
||||
consoleTextEdit:setCursorPos(-1)
|
||||
end
|
||||
|
||||
function openHelp()
|
||||
@@ -529,7 +530,7 @@ function sendMessage(message, tab)
|
||||
if chatCommandInitial == chatCommandEnd then
|
||||
chatCommandPrivateRepeat = false
|
||||
if chatCommandInitial == "*" then
|
||||
consoleTextEdit:setText('*'.. chatCommandPrivate .. '* ')
|
||||
setTextEditText('*'.. chatCommandPrivate .. '* ')
|
||||
end
|
||||
message = chatCommandMessage:trim()
|
||||
chatCommandPrivateReady = true
|
||||
@@ -615,7 +616,7 @@ function navigateMessageHistory(step)
|
||||
currentMessageIndex = math.min(math.max(currentMessageIndex + step, 0), numCommands)
|
||||
if currentMessageIndex > 0 then
|
||||
local command = messageHistory[numCommands - currentMessageIndex + 1]
|
||||
consoleTextEdit:setText(command)
|
||||
setTextEditText(command)
|
||||
else
|
||||
consoleTextEdit:clearText()
|
||||
end
|
||||
|
@@ -289,7 +289,7 @@ function call(keyCombo)
|
||||
local hotKey = hotkeyList[keyCombo]
|
||||
if hotKey ~= nil and hotKey.itemId == nil and hotKey.value ~= '' then
|
||||
if hotKey.autoSend then
|
||||
g_game.talk(hotKey.value)
|
||||
modules.game_console.sendMessage(hotKey.value)
|
||||
else
|
||||
modules.game_console.setTextEditText(hotKey.value)
|
||||
end
|
||||
|
Reference in New Issue
Block a user