Skip to content

Commit

Permalink
SoarETX: include backward compatibility fix in bundled LibGUI
Browse files Browse the repository at this point in the history
Include #154 in SoarETX bundled LibGUI
  • Loading branch information
pfeerick committed Jun 11, 2024
1 parent 91c94a3 commit c13c6d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sdcard/c480x272/WIDGETS/LibGUI/libgui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ function M.newGUI()
local guiFocus = not gui.parent or (focused and gui.parent.editing)
for idx, element in ipairs(_.elements) do
-- Clients may provide an update function for elements
if element.onUpdate then -- new name the method
if element.onUpdate then -- New name for method
element.onUpdate(element)
elseif element.update then -- For backward compatibility
element.update(element)
Expand Down
4 changes: 3 additions & 1 deletion sdcard/c480x272/WIDGETS/SoarETX/libgui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,10 @@ function M.newGUI()
local guiFocus = not gui.parent or (focused and gui.parent.editing)
for idx, element in ipairs(_.elements) do
-- Clients may provide an update function for elements
if element.onUpdate then
if element.onUpdate then -- New name for method
element.onUpdate(element)
elseif element.update then -- For backward compatibility
element.update(element)
end
if not element.hidden then
element.draw(_.focus == idx and guiFocus)
Expand Down
2 changes: 1 addition & 1 deletion sdcard/c480x320/WIDGETS/LibGUI/libgui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ function M.newGUI()
local guiFocus = not gui.parent or (focused and gui.parent.editing)
for idx, element in ipairs(_.elements) do
-- Clients may provide an update function for elements
if element.onUpdate then -- new name the method
if element.onUpdate then -- New name for method
element.onUpdate(element)
elseif element.update then -- For backward compatibility
element.update(element)
Expand Down

0 comments on commit c13c6d5

Please sign in to comment.