• 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!

Change OTClient title

Modules -> game_interface -> gameinterface.lua.
And instead of + use double dot ( .. )
Lua:
g_window.setTitle(name .. ' - OTClient')
 
What error?
When i put that code in the same way as i did with your code ( that only shows character name when log in)
i log in but with a little windows box that says connectiong to the game world please wait
i can walk etc also the name does no change or shows the player name neither
im talking about this code
Code:
g_window.setTitle(name .. ' - Warera')
would be nice that when the players log in it would show name server + player name
atm only your code is working for me
that is this one
Code:
local name = g_game.getCharacterName()
g_window.setTitle(name)
 
I have tested it, and it works :d
d23de92cbcd648cfb0707f0a1b8d8fa2.png
 
game_interface/gameinterface.lua:
Lua:
function show()
  connect(g_app, { onClose = tryExit })
  modules.client_background.terminate()
  gameRootPanel:show()
  gameRootPanel:focus()
  gameMapPanel:followCreature(g_game.getLocalPlayer())
  updateStretchShrink()
  --logoutButton:setTooltip(tr('Logout'))
   
  local name = g_game.getCharacterName()
  g_window.setTitle(name .. ' - ' .. g_app.getName())

  addEvent(function()
    if not limitedZoom or g_game.isGM() then
      gameMapPanel:setMaxZoomOut(513)
      gameMapPanel:setLimitVisibleRange(false)
    else
      gameMapPanel:setMaxZoomOut(11)
      gameMapPanel:setLimitVisibleRange(true)
    end
  end)
end
And in hide
Lua:
function hide()
  disconnect(g_app, { onClose = tryExit })
  --logoutButton:setTooltip(tr('Exit'))

  if logoutWindow then
    logoutWindow:destroy()
    logoutWindow = nil
  end
  if exitWindow then
    exitWindow:destroy()
    exitWindow = nil
  end
  if countWindow then
    countWindow:destroy()
    countWindow = nil
  end
  gameRootPanel:hide()
  modules.client_background.init()
  g_window.setTitle(g_app.getName())
end
 
Inside skills.lua in onLevelChange function, inside make a callback to setName for application :)
 
Just in case someone is interested, I just setup the window name inside modules\client_background\background.lua

Below this line:
Code:
function init()

Just add this line:
Code:
g_window.setTitle('My Window Name Is Cool :D')

Like this:
Code:
function init()
  g_window.setTitle('My Window Name Is Cool :D')

Just to keep the code organized...

Please correct me if I'm wrong :)
 
Back
Top