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

Lua OTClient Minimize Chat Window.

ObsidianQ

Member
Joined
Jan 26, 2017
Messages
100
Solutions
1
Reaction score
10
Hello,

dj_T57CySyGoqLxGu9HWvg.png


I'd like to make the Chat Window minimize when i click the square which enables ASDW Walking. Description message says: (Disable chat mode, allow to walk using ASDW) and only toggle offs the talking bar.

I'd like to also make it minimize the chat window till the bottom, leaving only the bar of the button and channel labels on the bottom (parent.bottom)
eXLZmxzPRZqprqzpHOvuYQ.png


Can please someone help me?

 
modules\game_console\console.lua

Lua:
function toggleChat()
  local gameInterface = modules.game_interface
  local sayModeButton = consolePanel:getChildById('sayModeButton')
  if consoleToggleChat:isChecked() then
    gameInterface.getSplitter():setMarginBottom(30)
    sayModeButton:setVisible(false)
    consoleTextEdit:setVisible(false)
  else
    gameInterface.getSplitter():setMarginBottom(150)
    sayModeButton:setVisible(true)
    consoleTextEdit:setVisible(true)
  end
end

And on function online(), add this:
Lua:
  local gameInterface = modules.game_interface
  local sayModeButton = consolePanel:getChildById('sayModeButton')
  if not sayModeButton:isVisible() or not consoleTextEdit:isVisible() or gameInterface.getSplitter():getMarginBottom() < 30 then
    gameInterface.getSplitter():setMarginBottom(150)
    sayModeButton:setVisible(true)
    consoleTextEdit:setVisible(true)
  end
 
modules\game_console\console.lua

Lua:
function toggleChat()
  local gameInterface = modules.game_interface
  local sayModeButton = consolePanel:getChildById('sayModeButton')
  if consoleToggleChat:isChecked() then
    gameInterface.getSplitter():setMarginBottom(30)
    sayModeButton:setVisible(false)
    consoleTextEdit:setVisible(false)
  else
    gameInterface.getSplitter():setMarginBottom(150)
    sayModeButton:setVisible(true)
    consoleTextEdit:setVisible(true)
  end
end

And on function online(), add this:
Lua:
  local gameInterface = modules.game_interface
  local sayModeButton = consolePanel:getChildById('sayModeButton')
  if not sayModeButton:isVisible() or not consoleTextEdit:isVisible() or gameInterface.getSplitter():getMarginBottom() < 30 then
    gameInterface.getSplitter():setMarginBottom(150)
    sayModeButton:setVisible(true)
    consoleTextEdit:setVisible(true)
  end

Thank you so much for your reply!
PdQysDB3R4KCVxvy9WGXNg.png


But this error shows up :(

Edit:

Full error after clicking the box
5US0UoRSTkym8Eo43-91Mw.png


Do i have to add something to uiwidget.h?
I see there's few things like:
Code:
int getBorderTopWidth() { return m_borderWidth.top; }
int getBorderRightWidth() { return m_borderWidth.right; }
int getBorderBottomWidth() { return m_borderWidth.bottom; }
int getBorderLeftWidth() { return m_borderWidth.left; }
int getMarginTop() { return m_margin.top; }
int getMarginRight() { return m_margin.right; }
int getMarginBottom() { return m_margin.bottom; }
int getMarginLeft() { return m_margin.left; }
int getPaddingTop() { return m_padding.top; }
int getPaddingRight() { return m_padding.right; }
int getPaddingBottom() { return m_padding.bottom; }
int getPaddingLeft() { return m_padding.left; }
float getOpacity() { return m_opacity; }
float getRotation() { return m_rotation; }

Or luafunctions.cpp?

Sw8vr_xyToa2o4P5fiSTIw.png
 
Last edited:
Back
Top