Skip to content

Commit

Permalink
Merge branch 'main' into use-real-archetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
memorycode authored Oct 20, 2024
2 parents 4cbf907 + 18e5b29 commit fd9b4a6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ The format is based on [Keep a Changelog][kac], and this project adheres to

### Added

- Added `Loop:setWorlds({world})`. This is a breaking change and is now required for the Loop and Debugger to operate properly.
- Implemented a deferred command mode for the registry.
- The Loop turns deferring on for all worlds given to it.
- The `Loop` turns deferring on for all worlds given to it.
- The command buffer is flushed between systems.
- Iterator invalidation is now only prevented in deferred mode.
- The debugger now supports `Loop` parameters of any kind.
- For example, you can now have a single `Loop` state table that contains your World, and the debugger will display it properly.
- Added a button to the Debugger's system list to sort by run time.

### Deprecated

Expand Down
17 changes: 16 additions & 1 deletion lib/debugger/ui.luau
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,17 @@ local function ui(debugger, loop)
end
end

local sortByDuration, setSortByDuration = plasma.useState(false)

plasma.space(15)
plasma.heading("SYSTEMS")
plasma.row({ verticalAlignment = Enum.VerticalAlignment.Center }, function()
plasma.heading("SYSTEMS")

if plasma.button(`sort by: {sortByDuration and "duration" or "order"}`):clicked() then
setSortByDuration(not sortByDuration)
end
end)

plasma.space(10)

local durations = {}
Expand Down Expand Up @@ -212,6 +221,12 @@ local function ui(debugger, loop)
})
end

if sortByDuration then
table.sort(listOfSystems, function(a, b)
return (durations[a.system] or 0) > (durations[b.system] or 0)
end)
end

local systemList = custom.selectionList(listOfSystems, custom)
local selected = systemList:selected()
local rightClicked = systemList:rightClicked()
Expand Down
3 changes: 2 additions & 1 deletion lib/debugger/widgets/selectionList.luau
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ return function(Plasma)

Plasma.useEffect(function()
refs.mainText.Text = text
refs.index.Text = index or ""
refs.button.container.Icon.Text = icon or ""
refs.button.container.Icon.Visible = icon ~= nil
end, text, icon)
end, text, icon, index)

refs.button.container.sideText.Visible = sideText ~= nil
refs.button.container.sideText.Text = if sideText ~= nil then sideText else ""
Expand Down

0 comments on commit fd9b4a6

Please sign in to comment.