Raygui lib callbacks to single table.

This commit is contained in:
jussi
2024-03-21 23:18:35 +02:00
parent a7528da4eb
commit 95f03bae31
10 changed files with 568 additions and 533 deletions

View File

@@ -9,7 +9,7 @@ function TreeItem:new( bounds, text, callbacks, styles, tooltip )
object.bounds = bounds:clone()
object.text = text
object.callbacks = callbacks -- toggle, open.
object.callbacks = callbacks -- select, open.
object.controls = {}
@@ -68,8 +68,8 @@ function TreeItem:draw()
local oldActive = self.active
_, self.active = RL.GuiToggle( toggleRect, self.text, self.active )
if self.callbacks.toggle and oldActive ~= self.active then
self.callbacks.toggle( self )
if self.callbacks.select and oldActive ~= self.active then
self.callbacks.select( self )
end
if hasContainer then