construction and landscape window sticky by default

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

Post Reply
gfldex
Engineer
Engineer
Posts: 10
Joined: 16 Sep 2007 22:28

construction and landscape window sticky by default

Post by gfldex »

Closing all windows but the stickies by pressing del would be useful if the build tools would keep their stickyness. Sadly switching between track types, roads, etc. clears the sticky status. This patch solves that issue by providing an interface switch to change the default stickyness of said windows.
Attachments
sticky_by_default.patch
(3.12 KiB) Downloaded 107 times
Tom0004
Chairman
Chairman
Posts: 822
Joined: 01 Jul 2007 22:33
Location: Manchester, UK

Re: construction and landscape window sticky by default

Post by Tom0004 »

can i ask what happens, when you have a railway, an a monailrail, construction windows open, and you hit the autorail shortcut key ?

which on will you be building ?
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: construction and landscape window sticky by default

Post by Roujin »

in default OpenTTD you can't have two different construction windows open (in your case railway&monorail), since opening the second one will close the first one

and judging from the text (i didn't test it) this patch does not change this behavior.


stickiness means the little icon on the top right end of a window, meaning it will not close if you hit DEL.
* @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
gfldex
Engineer
Engineer
Posts: 10
Joined: 16 Sep 2007 22:28

Re: construction and landscape window sticky by default

Post by gfldex »

0004tom wrote:can i ask what happens, when you have a railway, an a monailrail, construction windows open, and you hit the autorail shortcut key ?

which on will you be building ?
- start a game
- press shift-f7
- click the the sticky icon in the upper right corner of that window
- press f4
- press del

the railroad construction toolbar will stay and the map will close

- press shift-f6
- press shift-f7
- press f4
- press del

All windows will be hidden, even the railroad construction toolbar. The whole idea of the stickyness of windows is that they stay until the user tells the window otherwise.

The right way to do it would be to teach the window to remeber it's stickyness, even when it got closed. Sadly windows get destroyed when they get closed and the sticky bit with it. There would be need for a lot infrastructure to change that behaviour.

The really right way would be to give the console a bind function and the ability to change the stickyness of a window. One would be able to do the following.

Code: Select all

bind shift-f7 openwindow railroadconstruction; windowsticky railroadconstruction true
That way the user could choose what windows should be opened with stickyness by default and it would be possible to add such behaviour to new windows without recompiling. Befor that would be possible there is need for customizable keyboard commands (I thinks that's on the wish list). Further a window would have to remember it's title. ATM there is no way to tell what the title of a window is. You would have to guess which widget might be the title and you would have to use the string identifier used in english.txt. The whole window handling is a bit odd tbh.

For now the way I did it has to do to make the del key actually useful.
Tom0004
Chairman
Chairman
Posts: 822
Joined: 01 Jul 2007 22:33
Location: Manchester, UK

Re: construction and landscape window sticky by default

Post by Tom0004 »

so what your saying is, that this paych will save a number of stickied windows, and open all those windows, with a touch of a key ?

if i'm wrong, and going by the title of this thead, you still have yet to answer my question
0004tom wrote:can i ask what happens, when you have a railway, an a monailrail, construction windows open, and you hit the autorail shortcut key ?

which on will you be building ?
gfldex
Engineer
Engineer
Posts: 10
Joined: 16 Sep 2007 22:28

Re: construction and landscape window sticky by default

Post by gfldex »

0004tom wrote:so what your saying is, that this paych will save a number of stickied windows, and open all those windows, with a touch of a key ?

if i'm wrong, and going by the title of this thead, you still have yet to answer my question
0004tom wrote:can i ask what happens, when you have a railway, an a monailrail, construction windows open, and you hit the autorail shortcut key ?

which on will you be building ?
I think it's time for
paint_on_a_screenshot.jpg
paint_on_a_screenshot.jpg (298.57 KiB) Viewed 413 times
,
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: construction and landscape window sticky by default

Post by DaleStan »

*boggle*

"A picture is worth a thousand words" indeed.
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 “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests