From 7873ff8b5aa91723277b860d41342f6fb5784b8c Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 3 Nov 2023 16:41:58 -0700 Subject: [PATCH] docs and branding --- docs/plugins/buildingplan.rst | 7 +++ plugins/lua/buildingplan/mechanisms.lua | 63 +++++++++++++------------ 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/docs/plugins/buildingplan.rst b/docs/plugins/buildingplan.rst index db04a97f7..b1e77a80d 100644 --- a/docs/plugins/buildingplan.rst +++ b/docs/plugins/buildingplan.rst @@ -190,3 +190,10 @@ bump the items for this building to the front of their respective queues. Note that each item type and filter configuration has its own queue, so even if an item is in queue position 1, there may be other queues that snag the needed item first. + +Lever linking +------------- + +When linking levers, `buildingplan` extends the vanilla panel by offering +control over which mechanisms are chosen for installation at the lever and at +the target. Heat safety filters are provided for convenience. diff --git a/plugins/lua/buildingplan/mechanisms.lua b/plugins/lua/buildingplan/mechanisms.lua index 0993953cd..4b6e42885 100644 --- a/plugins/lua/buildingplan/mechanisms.lua +++ b/plugins/lua/buildingplan/mechanisms.lua @@ -20,35 +20,40 @@ MechanismOverlay.ATTRS{ function MechanismOverlay:init() self:addviews{ - widgets.Label{ - frame={t=4, l=2}, - text='Mechanism safety:' - }, - widgets.CycleHotkeyLabel{ - view_id='safety_lever', - frame={t=4, l=21, w=15}, - key='CUSTOM_G', - label='Lever:', - options={ - {label='Any', value=0}, - {label='Magma', value=2, pen=COLOR_RED}, - {label='Fire', value=1, pen=COLOR_LIGHTRED}, - }, - initial_option=0, - on_change=self:callback('choose_mechanism', 'lever', true), - }, - widgets.CycleHotkeyLabel{ - view_id='safety_target', - frame={t=4, l=38, w=16}, - key='CUSTOM_SHIFT_G', - label='Target:', - options={ - {label='Any', value=0}, - {label='Magma', value=2, pen=COLOR_RED}, - {label='Fire', value=1, pen=COLOR_LIGHTRED}, - }, - initial_option=0, - on_change=self:callback('choose_mechanism', 'target', true), + widgets.BannerPanel{ + frame={t=4, l=1, r=1, h=1}, + subviews={ + widgets.Label{ + frame={t=0, l=1}, + text='Mechanism safety:' + }, + widgets.CycleHotkeyLabel{ + view_id='safety_lever', + frame={t=0, l=20, w=15}, + key='CUSTOM_G', + label='Lever:', + options={ + {label='Any', value=0}, + {label='Magma', value=2, pen=COLOR_RED}, + {label='Fire', value=1, pen=COLOR_LIGHTRED}, + }, + initial_option=0, + on_change=self:callback('choose_mechanism', 'lever', true), + }, + widgets.CycleHotkeyLabel{ + view_id='safety_target', + frame={t=0, l=38, w=16}, + key='CUSTOM_SHIFT_G', + label='Target:', + options={ + {label='Any', value=0}, + {label='Magma', value=2, pen=COLOR_RED}, + {label='Fire', value=1, pen=COLOR_LIGHTRED}, + }, + initial_option=0, + on_change=self:callback('choose_mechanism', 'target', true), + }, + } }, widgets.HotkeyLabel{ frame={t=7, l=8, w=49, h=2},