diff --git a/changelog.txt b/changelog.txt index 79267f73cd..cb3152d5ff 100644 --- a/changelog.txt +++ b/changelog.txt @@ -73,6 +73,7 @@ Template for new versions: - `caravan`: bring goods to depot screen now shows (approximate) distance from item to depot - `gui/design`: circles are more circular (now matches more pleasing shape generated by ``digcircle``) - `gui/quickfort`: you can now delete your blueprints from the blueprint load dialog +- `caravan`: remember filter settings for pedestal item assignment dialog - `quickfort`: new ``delete`` command for deleting player-owned blueprints (library and mod-added blueprints cannot be deleted) - `quickfort`: support enabling `logistics` features for autoforbid and autoclaim on stockpiles - `gui/quickfort`: allow farm plots, dirt roads, and paved roads to be designated around partial obstructions without callling it an error, matching vanilla behavior diff --git a/internal/caravan/pedestal.lua b/internal/caravan/pedestal.lua index faed8929f2..c9d797ddcd 100644 --- a/internal/caravan/pedestal.lua +++ b/internal/caravan/pedestal.lua @@ -19,6 +19,15 @@ for k, v in pairs(STATUS) do STATUS_REVMAP[v.value] = k end +-- save filters (sans search string) between dialog invocations +local filters = { + min_quality=0, + max_quality=6, + hide_unreachable=true, + hide_forbidden=false, + inside_containers=true, +} + -- ------------------- -- AssignItems -- @@ -214,8 +223,9 @@ function AssignItems:init() {label=common.CH_MONEY..'Masterful'..common.CH_MONEY, value=5}, {label='Artifact', value=6}, }, - initial_option=0, + initial_option=filters.min_quality, on_change=function(val) + filters.min_quality = val if self.subviews.max_quality:getOptionValue() < val then self.subviews.max_quality:setOption(val) end @@ -238,8 +248,9 @@ function AssignItems:init() {label=common.CH_MONEY..'Masterful'..common.CH_MONEY, value=5}, {label='Artifact', value=6}, }, - initial_option=6, + initial_option=filters.max_quality, on_change=function(val) + filters.max_quality = val if self.subviews.min_quality:getOptionValue() > val then self.subviews.min_quality:setOption(val) end @@ -269,8 +280,11 @@ function AssignItems:init() {label='Yes', value=true, pen=COLOR_GREEN}, {label='No', value=false} }, - initial_option=true, - on_change=function() self:refresh_list() end, + initial_option=filters.hide_unreachable, + on_change=function(val) + filters.hide_unreachable = val + self:refresh_list() + end, }, widgets.ToggleHotkeyLabel{ view_id='hide_forbidden', @@ -281,8 +295,12 @@ function AssignItems:init() {label='Yes', value=true, pen=COLOR_GREEN}, {label='No', value=false} }, - initial_option=false, - on_change=function() self:refresh_list() end, + option_gap=3, + initial_option=filters.hide_forbidden, + on_change=function(val) + filters.hide_forbidden = val + self:refresh_list() + end, }, }, }, @@ -366,8 +384,11 @@ function AssignItems:init() {label='Yes', value=true, pen=COLOR_GREEN}, {label='No', value=false} }, - initial_option=true, - on_change=function() self:refresh_list() end, + initial_option=filters.inside_containers, + on_change=function(val) + filters.inside_containers = val + self:refresh_list() + end, }, widgets.WrappedLabel{ frame={b=0, l=0, r=0},