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

OTC treeview or similar

zxmatzx

Advanced OT User
Joined
Dec 1, 2010
Messages
311
Solutions
27
Reaction score
154
Location
Brazil
GitHub
Mateuso8
Hello,
Im developing a module to the OTC, and i need a treeView component. Something like:
1591455056171.png
OTC have a component like this? I tryed puting a TextList inside another, but don't worked.
Lua:
for k, v in pairs(groups) do --Get groups
    local tmpGroup = g_ui.createWidget('GroupListWidget', groupsList) --create a GroupListWidget(TextList) in groupsList(TextList)
    tmpGroup:setText(v) --Set the group name
    for i = 1, math.random(5, 10) do --Get some random values
        local tmp = g_ui.createWidget('MonsterWidget', tmpGroup) --create a MonsterWidget(Label) in tmpGroup(TextList)
        tmp:setText(math.random(1, 100)) --Put some random text in MonsterWidget(Label)
    end
end
The result is:
1591455628579.png
The .otui settings:

Code:
TextList
  id: groupsList
  size: 230 100
  anchors.top: parent.top
  anchors.left: parent.left
  anchors.bottom: parent.bottom
  anchors.right: parent.right
  margin-top: 2
  margin-left: 2
  margin-right: 2
  margin-bottom: 2

GroupListWidget < TextList
  margin-left: 2
  margin-right: 2
  margin-bottom: 1
  margin-top: 1

MonsterWidget < Label
  font: verdana-11px-monochrome
  background-color: alpha
  text-offset: 42 3
  focusable: true
Any help will be welcome. Where can i check all components avaliable in OTC? The lack of documentation turns the things really hard...
 

Attachments

Nope, there is no build-in TreeView component.
Do you know a way to accomplish that? ListText and/or VerticalList have a way to add a element and a children of the element?

Where i have to look for the functions that i can use in the components?
 
Back
Top