Skip to content

Commit 9f1b1ad

Browse files
author
Antigravity
committed
checkpoint: layout adjustments and project restructuring (broken)
1 parent 2623209 commit 9f1b1ad

File tree

135 files changed

+10348
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+10348
-54
lines changed

.luarc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3+
"Lua.runtime.version": "Lua 5.4",
4+
"Lua.diagnostics.globals": [
5+
"ImMenu",
6+
"loadlib",
7+
"warn"
8+
],
9+
"Lua.runtime.pathStrict": false,
10+
"Lua.workspace.library": [
11+
".vscode/Lmaobox-Annotations/library"
12+
],
13+
"Lua.workspace.ignoreDir": [
14+
"node_modules",
15+
".vscode"
16+
],
17+
"Lua.workspace.checkThirdParty": false,
18+
"Lua.telemetry.enable": false
19+
}

.vscode/.luarc.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

.vscode/Lmaobox-Annotations

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 1c72c06cf81fdff3c3518bdca3e1099fe7db5785

TimMenu/Interaction.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ function Interaction.IsHovered(win, bounds)
4848
if win._widgetBlockedRegions then
4949
local elementInBlockedRegion = false
5050
for _, region in ipairs(win._widgetBlockedRegions) do
51-
if
52-
bounds.x >= region.x
53-
and bounds.x + bounds.w <= region.x + region.w
54-
and bounds.y >= region.y
55-
and bounds.y + bounds.h <= region.y + region.h
56-
then
51+
local withinXStart = bounds.x >= region.x
52+
local withinXEnd = bounds.x + bounds.w <= region.x + region.w
53+
local withinYStart = bounds.y >= region.y
54+
local withinYEnd = bounds.y + bounds.h <= region.y + region.h
55+
56+
local isFullyInside = withinXStart and withinXEnd and withinYStart and withinYEnd
57+
58+
if isFullyInside then
5759
elementInBlockedRegion = true
5860
break
5961
end

TimMenu/Layout/Sector.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,17 @@ local function _enqueueBorderDraw(win, layoutState, depth, size)
122122
end)
123123
end
124124

125-
local function _finalizeCursorAndLayout(win, layoutState, width, rowHeight)
125+
local function _finalizeCursorAndLayout(win, layoutState, width, rowHeight, sameLine)
126126
-- Treat sector as a single widget occupying the computed width/height
127127
local horizontalSpacing = getHorizontalGap()
128128
win.cursorX = layoutState.startX + width + horizontalSpacing
129129
win.cursorY = layoutState.startY
130130
local verticalGap = getVerticalGap()
131-
win.lineHeight = math.max(layoutState.preLineHeight or 0, rowHeight + verticalGap)
131+
win.lineHeight = math.max(layoutState.preLineHeight or 0, rowHeight)
132+
133+
if not sameLine then
134+
win:NextLine(verticalGap)
135+
end
132136

133137
if #win._sectorStack > 0 then
134138
local parentSector = win._sectorStack[#win._sectorStack]
@@ -236,7 +240,7 @@ function Sector.Begin(win, label)
236240
end
237241
end
238242

239-
function Sector.End(win)
243+
function Sector.End(win, sameLine)
240244
if not win._sectorStack or #win._sectorStack == 0 then
241245
return
242246
end
@@ -263,7 +267,7 @@ function Sector.End(win)
263267
win.QueueDrawAtLayer = layoutState.origQueue
264268

265269
-- Use calculated currentWidth/Height for layout/cursor updates, but persistent for drawing.
266-
_finalizeCursorAndLayout(win, layoutState, persistentSize.width, rowHeight)
270+
_finalizeCursorAndLayout(win, layoutState, persistentSize.width, rowHeight, sameLine)
267271
end
268272

269273
return Sector

TimMenu/Main.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ function TimMenu.BeginSector(label)
263263
end, label)
264264
end
265265

266-
function TimMenu.EndSector()
266+
function TimMenu.EndSector(sameLine)
267267
local win = TimMenu.GetCurrentWindow()
268268
if not win or not win._sectorStack or #win._sectorStack == 0 then
269269
return
270270
end
271-
SectorWidget.End(win)
271+
SectorWidget.End(win, sameLine)
272272
end
273273

274274
local reRegistered = false

TimMenu/Widgets/Tooltip.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local Globals = require("TimMenu.Globals")
22
local Common = require("TimMenu.Common")
33
local Popup = require("TimMenu.Layout.Popup")
4+
local Utils = require("TimMenu.Utils")
45

56
local Tooltip = {}
67

@@ -124,7 +125,6 @@ function Tooltip.ProcessWindowTooltips(win)
124125
end
125126

126127
local mouseX, mouseY = table.unpack(input.GetMousePos())
127-
local Utils = require("TimMenu.Utils")
128128

129129
for index = #boundsList, 1, -1 do
130130
local bounds = boundsList[index]

TimMenu/Window.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ end
7878
function Window:_HitTest(x, y)
7979
-- Check main window bounds (title bar + content area)
8080
local titleHeight = Globals.Defaults.TITLE_BAR_HEIGHT
81-
local mainBounds = x >= self.X and x <= self.X + self.W and y >= self.Y and y <= self.Y + titleHeight + self.H
81+
local mainBounds = x >= self.X and x <= self.X + self.W and y >= self.Y and y <= self.Y + self.H
8282

8383
-- If main bounds pass, return true
8484
if mainBounds then
@@ -129,7 +129,7 @@ function Window:_Draw()
129129
-- Background
130130
Common.SetColor(Globals.Colors.Window)
131131
-- Background covers title + content area (no extra padding)
132-
Common.DrawFilledRect(self.X, self.Y + titleHeight, self.X + self.W, self.Y + titleHeight + self.H)
132+
Common.DrawFilledRect(self.X, self.Y + titleHeight, self.X + self.W, self.Y + self.H)
133133

134134
-- Title bar
135135
Common.SetColor(Globals.Colors.Title)
@@ -139,7 +139,7 @@ function Window:_Draw()
139139
if Globals.Style.EnableWindowBorder then
140140
Common.SetColor(Globals.Colors.WindowBorder)
141141
-- Outline around full window including title and content area
142-
Common.DrawOutlinedRect(self.X, self.Y, self.X + self.W, self.Y + titleHeight + self.H)
142+
Common.DrawOutlinedRect(self.X, self.Y, self.X + self.W, self.Y + self.H)
143143
end
144144

145145
-- Title text
@@ -172,7 +172,7 @@ function Window:AddWidget(width, height)
172172
-- Update window dimensions if needed
173173
self.W = math.max(self.W, x + width + padding)
174174
self.lineHeight = math.max(self.lineHeight, height)
175-
self.H = math.max(self.H, y + self.lineHeight)
175+
self.H = math.max(self.H, y + self.lineHeight + padding)
176176

177177
-- Update cursor position for the *next* widget on this line
178178
local horizontalSpacing = Globals.Style.ItemSpacingX or Globals.Defaults.ITEM_SPACING

node_modules/.bin/moonsharp-luaparse

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/moonsharp-luaparse.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)