News:

Congratulations!
 You've won the News Item Lottery! Your prize? Reading this news item! :)

Options in depots to only show lines passing near a depot in line dropdown

Started by Nazalassa, December 21, 2025, 04:52:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nazalassa

A small patch that allows users to restrict the lines shown in a depot's drop-down line list, to those that have a stop within a certain distance of the depot (currently hard-coded at 42). Useful e.g for urban networks.

nearby-lines.gif
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

Isaac Eiland-Hall


Nazalassa

Quote from: Isaac Eiland-Hall on December 22, 2025, 01:36:14 AMThe answer to life, the universe, and everything? :)

Also an empirical constant that is neither too large (showing lines too far away) nor too small (not showing some nearby lines).
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

k47


prissi

This is dictating the players a certain style. I play deliberately with a single depot per network. Since Simutrans cannot guess the player's style, the general rules was to not commit anything forcing a certain style.

Thus, the patch has little chance of incorporation without making it configurable via the GUI and off by default.

It would be different if limiting to stops connected to this depot. But finding this out is very time consuming and non-trivial. And convois with their home depot would not apply for new depots.

Nazalassa

Here is a variant which makes the distance configurable on a per-depot basis. (It is not saved with the map though.) Note that it was already disabled by default.

nearby-lines-conf.png
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

k47

What about this idea: instead of a button to find near lines, there's a 'filter' button that opens a drop down menu with different options that help us find the desired line: near lines in given distance, lines carrying people/post/cargo, search by name, stuff like that.

prissi

Filter by goods/pax/etc. is already in the dialog. It would be easy to filter the lines for this.

prissi

In r11879 any combobox can be searched for match text. The downside is that editing cannto reposition the cursor with the mouse. Please comment on this change. I will revert it if it is not good.

Nazalassa

Good idea but the droplist is updated after the first character is typed but not after any others, and it would be nice if the search functionality ignored case. Patch 1 implements this.

It seems weird to me to be able to search in comboboxes that only display a few fixed items (such as the line management window's "Name"/"Vehicle earnings"/"Operational profit"/... sort mode one) so patch 2 makes searchability optional. This also avoids the combobox's contents disappearing when the drop-down is open (unless the combobox is searchable).
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

prissi

I am not sure, two differently behaving combobox will not be confusing.

Thanks for spotting the error. I made it so that the current selection is hsown until something has been typed for a search (and then shown in another color). So you have the old behaviour with the new functionality added.