I have a suggestion, and I believe this is the right place and time to post it.
Would it be practical to count how many industries of each kind exist on map and display that number here, next to the industry's name? I believe it will be of value when playing on a huge map.
I'm not too sure of the usefulleness of it but...
you do not to count, it's already done : industry.h:276
_industry_counts[NUM_INDUSTRYTYPES] holds the current count of industry per type.
I just don't know, once more, how usefull it really is...
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter. He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Well, if many industry grfs are loaded, and you want to plan an effective network you need to know how many industries of a specific type exist on the map. Instead of sorting and searching on a long Industry Directory this could give you a quick answer. Personally I wouldn't start a network when only 1 or 2 raw industries of a certain type exist on the map. This can easily be the case with ESC set.
Here is patch also with industry counts after industry name. Maybe I should do it as patch option?
I do not know if is small map the right place for this information.
If somebody find this usefull, use it.
belugas: thank you to point me in the right direction.
Attachments
Unnamed, 1st Jan 1950.png (43.26 KiB) Viewed 2726 times
You may think i'm a downer, but i see very little reason to make it an option. Maybe a setting in the window itself, but please... do not make everything a patch option!
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter. He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Also, maybe it would look better, if the numbers of industries would be in some other color, like blue of gray, to be a bit distinctive from the industry names.
If you need something, do it yourself or it will be never done.
I propose instead to put the number front of the name, to make them aligned. I'll have a look at it now first though.
And i agree with belugas as well, a patch option should only be made if it changes behavior significantally, so people who don't like it can deactivate it.
edit: I tested it now, and i found it reacts a bit slow, and tends to draw stuff partially when switching visibility of something (except enable/disable all, that works like a charm)
I think you should change it in a way that it changes it all simultaniously and then redraws the window, so it won't be drawn partially.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.
______________ My patches
check my wiki page (sticky button) for a complete list
There is a small bug in your patch. When you click under one of the columns of industry names an industry in the next column will be enabled/disabled. It kind of depends on how far below the lowest one you click for which one will turn on/off too.
Roujin wrote:I tested it now, and i found it reacts a bit slow, and tends to draw stuff partially when switching visibility of something (except enable/disable all, that works like a charm)
I think you should change it in a way that it changes it all simultaniously and then redraws the window, so it won't be drawn partially.
I'll try to make it faster and remove some of for loops.
XeryusTC wrote:There is a small bug in your patch. When you click under one of the columns of industry names an industry in the next column will be enabled/disabled. It kind of depends on how far below the lowest one you click for which one will turn on/off too.
I fixed both problems.
Now redraws window faster and you if you click below industries list, you do not select industry in next column.
Diff file is in first post.
Just one more thing i noticed, it keeps the settings even if you go back to main menu and/or start a new game or load a game. I think it should reset to "show all" when loading a game or starting a new game.
edit: i just got a bug, i just don't know if it's your patch's fault or OpenTTD's.
just recreated it again without any newGrfs.
In a game i started with very low industries, it says Farm(0), but there is one farm in the game. Instead, it says Bank(1) but there is no bank.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.
______________ My patches
check my wiki page (sticky button) for a complete list
your patch currently supplies only up to 32 industry types. I popped in all ECS vectors i could find for testing, which resulted in 34 different industry types.
With your patch, the 33rd is linked with the 1st and the 34rd is linked with the second industry. (due to overflow i guess)
which means if you click on the first industry, both the first and the 33rd industry will toggle. Same with clicking on the 33rd of course. (and with 2nd + 34rd, accordingly)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.
______________ My patches
check my wiki page (sticky button) for a complete list
But... there is something that bothers me about the use of a bitmask var.
Just a though : why can't you use the _legend_from_industries structure for the toggling? It would certainly make life easier...
Sorry, i know i should have though of that earlier, it just striked me right now
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter. He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Roujin wrote:Just one more thing i noticed, it keeps the settings even if you go back to main menu and/or start a new game or load a game. I think it should reset to "show all" when loading a game or starting a new game.
Now it reset to show all at loading a game or starting new one.
belugas wrote:But... there is something that bothers me about the use of a bitmask var.
Just a though : why can't you use the _legend_from_industries structure for the toggling? It would certainly make life easier...
Sorry, i know i should have though of that earlier, it just striked me right now
I added one more value in _legend_from_industries structure - show_on_map. Now it should work for any number of industries.