Picker Extended Version

by Nexela

Enhances the players pipette tool with features such as quick blueprints, quick planners, ghost reviving, entity moving, orphan finding and more

3 years ago
0.14 - 1.1
23.7K

i Make planners not clatter your inventory

8 years ago

Change planners.lua:

local function planner_clicked(event)
local player, pdata = Player.get(event.player_index)
local item = game.item_prototypes[event.match]

if item then
    if event.button == defines.mouse_button_type.left then
        if planner_enabled(player, item) and player.clean_cursor() then
                pdata.last_planner = event.match
            player.cursor_stack.set_stack(event.match)
            event.element.parent.parent.parent.parent.style.visible = false
        else
            player.print({'planner-menu.not-enabled'})
        end
    elseif event.button == defines.mouse_button_type.right then
        event.element.style = event.element.style.name == "picker_buttons_med" and "picker_buttons_med_off" or "picker_buttons_med"
        pdata.planners[item.name] = event.element.style.name == "picker_buttons_med"
    end
end

end
Gui.on_click('picker_planner_table_sprite_(.*)', planner_clicked)

local function check_planner_removed(event)
local player, pdata = Player.get(event.player_index)
if not pdata.last_planner then return end
local existing = player.get_inventory(defines.inventory.player_main).find_item_stack(pdata.last_planner)
if existing then existing.clear() end
end
Event.register(defines.events.on_player_main_inventory_changed, check_planner_removed)

8 years ago

update - check for blueprints:
local function check_planner_removed(event)
local player, pdata = Player.get(event.player_index)
if not pdata.last_planner then return end
local existing = player.get_inventory(defines.inventory.player_main).find_item_stack(pdata.last_planner)
if existing then
if existing.type~="blueprint" then
existing.clear()
end
pdata.last_planner = nil
end
end

8 years ago

There are per user options to remove planners from the player inventory and quickbar

7 years ago

Where are these options?

6 years ago
(updated 6 years ago)

Yeah, where are these options

Edit: Found them. Options - Mod settings - Per Player

New response