Nesting Windows

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Nesting Windows

Post by planetmaker »

Expresso wrote:One more question: do the nested widgets also support widgets which have optional animations? This could be useful for widgets which show an animation when the mouse-pointer hovers over them.
Those two things are completely unrelated. The widgets themselves are not changed by making them nested - that just affects their layout on the screen / within the window and allowing to adjust easier for font sizes etc pp. The thing you propose could most probably be implemented, though... with or (not anymore in OpenTTD) without nested widgets.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Re: Nesting Windows

Post by Alberth »

I completely agree with planetmaker.
The whole purpose of the exercise 'switching to nested widgets' is to reduce the maintenance effort (it does more calculations by itself, and thus less demanded from the programmer), make them more flexible in changing size due to differences in wording (different languages use phrases with different length to describe something), differences in font or font size, etc.

In the end however, a widget occupies some screen space, and is rendered by the video system when needed. Who or why a refresh is queried is not controlled by the widgets but by the window class.

The current implementation does not have animated widgets (although technically, lowering and raising buttons is a form of animation). However, there is no fundamental reason why this would not be possible, technically at least.
Game-wise however, I don't see the point. What good does an animated widget do? (does it enhance game play?)

Also, it doesn't really fit in a 25+ year old game, it seems to me.

Last but not least, we need all the processor power we get for making more trains run in the game, so why would we want to waste CPU power on such an animation?
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Nesting Windows

Post by Roujin »

Random query: Does anyone of the devs actually speak a RTL language?

Just curious :)
* @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

ImageImage
ImageImageImageImageImageImageImage
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Nesting Windows

Post by Eddi »

depending on your definition of "speak" probably somewhere between "no" and "unlikely"
audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: Nesting Windows

Post by audigex »

Alberth wrote:Last but not least, we need all the processor power we get for making more trains run in the game, so why would we want to waste CPU power on such an animation?
Because it makes the interface feel more slick. I have a processor I run at 4gHz, it only slows down in the very biggest games - as in several thousand vehicles. Considering I play in a realistic style on smaller maps (usually with less than 500 vehicles, which barely taxes my netbook or laptop, never mind my PC) speed is a non-issue so why not make it look prettier?

I'm all for any eye-candy improvements, although if they can be disabled that's a plus. If it does start to slow your PC down, though, then turning off full animation will give you another few hundred vehicles before it slows down.
Jon
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Re: Nesting Windows

Post by Alberth »

A first step would be to replace all buttons with static graphics, most likely in two versions, one inactive, and one active.
The second step would be to come up with animations for all active graphics.
User avatar
Firestryke31
Engineer
Engineer
Posts: 17
Joined: 22 Aug 2009 02:53
Location: Throw a dart at central Texas
Contact:

Re: Nesting Windows

Post by Firestryke31 »

There are already some buttons that do that, the first that come to mind are the signal buttons (the light turns green when the signal is selected).
"Why were you late?"
"There was a train."
-- Conversation between 2 New Braunfelians
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Nesting Windows

Post by Eddi »

Is that my vivid imagination or did TT original have animated cursors?
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Nesting Windows

Post by Gremnon »

I think there were a few. The Zzzzz one, and the lights on the signal placement cursor I'm sure used to animate.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Nesting Windows

Post by DaleStan »

Eddi wrote:Is that my vivid imagination or did TT original have animated cursors?
Quite a few, at least in TTD. Not so sure about TTO.

Also both landscaping cursors and dynamite. Probably others I've forgotten.
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
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Google [Bot] and 2 guests