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

OTClient Save checkbox config

so that he keeps the checkbox after logging out I'm trying to:

Code:
&save: true

Best way is use this in lua side:

Lua:
--Save
g_settings.set('unique_in_otc_name', value)

--Load
local checkBoxValue = g_settings.getBoolean('unique_in_otc_name')

1) Load UI.
Lua:
uiPanel = g_ui.loadUI('ui_file')

2) Get/set value to checkbox ui element.
Lua:
uiCheckbox = uiPanel:recursiveGetChildById('checkbox_id')

--Set value
uiCheckbox:setChecked(checkBoxValue)

--Get checked
local value = uiCheckbox:getChecked()
 
Code:
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

I edit here correct?
@MagicWall
Post automatically merged:

it also keeps the option checked after login, having to press twice for the function to work
 
Last edited:
Back
Top