Page 1 of 4
Patch: Small map industry selector v6 [update]
Posted: 11 Oct 2007 21:26
by gule
I added a button to small map, to select if you want to show hidden industries in red color (as they are shown in all other small map types) or do not show them at all, as it is done now in trunk.
I also changed buttons texts from "Enable all/Disable all" to "Show all/Hide all" and add tooltips texts.
v6.2 (r12072)
- replace black boxes with arrows (->)
v6.1 (r11932)
- remove outlines and replace them with marker on the left side on industry color label if industry accept cargo and with marker on the right side in industry produce cargo accepted by selected industry. Second screenshot.
v6 (r11915)
- if one industry is selected , then is in list shown which industries accept cargo produced by selected industry (blue outline) and which industries produce cargo accepted by selected industry (red outline).
v5 (r11874)
- added button Show hidden, to select how are shown hidden industries
- changed button texts
- added tooltips texts
------ already in trunk [r11474] --------------------
While useing newindustries I have problem with finding the right industry.
I write this patch, with which you can select which industry you want displayed on the small map.
If you click on industry label in small map window, you can select which industries are shown on small map.
Thera are also buttons for show all (Enable all) and hide all (Disable all) industries.
v4.2.3 (r11430)
- code clean up to developers suggestions
v4.2.2 (r11391)
- code clean up
v4.2.1 (r11388)
- update to trunk version 11388
v4.2 (r11353)
- fix: removed limit for only 32 different industry types
- reset to show all at game load or new game start
v4.1 (r11342)
- fix: if you click below industries list, you get selected industry in next column
- add industry counters
- make screen updateing faster when you click on industry
v4 (r11336)
- changed color of disabled industry text and box
- feature complete
v3.1 (r11314)
- changed only the way of showing enabled/disabled industries, now it is changeing color of the box in the front of industry label and not the color of the text
v3 (r11293)
- now you can click directly on key (label) of industry in small map window
- remove new window for list
- smallmap window is resized to show all industries
v2 (r11247)
- change color of new window
- add butons, enable all - disable all
- pressed one industries are shown
I hope that diff file is ok.
Let me know what you think.
p.s.: this is my first try to OpenTTD code
Re: Patch: Small map industry selector
Posted: 11 Oct 2007 21:34
by DJ Nekkid
looks nice, clean and tidy,
but might i give a couple of suggestions:
a all/none button at the bottom?
Re: Patch: Small map industry selector
Posted: 12 Oct 2007 00:09
by Psistorm
very nice patch, Im experiencing just what you described.
and another suggestion from me

