Patch: Small map industry selector v6 [update]

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Patch: Small map industry selector v6 [update]

Post 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
Attachments
Unnamed, 1st Jan 2000.png
Unnamed, 1st Jan 2000.png (86.1 KiB) Viewed 4683 times
Unnamed, 1st Jan 2000.png
Unnamed, 1st Jan 2000.png (33.04 KiB) Viewed 4420 times
smallmap_industry_selector_r12072.diff
(8.03 KiB) Downloaded 158 times
Last edited by gule on 06 Feb 2008 20:13, edited 17 times in total.
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: Patch: Small map industry selector

Post by DJ Nekkid »

looks nice, clean and tidy,

but might i give a couple of suggestions:

a all/none button at the bottom?
Member of the
ImageImage
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Re: Patch: Small map industry selector

Post by Psistorm »

very nice patch, Im experiencing just what you described.
and another suggestion from me :D - 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!
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Patch: Small map industry selector

Post 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.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector

Post 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.
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: Patch: Small map industry selector

Post 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.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector

Post 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?
feliciafan89
Transport Coordinator
Transport Coordinator
Posts: 366
Joined: 24 Sep 2007 14:07

Re: Patch: Small map industry selector

Post 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.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector

Post 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.
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
Snuk the Great
Engineer
Engineer
Posts: 63
Joined: 26 Aug 2005 15:12

Re: Patch: Small map industry selector

Post by Snuk the Great »

Nice patch! I always watned something like this, even though I did not even realise it!
Snuk the Great
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector

Post 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.
ThunderAI
Transport Coordinator
Transport Coordinator
Posts: 306
Joined: 26 Nov 2003 09:15

Re: Patch: Small map industry selector

Post 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.
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector

Post 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).
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector

Post 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.
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: Patch: Small map industry selector

Post 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.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector

Post by belugas »

It looks reaaly nice, judging only form screenshot, gule :)
When time allows it, i'll look at the sources.
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
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector

Post 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.
Attachments
smallmap_industry_selector_r11314.diff
(9.58 KiB) Downloaded 171 times
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Patch: Small map industry selector

Post 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).
Attachments
suggestions.png
suggestions.png (1.3 KiB) Viewed 6620 times
sug_magnified.png
sug_magnified.png (1.32 KiB) Viewed 6618 times
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector

Post 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.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector

Post 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
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
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests