Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Template for new versions:
## New Tools

## New Features
- `stocks`: add button/hotkey for expanding all categories on stocks interface

## Fixes

Expand Down
14 changes: 14 additions & 0 deletions plugins/lua/stocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ local function collapse_all()
stocks.i_height = num_sections * 3
end

local function expand_all()
local num_sections = #stocks.current_type_a_expanded
for idx=0,num_sections-1 do
stocks.current_type_a_expanded[idx] = true
end
stocks.i_height = num_sections * 3
end

local function remove_empty()
local empties = {}
for itype,v in ipairs(stocks.storeamount) do
Expand Down Expand Up @@ -52,6 +60,12 @@ function StocksOverlay:init()
key='CUSTOM_CTRL_X',
on_activate=collapse_all,
},
widgets.HotkeyLabel{
frame={t=1, l=0},
label='expand all',
key='CUSTOM_CTRL_Z',
on_activate=expand_all,
},
widgets.HotkeyLabel{
frame={t=2, l=0},
label='remove empties',
Expand Down