From 205c10196dad4b22c64ccb959edeb06d6003882d Mon Sep 17 00:00:00 2001 From: Seekey13 Date: Sat, 21 Mar 2026 00:29:55 -1000 Subject: [PATCH 1/5] set values --- configs/config.lua | 5 +++++ models/window.lua | 8 +++++++- services/config_ui.lua | 39 +++++++++++++++++++++++++++++++++++++++ ui/headers.lua | 5 +++++ ui/window.lua | 23 +++++++++++++++++++++-- 5 files changed, 77 insertions(+), 3 deletions(-) diff --git a/configs/config.lua b/configs/config.lua index 1ed621a..195039e 100644 --- a/configs/config.lua +++ b/configs/config.lua @@ -20,6 +20,11 @@ local default_settings = T{ completion_label = 'Completion'; hide_sorting_text = false; show_hvnm_title = true; + window_width = 700; + col_level_range_width = 125; + col_area_width = 175; + col_completion_width = 150; + col_location_width = 250; }; local settings = require('settings'); diff --git a/models/window.lua b/models/window.lua index 46fb1f1..dc98671 100644 --- a/models/window.lua +++ b/models/window.lua @@ -1,10 +1,16 @@ +local config = require('configs.config'); + local window = { is_open = true, is_minimized = false, title = 'Goblin Ventures', - size = { 700, 350 } + height = 224, }; +function window:get_size() + return { config.get('window_width') or 700, self.height }; +end + -- Update window state function window:update_state(imgui) self.is_minimized = imgui.IsWindowCollapsed(); diff --git a/services/config_ui.lua b/services/config_ui.lua index ddd23a6..7b239b6 100644 --- a/services/config_ui.lua +++ b/services/config_ui.lua @@ -147,6 +147,45 @@ function config_ui:draw() config.set('completion_label', completion_label[1]) end + imgui.Separator(); -- visual divider between sections + + -- Window & Column Widths + imgui.Text('Window & Column Widths (px)'); + + local window_width = { config.get('window_width') or 700 } + imgui.PushItemWidth(200) + if imgui.SliderInt('Window Width', window_width, 300, 1200) then + config.set('window_width', window_width[1]) + end + imgui.PopItemWidth() + + local col_lr = { config.get('col_level_range_width') or 125 } + imgui.PushItemWidth(200) + if imgui.SliderInt('Level Range Col', col_lr, 50, 400) then + config.set('col_level_range_width', col_lr[1]) + end + imgui.PopItemWidth() + + local col_area = { config.get('col_area_width') or 175 } + imgui.PushItemWidth(200) + if imgui.SliderInt('Area Col', col_area, 50, 400) then + config.set('col_area_width', col_area[1]) + end + imgui.PopItemWidth() + + local col_comp = { config.get('col_completion_width') or 150 } + imgui.PushItemWidth(200) + if imgui.SliderInt('Completion Col', col_comp, 50, 400) then + config.set('col_completion_width', col_comp[1]) + end + imgui.PopItemWidth() + + local col_loc = { config.get('col_location_width') or 250 } + imgui.PushItemWidth(200) + if imgui.SliderInt('Location Col', col_loc, 50, 500) then + config.set('col_location_width', col_loc[1]) + end + imgui.PopItemWidth() end imgui.End(); diff --git a/ui/headers.lua b/ui/headers.lua index 0e2f6e8..fe3a659 100644 --- a/ui/headers.lua +++ b/ui/headers.lua @@ -17,6 +17,11 @@ end -- Draw all headers function headers:draw() + imgui.SetColumnWidth(0, config.get('col_level_range_width') or 125); + imgui.SetColumnWidth(1, config.get('col_area_width') or 175); + imgui.SetColumnWidth(2, config.get('col_completion_width') or 150); + imgui.SetColumnWidth(3, config.get('col_location_width') or 250); + sort_button:draw_sort_button(config.get('level_range_label') or 'Level Range', 'level'); imgui.NextColumn(); sort_button:draw_sort_button(config.get('area_label') or 'Area', 'area'); diff --git a/ui/window.lua b/ui/window.lua index a105522..e43f479 100644 --- a/ui/window.lua +++ b/ui/window.lua @@ -19,7 +19,7 @@ function ui:draw(ventures) -- Set window title local window_title = window:get_title(highest.completion, highest.area, highest.position); - imgui.SetNextWindowSize(window.size, ImGuiCond_FirstUseEver); + imgui.SetNextWindowSize(window:get_size(), ImGuiCond_Always); local open = { config.get('show_gui') }; if imgui.Begin(window_title, open) then -- Set window styles @@ -28,11 +28,30 @@ function ui:draw(ventures) imgui.PushStyleColor(ImGuiCol_TitleBgActive, {0,0.06,0.16,0.9}); imgui.PushStyleColor(ImGuiCol_TitleBgCollapsed, {0,0.06,0.16,0.5}); - imgui.Columns(4); + imgui.Columns(4, nil, false); headers:draw(); rows:draw(ventures); + -- Draw manual vertical separator lines at column boundaries + local draw_list = imgui.GetWindowDrawList(); + local wx, wy = imgui.GetWindowPos(); + local cy = wy + imgui.GetFrameHeight() + 2; -- below title bar + local ch = imgui.GetWindowHeight() - imgui.GetFrameHeight() - 2; + local scroll_y = imgui.GetScrollY(); + local line_color = imgui.GetColorU32({1.0, 1.0, 1.0, 0.25}); + local col_x = 0; + for i = 0, 2 do + col_x = col_x + imgui.GetColumnWidth(i); + local x = wx + col_x + imgui.GetStyle().WindowPadding.x; + draw_list:AddLine({x, cy}, {x, cy + ch}, line_color, 1.0); + end + + -- Draw horizontal separator below headers + local header_y = cy + imgui.GetTextLineHeightWithSpacing() + 2; + local content_width = wx + imgui.GetWindowContentRegionWidth() + imgui.GetStyle().WindowPadding.x; + draw_list:AddLine({wx, header_y}, {content_width, header_y}, line_color, 1.0); + imgui.Columns(1); imgui.PopStyleColor(4); end From fce3a4b069309f5cd498072b1cc836e8a63c4ddd Mon Sep 17 00:00:00 2001 From: Seekey13 Date: Sat, 21 Mar 2026 00:37:29 -1000 Subject: [PATCH 2/5] horizontal lines --- models/window.lua | 2 +- ui/rows.lua | 5 ++++- ui/window.lua | 29 +++++++++++++---------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/models/window.lua b/models/window.lua index dc98671..7b0ff9e 100644 --- a/models/window.lua +++ b/models/window.lua @@ -4,7 +4,7 @@ local window = { is_open = true, is_minimized = false, title = 'Goblin Ventures', - height = 224, + height = 246, }; function window:get_size() diff --git a/ui/rows.lua b/ui/rows.lua index bc43328..a0ac681 100644 --- a/ui/rows.lua +++ b/ui/rows.lua @@ -110,8 +110,11 @@ end -- Draw all venture rows function rows:draw(ventures) - for _, venture in ipairs(ventures) do + for i, venture in ipairs(ventures) do self:draw_venture_row(venture); + if i < #ventures then + imgui.Separator(); + end end end diff --git a/ui/window.lua b/ui/window.lua index e43f479..dc44d9e 100644 --- a/ui/window.lua +++ b/ui/window.lua @@ -30,28 +30,25 @@ function ui:draw(ventures) imgui.Columns(4, nil, false); + -- Capture content region X for manual grid lines + local content_x, _ = imgui.GetCursorScreenPos(); + headers:draw(); rows:draw(ventures); - -- Draw manual vertical separator lines at column boundaries + -- Draw manual vertical separator lines at column boundaries (non-grippable) + -- Stop at the last row content, not the window bottom local draw_list = imgui.GetWindowDrawList(); - local wx, wy = imgui.GetWindowPos(); - local cy = wy + imgui.GetFrameHeight() + 2; -- below title bar - local ch = imgui.GetWindowHeight() - imgui.GetFrameHeight() - 2; - local scroll_y = imgui.GetScrollY(); - local line_color = imgui.GetColorU32({1.0, 1.0, 1.0, 0.25}); - local col_x = 0; - for i = 0, 2 do - col_x = col_x + imgui.GetColumnWidth(i); - local x = wx + col_x + imgui.GetStyle().WindowPadding.x; - draw_list:AddLine({x, cy}, {x, cy + ch}, line_color, 1.0); + local _, wy = imgui.GetWindowPos(); + local top_y = wy + imgui.GetFrameHeight(); + local _, bottom_y = imgui.GetCursorScreenPos(); + local line_color = 0x40FFFFFF; -- white at ~25% alpha (ABGR) + + for i = 1, 3 do + local x = content_x + imgui.GetColumnOffset(i); + draw_list:AddLine({x, top_y}, {x, bottom_y}, line_color, 1.0); end - -- Draw horizontal separator below headers - local header_y = cy + imgui.GetTextLineHeightWithSpacing() + 2; - local content_width = wx + imgui.GetWindowContentRegionWidth() + imgui.GetStyle().WindowPadding.x; - draw_list:AddLine({wx, header_y}, {content_width, header_y}, line_color, 1.0); - imgui.Columns(1); imgui.PopStyleColor(4); end From cd5a0bed5e0215d0bf47cc6c4e30cbadc29de24e Mon Sep 17 00:00:00 2001 From: Seekey13 Date: Sat, 21 Mar 2026 00:42:50 -1000 Subject: [PATCH 3/5] put vert back in --- ui/window.lua | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/ui/window.lua b/ui/window.lua index dc44d9e..8f8b8d0 100644 --- a/ui/window.lua +++ b/ui/window.lua @@ -28,27 +28,11 @@ function ui:draw(ventures) imgui.PushStyleColor(ImGuiCol_TitleBgActive, {0,0.06,0.16,0.9}); imgui.PushStyleColor(ImGuiCol_TitleBgCollapsed, {0,0.06,0.16,0.5}); - imgui.Columns(4, nil, false); - - -- Capture content region X for manual grid lines - local content_x, _ = imgui.GetCursorScreenPos(); + imgui.Columns(4, nil, true); headers:draw(); rows:draw(ventures); - -- Draw manual vertical separator lines at column boundaries (non-grippable) - -- Stop at the last row content, not the window bottom - local draw_list = imgui.GetWindowDrawList(); - local _, wy = imgui.GetWindowPos(); - local top_y = wy + imgui.GetFrameHeight(); - local _, bottom_y = imgui.GetCursorScreenPos(); - local line_color = 0x40FFFFFF; -- white at ~25% alpha (ABGR) - - for i = 1, 3 do - local x = content_x + imgui.GetColumnOffset(i); - draw_list:AddLine({x, top_y}, {x, bottom_y}, line_color, 1.0); - end - imgui.Columns(1); imgui.PopStyleColor(4); end From d16b3ad41e973719349ddfa72a27bf4557a352e5 Mon Sep 17 00:00:00 2001 From: Seekey13 Date: Sat, 21 Mar 2026 00:48:44 -1000 Subject: [PATCH 4/5] settings for vis --- configs/config.lua | 2 ++ models/window.lua | 3 ++- services/config_ui.lua | 12 ++++++++++++ ui/headers.lua | 4 +++- ui/rows.lua | 3 ++- ui/window.lua | 3 ++- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/configs/config.lua b/configs/config.lua index 195039e..0b76e1f 100644 --- a/configs/config.lua +++ b/configs/config.lua @@ -25,6 +25,8 @@ local default_settings = T{ col_area_width = 175; col_completion_width = 150; col_location_width = 250; + show_vertical_grid = true; + show_horizontal_grid = true; }; local settings = require('settings'); diff --git a/models/window.lua b/models/window.lua index 7b0ff9e..165f59b 100644 --- a/models/window.lua +++ b/models/window.lua @@ -8,7 +8,8 @@ local window = { }; function window:get_size() - return { config.get('window_width') or 700, self.height }; + local h = config.get('show_horizontal_grid') and 246 or 218; + return { config.get('window_width') or 700, h }; end -- Update window state diff --git a/services/config_ui.lua b/services/config_ui.lua index 7b239b6..2486666 100644 --- a/services/config_ui.lua +++ b/services/config_ui.lua @@ -149,6 +149,18 @@ function config_ui:draw() imgui.Separator(); -- visual divider between sections + -- Grid Visibility + local show_vgrid = { config.get('show_vertical_grid') } + if imgui.Checkbox('Show Vertical Grid', show_vgrid) then + config.set('show_vertical_grid', show_vgrid[1]) + end + local show_hgrid = { config.get('show_horizontal_grid') } + if imgui.Checkbox('Show Horizontal Grid', show_hgrid) then + config.set('show_horizontal_grid', show_hgrid[1]) + end + + imgui.Separator(); -- visual divider between sections + -- Window & Column Widths imgui.Text('Window & Column Widths (px)'); diff --git a/ui/headers.lua b/ui/headers.lua index fe3a659..b87a28b 100644 --- a/ui/headers.lua +++ b/ui/headers.lua @@ -30,7 +30,9 @@ function headers:draw() imgui.NextColumn(); headers:draw_location_header(); imgui.NextColumn(); - imgui.Separator(); + if config.get('show_horizontal_grid') then + imgui.Separator(); + end end return headers; \ No newline at end of file diff --git a/ui/rows.lua b/ui/rows.lua index a0ac681..dd4fa21 100644 --- a/ui/rows.lua +++ b/ui/rows.lua @@ -110,9 +110,10 @@ end -- Draw all venture rows function rows:draw(ventures) + local show_hgrid = config.get('show_horizontal_grid'); for i, venture in ipairs(ventures) do self:draw_venture_row(venture); - if i < #ventures then + if show_hgrid and i < #ventures then imgui.Separator(); end end diff --git a/ui/window.lua b/ui/window.lua index 8f8b8d0..5adad3a 100644 --- a/ui/window.lua +++ b/ui/window.lua @@ -28,7 +28,8 @@ function ui:draw(ventures) imgui.PushStyleColor(ImGuiCol_TitleBgActive, {0,0.06,0.16,0.9}); imgui.PushStyleColor(ImGuiCol_TitleBgCollapsed, {0,0.06,0.16,0.5}); - imgui.Columns(4, nil, true); + local show_vgrid = config.get('show_vertical_grid'); + imgui.Columns(4, nil, show_vgrid); headers:draw(); rows:draw(ventures); From ac97fd754e1997e4da1182a1059d6e01bd897faa Mon Sep 17 00:00:00 2001 From: Seekey13 Date: Sat, 21 Mar 2026 09:54:04 -1000 Subject: [PATCH 5/5] fix style leak --- ui/rows.lua | 1 + ui/sort_button.lua | 9 ++++++--- ui/window.lua | 36 ++++++++++++++++++++++-------------- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/ui/rows.lua b/ui/rows.lua index dd4fa21..1795d34 100644 --- a/ui/rows.lua +++ b/ui/rows.lua @@ -106,6 +106,7 @@ function rows:draw_venture_row(venture) end end imgui.NextColumn(); + imgui.PopStyleColor(); -- match PushStyleColor at start of draw_venture_row end -- Draw all venture rows diff --git a/ui/sort_button.lua b/ui/sort_button.lua index 9fd18ca..1e10a49 100644 --- a/ui/sort_button.lua +++ b/ui/sort_button.lua @@ -14,14 +14,17 @@ function sort_button:draw_sort_button(label, sort_by) desc = '' end - if config.get('sort_by') == sort_by then + -- Capture active state once so push/pop always match + local is_active = (config.get('sort_by') == sort_by); + + if is_active then imgui.PushStyleColor(ImGuiCol_Button, {0.2, 0.4, 0.8, 1.0}); imgui.PushStyleColor(ImGuiCol_ButtonHovered, {0.2, 0.4, 0.8, 1.0}); imgui.PushStyleColor(ImGuiCol_ButtonActive, {0.2, 0.4, 0.8, 1.0}); end local button_text = label; - if config.get('sort_by') == sort_by then + if is_active then button_text = button_text .. (config.get('sort_ascending') and asc or desc); end @@ -29,7 +32,7 @@ function sort_button:draw_sort_button(label, sort_by) sorter:set_column(sort_by); end - if config.get('sort_by') == sort_by then + if is_active then imgui.PopStyleColor(3); end end diff --git a/ui/window.lua b/ui/window.lua index 5adad3a..ca5564e 100644 --- a/ui/window.lua +++ b/ui/window.lua @@ -20,27 +20,35 @@ function ui:draw(ventures) local window_title = window:get_title(highest.completion, highest.area, highest.position); imgui.SetNextWindowSize(window:get_size(), ImGuiCond_Always); + imgui.PushStyleColor(ImGuiCol_WindowBg, {0,0.06,0.16,0.9}); + imgui.PushStyleColor(ImGuiCol_TitleBg, {0,0.06,0.16,0.7}); + imgui.PushStyleColor(ImGuiCol_TitleBgActive, {0,0.06,0.16,0.9}); + imgui.PushStyleColor(ImGuiCol_TitleBgCollapsed, {0,0.06,0.16,0.5}); + local open = { config.get('show_gui') }; - if imgui.Begin(window_title, open) then - -- Set window styles - imgui.PushStyleColor(ImGuiCol_WindowBg, {0,0.06,0.16,0.9}); - imgui.PushStyleColor(ImGuiCol_TitleBg, {0,0.06,0.16,0.7}); - imgui.PushStyleColor(ImGuiCol_TitleBgActive, {0,0.06,0.16,0.9}); - imgui.PushStyleColor(ImGuiCol_TitleBgCollapsed, {0,0.06,0.16,0.5}); + local ok, err = pcall(function() + if imgui.Begin(window_title, open) then + local show_vgrid = config.get('show_vertical_grid'); + imgui.Columns(4, nil, show_vgrid); - local show_vgrid = config.get('show_vertical_grid'); - imgui.Columns(4, nil, show_vgrid); + headers:draw(); + rows:draw(ventures); - headers:draw(); - rows:draw(ventures); + imgui.Columns(1); + end + window:update_state(imgui); + end); - imgui.Columns(1); - imgui.PopStyleColor(4); + if not ok then + print(string.format('[ventures] UI error: %s', tostring(err))); end - window:update_state(imgui); imgui.End(); - config.set('show_gui', open[1]) + imgui.PopStyleColor(4); + + if open[1] ~= config.get('show_gui') then + config.set('show_gui', open[1]); + end end return ui; \ No newline at end of file