- I think the depressed buttons should be the enabled ones, not the other way round. also I second the idea of all/none buttons beneath the list!
Re: Patch: Small map industry selector
Posted: 12 Oct 2007 00:43
by athanasios
Nice idea. But I think that these buttons should appear on the map window and not on a separate one. With big maps we tend to use larger areas of the screen and so an extra window is annoying. What I suggest is change current list of industries to buttons. This will also look better as it follows the style of the already existing 8 buttons on the bottom-right. Only you have to wait till a developer fixes newindustries issue.
Re: Patch: Small map industry selector
Posted: 12 Oct 2007 08:58
by gule
7of9 wrote:but might i give a couple of suggestions:
a all/none button at the bottom?
Thank you. Good suggestion. I add this buttons.
athanasios wrote:Nice idea. But I think that these buttons should appear on the map window and not on a separate one. With big maps we tend to use larger areas of the screen and so an extra window is annoying. What I suggest is change current list of industries to buttons. This will also look better as it follows the style of the already existing 8 buttons on the bottom-right. Only you have to wait till a developer fixes newindustries issue.
I am planing to make this buttons in the map window. This is only testing if can be made.
As you suggest I will wait on newindustries fix and then move the buttons.
Re: Patch: Small map industry selector
Posted: 12 Oct 2007 09:31
by XeryusTC
Nice patch, I've been waiting for something like this for a long time.
Just one request though, could you make patches from the main directory, and not the src directory? It is A LOT easier to apply patches that way.
Re: Patch: Small map industry selector
Posted: 12 Oct 2007 11:04
by gule
XeryusTC wrote:Just one request though, could you make patches from the main directory, and not the src directory? It is A LOT easier to apply patches that way.
Do you mean with main directory, trunk directory?
Re: Patch: Small map industry selector
Posted: 12 Oct 2007 13:13
by feliciafan89
This is a very handy patch, indeed... after getting enough money to build industries, of course. It's obviously more useful in Create Scenario mode.
I note that in your screenshot, there were exactly 22 Power Stations. That'd make for some good revenue... if there were any coal mines present.
Re: Patch: Small map industry selector
Posted: 12 Oct 2007 16:20
by belugas
I like the concept and the realization too. Well done
Some points:
1) on my todo list, i have to make it so that the smallmap list of industries will be scrollable, since with newindustries, there are some overwrite glitches i want to remove.
2) this lead to the fact that (as mentionned by athanasios) it would be better and more intuitive that the list will actually be the toggable buttons. Having a scrollable list will facilitate the change
3) code wise, from a brief glance, i can see you're using a mixture of tabs and spaces to align your code. We prefer to use tabs to align code and spaces to align data.
Re: Patch: Small map industry selector
Posted: 13 Oct 2007 12:02
by Snuk the Great
Nice patch! I always watned something like this, even though I did not even realise it!
Re: Patch: Small map industry selector
Posted: 15 Oct 2007 09:30
by gule
belugas wrote:1) on my todo list, i have to make it so that the smallmap list of industries will be scrollable, since with newindustries, there are some overwrite glitches i want to remove.
2) this lead to the fact that (as mentionned by athanasios) it would be better and more intuitive that the list will actually be the toggable buttons. Having a scrollable list will facilitate the change
3) code wise, from a brief glance, i can see you're using a mixture of tabs and spaces to align your code. We prefer to use tabs to align code and spaces to align data.
1) I fix this problem, to arrange industry list in three columns, then i count number of industries in one column and then resize the window and panel with industries. It is not the best solution but it works.
2) Right now I'm reworking code to enable clicking directly on list. I didn't create toggable buttons, but I check mouse position and enable/disable industry.
3) I noticed this and I changed my code editor setting.
I have one question, how can i create buttons, which are show only when is selected industry type smallmap? I need this for enable all/disable all buttons.
Re: Patch: Small map industry selector
Posted: 15 Oct 2007 23:08
by ThunderAI
I love this, i Was thinking about this last night after painfully trying to find industries with ECS. Perhaps put the industry buttons in the key itself rather then a new window.
Re: Patch: Small map industry selector
Posted: 16 Oct 2007 09:12
by gule
ThunderAI wrote:I love this, i Was thinking about this last night after painfully trying to find industries with ECS. Perhaps put the industry buttons in the key itself rather then a new window.
Right now I am working on this. I will also try to implement more dynamic industries list (key).
Re: Patch: Small map industry selector
Posted: 19 Oct 2007 11:49
by gule
I made new version (see first post).
Now you can click direct on industry label in small map window to enabel / disable industry type.
Please test it.
Re: Patch: Small map industry selector
Posted: 19 Oct 2007 13:39
by XeryusTC
gule wrote:XeryusTC wrote:Just one request though, could you make patches from the main directory, and not the src directory? It is A LOT easier to apply patches that way.
Do you mean with main directory, trunk directory?
Yes, I meant the trunk directory.
Re: Patch: Small map industry selector
Posted: 19 Oct 2007 14:41
by belugas
It looks reaaly nice, judging only form screenshot, gule

When time allows it, i'll look at the sources.
Re: Patch: Small map industry selector
Posted: 20 Oct 2007 17:33
by gule
belugas wrote:When time allows it, i'll look at the sources.
I am looking forward for your opinion.
I made new version which change only the way of showing enabled/diasbled industry. Second screen shot in first post.
Diff file is attached.
Re: Patch: Small map industry selector
Posted: 21 Oct 2007 00:16
by athanasios
I believe the unselected industry types should be a different color. If grey, little darker than 1st screenshot, so they are easily readable. Or use the same reddish color instead of grey. If both are black it can be confusing which is selected and which not. Since grey doesn't fit so much with background color, I suggest the darkest background brown.
My proposal:
Left: All selected (original)
Middle: Some selected, 8bpp (dots).
Right: Some selected, 32bpp (painted industry color with 67% opacity background color).
Re: Patch: Small map industry selector
Posted: 21 Oct 2007 08:47
by gule
athanasios wrote:I believe the unselected industry types should be a different color. If grey, little darker than 1st screenshot, so they are easily readable. Or use the same reddish color instead of grey. If both are black it can be confusing which is selected and which not. Since grey doesn't fit so much with background color, I suggest the darkest background brown.
My proposal:
Left: All selected (original)
Middle: Some selected, 8bpp (dots).
Right: Some selected, 32bpp (painted industry color with 67% opacity background color).
Good ideas.
But I need help with string colors. How can I change string color to custom color and also how can I applay mask to the industry type color to make it lighter as in your middle column?
And also I am completly noob at 32bpp blitter. How can I change opacity of background color?
Where can i find the right color code for colors? In wiki are only the base ones.
Re: Patch: Small map industry selector
Posted: 22 Oct 2007 02:29
by belugas
To be honest, i don't think using 82bpp /transparency or other kind of technics have their place in here.. Too much work for that little advantage.
The grey colour used for the string is perfect, imho. The colour of the industry type does not have to be changed nor touched. ONly the black border that should be changed. That would make the difference, i think.
And it would be far easier to work out

As for the rest, bravo