Shade windows in OpenTTD
Moderator: OpenTTD Developers
Re: Shade windows in OpenTTD
I must say that I share belugas and Chillcore's opinion about your work: it is incredible.
I have attached a win32 build of the Shade windows patch with middle button functionality included. It already includes the required grf file.
(Removed)
I have attached a win32 build of the Shade windows patch with middle button functionality included. It already includes the required grf file.
(Removed)
Last edited by Terkhen on 20 Jul 2009 15:04, edited 1 time in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Shade windows in OpenTTD
It compiles and works mostlyAlberth wrote:It 'works' or it 'compiles' ?
The latter I believe. The former I don't believe.
(Hint: Try shading the town directory window)

[edit]Okay now everything works perfectly![/edit]
Sincerely
xZise
Re: Shade windows in OpenTTD
I have a suggestion.
For now all shade windows must have modified OnPaint. It can be eliminated.
Only need to modify DrawOverlappedWindow function (winow.cpp). When window is shaded just call DrawWidgets instead of calling OnPaint.
Some windows need to set some string params before drawing titlebar. For them you may create a special event i.e. "OnShadePaint".
This solution require less modifications in existing gui files and also is easier to use, simpler.
For now all shade windows must have modified OnPaint. It can be eliminated.
Only need to modify DrawOverlappedWindow function (winow.cpp). When window is shaded just call DrawWidgets instead of calling OnPaint.
Some windows need to set some string params before drawing titlebar. For them you may create a special event i.e. "OnShadePaint".
This solution require less modifications in existing gui files and also is easier to use, simpler.
![Pleased :]](./images/smilies/pleased.gif)
Re: Shade windows in OpenTTD
Update r16883: update to windowdefs and code-patches.
- Updated to svn-r16883.
- No other changes, not even to coding style.
- Updated to svn-r16883.
- No other changes, not even to coding style.
Re: Shade windows in OpenTTD
Thanks. I just went and burgled this idea wholesale and shoveled it in TTDPatch. (Except for the new button.)
I don't know if your shading is animated, but I'm rather tempted to animate mine, just for the fun of it.
I don't know if your shading is animated, but I'm rather tempted to animate mine, just for the fun of it.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Shade windows in OpenTTD
How is it triggered then, by Ctrl-Clicking the title bar?DaleStan wrote:Thanks. I just went and burgled this idea wholesale and shoveled it in TTDPatch. (Except for the new button.)
I don't know if your shading is animated, but I'm rather tempted to animate mine, just for the fun of it.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Shade windows in OpenTTD
Usual behaviour I'd expect on a title bar when double clicked is to activate / de-activate shading.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Shade windows in OpenTTD
Middle click. Adding YA button to the title bar would be possible, but not exactly easy.Roujin wrote:How is it triggered then, by Ctrl-Clicking the title bar?
I'd expect that to maximize/restore the window.planetmaker wrote:Usual behaviour I'd expect on a title bar when double clicked is to activate / de-activate shading.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Shade windows in OpenTTD
In my patch, using the scroll wheel on the window caption/title bar also shades/unshades the window.
Update r16943: update to windowdefs and code-patches.
- Updated to svn-r16943
- Fixed coding style
- Removed hardcoded values for the size of the shadebox
Update r16943: update to windowdefs and code-patches.
- Updated to svn-r16943
- Fixed coding style
- Removed hardcoded values for the size of the shadebox
Re: Shade windows in OpenTTD
Hey guys...
Could it be that your patch (I love it btw) has some "great" features for the townlist?
Sincerely
xZise
Could it be that your patch (I love it btw) has some "great" features for the townlist?
Sincerely
xZise
- Attachments
-
- Townlist featured by shade-patch
- twon_wnd.png (3.26 KiB) Viewed 3566 times
Re: Shade windows in OpenTTD
Hmm that's a big resize button.
I don't know, I've tested here with a clean checkout and it works OK.
Do you have any other patches applied? Is your checked out revision correct? Should be r16943. There are a lot of changes is the widget code, so a different revision could give strange results.
I don't know, I've tested here with a clean checkout and it works OK.
Do you have any other patches applied? Is your checked out revision correct? Should be r16943. There are a lot of changes is the widget code, so a different revision could give strange results.
Re: Shade windows in OpenTTD
I make a new checkout only for this patch and applied it (only the winodow-def and the maincode).
It is compiled with R 16945.
Sincerely
xZise
It is compiled with R 16945.
Sincerely
xZise
Re: Shade windows in OpenTTD
False alarm 
I compiled the nightly R16966 WITHOUT the patch, and there is the same bug
Sincerely
xZise

I compiled the nightly R16966 WITHOUT the patch, and there is the same bug

Sincerely
xZise
Re: Shade windows in OpenTTD
Update r17434: update to windowdefs and code-patches.
- Updated to svn-17434. Recently, a lot of changes were done in trunk to the window and widget code, so I hope I got all the changes correctly and didn't leave any old stuff.
By the way, I'm working on a new version of this patch. It will be a more sophisticated version: not simply cutting everything below pixel y=14, but defining for each widget to which shade level it belongs. Shading a window then can be done in steps: big window -> smaller window -> shaded window. Expect a beta version soon.
- Updated to svn-17434. Recently, a lot of changes were done in trunk to the window and widget code, so I hope I got all the changes correctly and didn't leave any old stuff.
By the way, I'm working on a new version of this patch. It will be a more sophisticated version: not simply cutting everything below pixel y=14, but defining for each widget to which shade level it belongs. Shading a window then can be done in steps: big window -> smaller window -> shaded window. Expect a beta version soon.

-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Shade windows in OpenTTD
will this be able to work with patchs like new GRF GUI
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Shade windows in OpenTTD
Yes, why not? But you have to add a few things in the window and widget definitions, and maybe in the widget drawing code of the window. See the windowdefs-patch for a lot of examples.
Re: Shade windows in OpenTTD
New version!
Here is a new (beta) version of this patch. It is a more sophisticated version: not simply cutting everything below pixel y=14, but defining for each widget to which shade level it belongs. Shading a window then can be done in steps: big window -> smaller window -> shaded window.
Note: it is still beta! Especially in all the gui.cpp's there is still a lot of cleaning up to do.
The most important changes are in window.cpp and widget.cpp; all functional window shading code is found there.
For an (useless) example of a window with more than two shade levels: check out the news history window.
For more information: see docs/shadelevel.txt
The patch can be found in the second post in this thread.
Here is a new (beta) version of this patch. It is a more sophisticated version: not simply cutting everything below pixel y=14, but defining for each widget to which shade level it belongs. Shading a window then can be done in steps: big window -> smaller window -> shaded window.
Note: it is still beta! Especially in all the gui.cpp's there is still a lot of cleaning up to do.
The most important changes are in window.cpp and widget.cpp; all functional window shading code is found there.
For an (useless) example of a window with more than two shade levels: check out the news history window.
For more information: see docs/shadelevel.txt
The patch can be found in the second post in this thread.
Re: Shade windows in OpenTTD
Congrats!
This Patch made it into trunk
It's in current nightly: r18594

This Patch made it into trunk

It's in current nightly: r18594
Re: Shade windows in OpenTTD
Interesting, it was include r18588.
Re: Shade windows in OpenTTD
Wiki page created:
http://wiki.openttd.org/Shade_windows
http://wiki.openttd.org/Shade_windows
Who is online
Users browsing this forum: No registered users and 20 guests