-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_sector_fix.lua
More file actions
47 lines (36 loc) · 1.49 KB
/
test_sector_fix.lua
File metadata and controls
47 lines (36 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--[[ Test script to demonstrate the sector positioning fix ]]
local TimMenu = require("TimMenu")
local function TestSectorFix()
if not TimMenu.Begin("Sector Position Test") then
return
end
-- Test 1: Two sectors side by side (this was broken before the fix)
TimMenu.BeginSector("Left Sector")
TimMenu.Checkbox("Option 1", false)
TimMenu.Checkbox("Option 2", true)
TimMenu.EndSector(true) -- true = stay on same line
TimMenu.BeginSector("Right Sector")
TimMenu.Checkbox("Setting 1", false)
TimMenu.Checkbox("Setting 2", true)
TimMenu.EndSector() -- false = move to next line (default)
-- Test 2: Three sectors in one row
TimMenu.BeginSector("First")
TimMenu.Checkbox("A", false)
TimMenu.EndSector(true)
TimMenu.BeginSector("Second")
TimMenu.Checkbox("B", true)
TimMenu.EndSector(true)
TimMenu.BeginSector("Third")
TimMenu.Checkbox("C", false)
TimMenu.EndSector() -- Move to next line after third
-- Test 3: Backwards compatibility - sectors without parameter work as before
TimMenu.BeginSector("Standalone")
TimMenu.Checkbox("Solo Option", false)
TimMenu.EndSector() -- No parameter = old behavior (move to next line)
TimMenu.End()
end
-- Register the test
callbacks.Register("Draw", "sector_test", TestSectorFix)
print("Sector positioning fix test loaded!")
print("Use TimMenu.EndSector(true) to keep sectors on same line")
print("Use TimMenu.EndSector() or TimMenu.EndSector(false) to move to next line")