Is it pretty to make the selector tool, that is always clipped to the map grid?
When you choose entities on the map area it's always free, but by selection of tiles you cannot expect that you choose the right area.
So by first click the left top corner will be rounded to the nearest grid corner and by changing of rectangle's size it will be always rounded to the nearest corner.
Selection tool with grid
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Selection tool with grid
+0.5
In Screenshot Hotkey i enlarge the selected area in on_player_selected_area to make pictures aligned to the grid. Wouldn't hurt if the player could actually see this happening while selecting. But it's a really minor thing for me.
In Screenshot Hotkey i enlarge the selected area in on_player_selected_area to make pictures aligned to the grid. Wouldn't hurt if the player could actually see this happening while selecting. But it's a really minor thing for me.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Selection tool with grid
How do you make a (area) selection tool at all?
Re: Selection tool with grid
Like another prototypes.
Code from https://mods.factorio.com/mod/FogRemover
Code: Select all
local name = 'fr-selection-tool'
local selection_tool =
{
type = "selection-tool",
name = name,
icon = "__FogRemover__/icon.png",
icon_size = 32,
subgroup = "tool",
order = "c[automated-construction]-b[fr-selection-tool]",
stack_size = 10,
selection_color = { r = 0, g = 1, b = 0 },
alt_selection_color = { r = 0, g = 0.5, b = 1 },
selection_mode = {"blueprint"},
alt_selection_mode = {"blueprint"},
selection_cursor_box_type = "copy",
alt_selection_cursor_box_type = "copy",
}
local recipe =
{
type = "recipe",
name = name,
energy_required = 15,
enabled = true,
category = "crafting",
ingredients =
{
{"electronic-circuit", 5},
{"radar", 1}
},
result = name
}
data:extend({selection_tool, recipe})