• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[SOLVED] Game chat text box ins't being selected after login

darkshin

New old member
Joined
Dec 14, 2010
Messages
231
Reaction score
21
Hey guuys! I am having a strange time here trying to find where and why its happening.
The box where you write and send messages ins't being selected automatically after you login, you have to click at a chat label or at the box itself to select it and then behaves normally.
I believe that this problem is somewhere at game_console module, but I just can't track where.

Could someone help me figuring out this ?

THANKS!! :D
 
button.active() or something?
Its a TextEdit, I believe

Code:
  TextEdit
    id: consoleTextEdit
    anchors.left: sayModeButton.right
    anchors.right: parent.right
    anchors.bottom: parent.bottom
    margin-right: 6
    margin-left: 6
    margin-bottom: 6
    shift-navigation: true
    max-length: 255

But at the console.lua I just find Functions that doesn't seems to do what I am looking for:

Code:
function setTextEditText(text)
  consoleTextEdit:setText(text)
  consoleTextEdit:setCursorPos(-1)
end

function sendCurrentMessage()
  local message = consoleTextEdit:getText()
  if #message == 0 then return end
  consoleTextEdit:clearText()

  -- send message
  sendMessage(message)
end

function enableChat()
  local gameInterface = modules.game_interface

  consoleTextEdit:setVisible(true)
  consoleTextEdit:setText("")

  g_keyboard.unbindKeyUp("Space")
  g_keyboard.unbindKeyUp("Enter")
  g_keyboard.unbindKeyUp("Escape")

  gameInterface.unbindWalkKey("W")
  gameInterface.unbindWalkKey("D")
  gameInterface.unbindWalkKey("S")
  gameInterface.unbindWalkKey("A")

  gameInterface.unbindWalkKey("E")
  gameInterface.unbindWalkKey("Q")
  gameInterface.unbindWalkKey("C")
  gameInterface.unbindWalkKey("Z")

  consoleToggleChat:setTooltip(tr("Disable chat mode, allow to walk using ASDW"))
end

function disableChat()
  local gameInterface = modules.game_interface

  consoleTextEdit:setVisible(false)
  consoleTextEdit:setText("")

  local quickFunc = function()
    if consoleToggleChat:isChecked() then
      consoleToggleChat:setChecked(false)
    end
    enableChat()
  end
  g_keyboard.bindKeyUp("Space", quickFunc)
  g_keyboard.bindKeyUp("Enter", quickFunc)
  g_keyboard.bindKeyUp("Escape", quickFunc)

  gameInterface.bindWalkKey("W", North)
  gameInterface.bindWalkKey("D", East)
  gameInterface.bindWalkKey("S", South)
  gameInterface.bindWalkKey("A", West)

  gameInterface.bindWalkKey("E", NorthEast)
  gameInterface.bindWalkKey("Q", NorthWest)
  gameInterface.bindWalkKey("C", SouthEast)
  gameInterface.bindWalkKey("Z", SouthWest)

  consoleToggleChat:setTooltip(tr("Enable chat mode"))
end

  g_keyboard.bindKeyPress('Ctrl+A', function() consoleTextEdit:clearText() end, consolePanel)

These are the lines you will find if you search for its id.
 
I dont understand your problem, please explain it better do some pictures
 
I dont understand your problem, please explain it better do some pictures
texbox.png

My problem is with this TextEdit box, know by chat and declared at modules/game_console

So, usually when you login this box is automatically selected and you can rightaway type and the box will be modified with the words your typed.
But mine isn't doing like this, it's not being selected after I login. I must manually select it. So I am asking for help to find where is the command /line/function that does it, so I can call it and fix my problem.
 
texbox.png

My problem is with this TextEdit box, know by chat and declared at modules/game_console

So, usually when you login this box is automatically selected and you can rightaway type and the box will be modified with the words your typed.
But mine isn't doing like this, it's not being selected after I login. I must manually select it. So I am asking for help to find where is the command /line/function that does it, so I can call it and fix my problem.
After login there is no cursor and you can't write?
 
After login there is no cursor and you can't write?
I do have the cursor on the screen, but the text box doesn't have it. That is why I have to click at the text box to "enable" writing and it should be enabled since login, I mean, I shouldn't require the click to be enabled.

I am not sure if this answer your question correctly XD

EDIT: I need to click anywhere at the chat panel, not just the text box.
EDIT2: If I use
grabMouse(), it works, then I can't use the mouse for any other function.. Though seems to be no function that only clicks.

Solved: The problem was that other windows were taking the focus to them, so the gameBottomPanel was losing its focus at game startup and when you clicked at those windows.
 
Last edited:
Back
Top