EarendelDevelopers / factorio-mods

This is a public repository for tracking issues with Earendel's factorio mods.
19 stars 3 forks source link

Set destination using search text if exact match is found #227

Open InappropriatePenguin opened 2 years ago

InappropriatePenguin commented 2 years ago

If a player hits <Enter> while in a destination search field and their search text is an exact match for a zone/spaceship name and that zone/spaceship exists in the dropdown (ie. is a valid target for the relevant entity/force), then set the destination to the player's search text.

Modified from original suggestion by stringweasel:

When searching a destination, if there is only one match left, automatically select it. Keep the cursor in the search though. It's quite annoying have to type in name, having only the one location left, but still having to click on the drop down to select it.

Wiwiweb commented 2 years ago

Does it have to be exact match? I like the suggestion of doing it if there's only 1 match in the dropdown.

InappropriatePenguin commented 2 years ago

The problem with that is that you could never select "Nauvis" because "Nauvis Orbit" would always be a possible match.

Actually, if you were talking about it in the context of on_gui_confirmed, it would be fine.

Wiwiweb commented 2 years ago

Good point. Yeah I meant it would apply if you press enter (on_gui_confirmed) Maybe both then? Either exact match or there's only 1 non-exact match? Could be useful in some cases like if a player wants to go to an orbit, or if they hid specific orbits from the list using the priority filter.

image