Right now we have a left click event, and shift+left click (alt selection) event.
I request to add to the mod API a right click event, so that mods may put more interesting functionality into the mouse-based controls and selection logic.
add a right-click event for selection-tool in cursor
Re: add a right-click event for selection-tool in cursor
I'm not against the idea but it would need a name and have to show up in the keybindings list. However, in the base game it wouldn't *do* anything so there isn't a name to give it and it doesn't make sense to have in the keybindings list.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: add a right-click event for selection-tool in cursor
Some sort of freeform or diagonal select ?
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: add a right-click event for selection-tool in cursor
The game at its core does not support non-rectangular bounding boxes. So it would have no way to say "does this set of entities collide with X" when X isn't a rectangular bounding box.
To change that would mean change the entire collision system in the game - and that is not likely to happen.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: add a right-click event for selection-tool in cursor
Hm. Maybe some kind of inverted selection? Or an exception for it to only show up when mods use it :x.
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: add a right-click event for selection-tool in cursor
I just ran into this while thinking of nice ways to control some things without toggle buttons or multiple tools.
Maybe a mod could set a "flag" of sorts if the feature is wanted and the game only shows the control if so? Also it's not the sort of thing I ever considered rebinding, I am sure if I took a look many other games don't allow rebinding something like this even if they do general keyboard controls.
Or even let selection-tools have their own controls list that can be defined individually and potentially listed individually as well (so more like the "Select for cancel deconstruction" being the shift-click-drag option even if other things use it). I also ran into a potential case for single click, but that is easily solved by "not dragging". Maybe like:
Code: Select all
{
type = "selection-tool"
name = "route-tool",
icon = "__base__/graphics/icons/blueprint.png",
icon_size = 32,
flags = {"hidden"},
subgroup = "other",
order = "x",
stack_size = 1,
stackable = false,
selection_modes =
{
{
name="select",
default_control="mouse-button-1",
color = { r = 0, g = 1, b = 0 },
mode= {"same-force", "any-entity"}
},
{
name="add-to-selection",
default_control="SHIFT + mouse-button-1",
color = { r = 0, g = 1, b = 0 },
mode= {"same-force", "any-entity"}
},
{
name="destination",
default_control="mouse-button-2",
color = { r = 0, g = 0, b = 1 }
},
{
name="add_waypoint",
default_control="SHIFT + mouse-button-2",
color = { r = 0, g = 0, b = 1 }
}
}
},
Re: add a right-click event for selection-tool in cursor
Lasso/ free form selection?