Demo: Selection State & Multi-Select section (ExampleSelectionWithDeletion, ExampleDualListBox, all 11 sub-demos) and Assets Browser ported; fix ImFloor() for negative non-integers (was floor-1)

This commit is contained in:
4DBug
2026-10-15 04:13:40 -05:00
parent 049e160852
commit d18bc714fc
9 changed files with 4317 additions and 53 deletions
+1 -1
View File
@@ -1 +1 @@
[[46, "imgui.lua"], [21437, "imgui_demo.lua"], [31865, "imgui_draw.lua"], [37808, "imgui_h.lua"], [40651, "imgui_impl_roblox.lua"], [42299, "imgui_impl_roblox_fonts.lua"], [48702, "imgui_internal.lua"], [52369, "imgui_tables.lua"], [57428, "imgui_widgets.lua"], [69417, "imstb_rectpack.lua"], [70081, "imstb_textedit.lua"], [71623, "imstb_truetype.lua"], [74411, "imstd_minstdio.lua"]]
[[46, "imgui.lua"], [21437, "imgui_demo.lua"], [33279, "imgui_draw.lua"], [39222, "imgui_h.lua"], [42065, "imgui_impl_roblox.lua"], [43713, "imgui_impl_roblox_fonts.lua"], [50116, "imgui_internal.lua"], [53783, "imgui_tables.lua"], [58842, "imgui_widgets.lua"], [70831, "imstb_rectpack.lua"], [71495, "imstb_textedit.lua"], [73037, "imstb_truetype.lua"], [75825, "imstd_minstdio.lua"]]
+1433 -9
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
[[183, "imgui.lua"], [21574, "imgui_demo.lua"], [32002, "imgui_draw.lua"], [37945, "imgui_h.lua"], [40788, "imgui_impl_love.lua"], [41328, "imgui_internal.lua"], [44995, "imgui_tables.lua"], [50054, "imgui_widgets.lua"], [62043, "imstb_rectpack.lua"], [62707, "imstb_textedit.lua"], [64249, "imstb_truetype.lua"], [67037, "imstd_minstdio.lua"]]
[[183, "imgui.lua"], [21574, "imgui_demo.lua"], [33416, "imgui_draw.lua"], [39359, "imgui_h.lua"], [42202, "imgui_impl_love.lua"], [42742, "imgui_internal.lua"], [46409, "imgui_tables.lua"], [51468, "imgui_widgets.lua"], [63457, "imstb_rectpack.lua"], [64121, "imstb_textedit.lua"], [65663, "imstb_truetype.lua"], [68451, "imstd_minstdio.lua"]]
+1433 -9
View File
File diff suppressed because it is too large Load Diff
+25 -25
View File
@@ -16,16 +16,16 @@ imgui.cpp 786 87.4% 93.5% 75.0% 2
imgui_widgets.cpp 308 93.8% 98.7% 78.1% 1
imgui_draw.cpp 258 75.2% 75.5% 63.1% 2
imgui_tables.cpp 113 96.5% 99.0% 74.0% 0
imgui_demo.cpp 56 82.1% 98.2% 50.8% 0
imgui_demo.cpp 56 82.1% 98.2% 55.4% 0
imgui.h 110 53.6% 37.4% 56.7% 0
imgui_internal.h 269 61.3% 64.9% 68.3% 0
TOTAL 1900 81.5% 92.8% 69.9% 5
imgui_internal.h 269 61.3% 64.9% 68.0% 1
TOTAL 1900 81.5% 92.8% 70.7% 6
upstream code reproduced (similarity x ported size / all upstream size): 64.8%
upstream code reproduced (similarity x ported size / all upstream size): 65.6%
Public API (imgui.h, namespace ImGui) 368 / 376 97.9%
Internal API (imgui_internal.h, namespace ImGui) 417 / 443 94.1%
Enum values (imgui.h + imgui_internal.h) 1005 / 1078 93.2%
Struct fields (imgui.h + imgui_internal.h) 1820 / 1926 94.5%
Struct fields (imgui.h + imgui_internal.h) 1822 / 1926 94.6%
Legend: [x] ported (sim %) [~] stub [ ] not ported [-] excluded (c++-only / obsolete / os-specific / #if 0 / test-engine)
@@ -1812,48 +1812,48 @@ imgui_demo.cpp
[ ] ExampleDualListBox::CompareItemsByValue
[ ] ExampleDualListBox::SortItems
[ ] ExampleDualListBox::Show
[x] 1% DemoWindowWidgetsSelectionAndMultiSelect imgui_demo.lua:2754
[x] 71% DemoWindowWidgetsSelectionAndMultiSelect imgui_demo.lua:3130
-- DemoWindowWidgetsTabs()
[x] 58% EditTabBarFittingPolicyFlags imgui_demo.lua:2768
[x] 70% DemoWindowWidgetsTabs imgui_demo.lua:2798
[x] 58% EditTabBarFittingPolicyFlags imgui_demo.lua:3755
[x] 70% DemoWindowWidgetsTabs imgui_demo.lua:3785
-- DemoWindowWidgetsText()
[x] 89% DemoWindowWidgetsText imgui_demo.lua:2954
[x] 89% DemoWindowWidgetsText imgui_demo.lua:3941
-- DemoWindowWidgetsTextFilter()
[x] 84% DemoWindowWidgetsTextFilter imgui_demo.lua:3068
[x] 84% DemoWindowWidgetsTextFilter imgui_demo.lua:4055
-- DemoWindowWidgetsTextInput()
[x] 75% DemoWindowWidgetsTextInput imgui_demo.lua:3143
[x] 75% DemoWindowWidgetsTextInput imgui_demo.lua:4130
-- DemoWindowWidgetsTooltips()
[x] 84% DemoWindowWidgetsTooltips imgui_demo.lua:3327
[x] 84% DemoWindowWidgetsTooltips imgui_demo.lua:4314
-- DemoWindowWidgetsTreeNodes()
[x] 75% DemoWindowWidgetsTreeNodes imgui_demo.lua:3434
[x] 75% DemoWindowWidgetsTreeNodes imgui_demo.lua:4421
-- DemoWindowWidgetsVerticalSliders()
[x] 83% DemoWindowWidgetsVerticalSliders imgui_demo.lua:3615
[x] 83% DemoWindowWidgetsVerticalSliders imgui_demo.lua:4602
-- DemoWindowWidgets()
[x] 97% DemoWindowWidgets imgui_demo.lua:3683
[x] 97% DemoWindowWidgets imgui_demo.lua:4670
-- DemoWindowLayout()
[x] 81% DemoWindowLayout imgui_demo.lua:3790
[x] 81% DemoWindowLayout imgui_demo.lua:4777
-- DemoWindowPopups()
[x] 59% DemoWindowPopups imgui_demo.lua:4634
[x] 59% DemoWindowPopups imgui_demo.lua:5621
[ ] MyItem::SortWithSortSpecs
[ ] MyItem::CompareWithSortSpecs
[x] 96% PushStyleCompact imgui_demo.lua:4996
[x] 100% PopStyleCompact imgui_demo.lua:5002
[x] 69% EditTableSizingFlags imgui_demo.lua:5009
[x] 74% EditTableColumnsFlags imgui_demo.lua:5061
[x] 100% ShowTableColumnsStatusFlags imgui_demo.lua:5091
[x] 96% PushStyleCompact imgui_demo.lua:5983
[x] 100% PopStyleCompact imgui_demo.lua:5989
[x] 69% EditTableSizingFlags imgui_demo.lua:5996
[x] 74% EditTableColumnsFlags imgui_demo.lua:6048
[x] 100% ShowTableColumnsStatusFlags imgui_demo.lua:6078
-- DemoWindowTables()
[x] 41% DemoWindowTables imgui_demo.lua:5237
[x] 41% DemoWindowTables imgui_demo.lua:6224
====================================================================================================
imgui.h
@@ -2065,7 +2065,7 @@ imgui_internal.h
[x] 67% ImLengthSqr imgui_internal.lua:434
[ ] ImInvLength
[x] 24% ImTrunc imgui_internal.lua:242
[x] 69% ImFloor imgui_internal.lua:266
[~] 25% ImFloor imgui_internal.lua:266 stub
[x] 15% ImTrunc64 imgui_internal.lua:248 = _Trunc
[ ] ImRoundPositive64
[ ] ImRoundSigned64
@@ -2496,7 +2496,7 @@ Enums (values ported / total; missing listed)
====================================================================================================
Struct fields (name found in the port / total; missing listed). Field names are matched globally, so common names may over-count.
====================================================================================================
ExampleDualListBox 1 / 3 missing: Selections, OptKeepSorted
ExampleDualListBox 3 / 3
ExampleImageViewerData 8 / 8
ExampleMemberInfo 4 / 4
ExampleTreeNode 9 / 9
+1420 -6
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -263,7 +263,7 @@ function IM_TRUNC(VAL) return math.floor(VAL) end -- Positive values only!
function IM_ROUND(VAL) return math.floor(VAL + 0.5) end -- Positive values only!
--@hoist
function ImFloor(f) if f >= 0 or math.floor(f) == f then return math.floor(f) else return math.floor(f) - 1 end end -- Decent replacement for floorf()
function ImFloor(f) return math.floor(f) end -- Decent replacement for floorf() -- [Luau] upstream: (int)f truncates, -1 for negatives == math.floor
-- Helpers: Bit manipulation
--- @param v int
+1 -1
View File
@@ -4,4 +4,4 @@ set -e
cd "$(dirname "$0")/../../.."
python3 tools/bundle.py --target love >/dev/null
nix-shell -p luajit --run "luajit tools/test/love/t_drawhash.lua 150 Widgets,Basic && luajit tools/test/love/t_drawhash.lua 150 all && luajit tools/test/love/t_examples.lua"
echo "expected (Luau, tools/test/scripts/t_drawhash.luau): 379637274 / 1789163281"
echo "expected (Luau, tools/test/scripts/t_drawhash.luau): 855922436 / 1889516030"
+2
View File
@@ -16,6 +16,8 @@ local w = {}
for _, it in items do w[it.Index] = it.Width end
check(w[3] == 100 and w[2] == 100 and w[1] == 99 and w[0] == 99, ("ShrinkWidths widths %s %s %s %s"):format(w[0], w[1], w[2], w[3]))
check(G.ImFloor(-1.5) == -2 and G.ImFloor(-0.2) == -1 and G.ImFloor(2.7) == 2, "ImFloor negative")
local function edit_text()
local st = ImGui.GetCurrentContext().InputTextState
return G.ImGui._ByteArrayToString(st.TextA.Data, 1, st.TextLen + 1)