Patch: Signal GUI (Lastest: r5435)

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

Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Patch: Signal GUI (Lastest: r5435)

Post by Hazelrah »

The Signal GUI adds a window which allows you to select most of the properties of a signal before you actually lay the signal down. The interface is fairly straightforward, but for completeness, I'll write a description.

1) The top two picture buttons allow the user to select between Electric signals or Semaphores

2) The signal density is the space between signals when using Auto Signals or Signal Auto-Completion

3) (Only if the Signal Auto-Completion patch is installed) A Button that enables/Disables Signal Auto-Completion

4) The combo (drop-down) box allows the user to switch between Normal Signals, Pre-signals, Exit-Signals, and Multi-signals. If PBS has been installed, Path Based Signals will also show up in this box.


It also adds one patch options, under the Construction Patches:

1) "Enable the Signal GUI"

Signal GUI is based on the code that Hackykid wrote more than a year ago which also included Signal Auto-Completion (original thread). I've seperated it from the Signal Auto-Completion patch since it is better to have small independent patches. But in fact it still makes a good companion patch for Signal Auto-Completion. You can find that here.

The Patch file and Windows executable can be at the bottom of the next post.

Please have fun with this patch and let me know if there is anything you'd like to change!

-Hazelrah
Attachments
The Signal GUI with the Signal Auto-Completion patch installed
The Signal GUI with the Signal Auto-Completion patch installed
AutoCompletion_SigGui_r5342.png (8.36 KiB) Viewed 16143 times
The Signal GUI (without the Signal Auto-completion patch)
The Signal GUI (without the Signal Auto-completion patch)
SigGUI_r5333.png (13.31 KiB) Viewed 16142 times
The Signal GUI Patch option under the Construction Patches
The Signal GUI Patch option under the Construction Patches
SigGUI_Patches_r5386.png (6.28 KiB) Viewed 15997 times
Last edited by Hazelrah on 01 Jul 2006 03:21, edited 3 times in total.
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

*NOTES ON COMPILING*
This patch can stand by itself, but it contains code that is dependant on other patches. If you have a patch listed below, please #define the appropriate variable.

Code: Select all

Hackykid's PBS           -> PBS_PATCH_INCLUDED
Signal Auto-Completion   -> AUTOCOMPLETION_PATCH_INCLUDED
Todo:
  • - Figure out why dropdown button clickstate isn't being saved
July 1st, 2006 (r5435):
  • - Small update to make compatible with new Signal Auto-completion patch
June 27th, 2006 (r5386):
  • - Added a Configuration option in the Construction Patches to disable to Signal GUI



June 23rd, 2006 (r5333):
[list]
- Seperated code from the Auto-complete code
- Fixed the character drawn on the dropdown button
- A few code clean ups here and there
- Shrunk the virtical window size by 8 pixels
- Auto-Completion button does not show up when Signal Auto-Completion patch is not installed.
- Define AUTOCOMPLETION_PATCH_INCLUDED for those who are using this patch in conjunction with the Signal Auto-completion patch
- Define PBS_PATCH_INCLUDED for those who are using this patch in conjunction with PBS
[/list]
Attachments
SignalGUI_r5435.patch
Signal GUI patch against revision 5435
(18.33 KiB) Downloaded 575 times
SigGUI_r5386.zip
Signal GUI windows executable against revision 5386
(1.03 MiB) Downloaded 449 times
Last edited by Hazelrah on 01 Jul 2006 03:26, edited 6 times in total.
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

And for everyone's convienence, I combined both the Signal GUI and the Signal Auto-Completion patches together for you down below. As an added bonus, I also added richk67's toolbar fix patch. When you use the patch, you still have to define the varible as stated in the second post of this topic above.

-Hazelrah
Attachments
SigGUI_Auto-complete_r5435.zip
Windows executable for AutoCompletion + Signal GUI against r5342
(1.03 MiB) Downloaded 435 times
SignalGUI_AutoComplete_r5435.patch
SignalGUI + Signal Auto-Completion patch in one. Also includes richk67's Toolbar Fix patch. Be sure to use /D AUTOSIGNAL_PATCH_INCLUDED and when compiling.
(36.64 KiB) Downloaded 500 times
Last edited by Hazelrah on 01 Jul 2006 05:46, edited 1 time in total.
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

*New Version: r5386*

Added an option to turn the signal gui on and off.

I also looked into the starting position of the window. Unfortunatly it looks like the starting position of windows is entirely handled in the window code and there is no 'not hackish' way of doing it. I'll keep looking though since I find one of the most annoying features of the SigGUI is that it blocks the rail icons.

New SigGUI + AutoSignal version coming very soon.

-Hazelrah
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

How does the landscaping toolbar do 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
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

Yeah, I actually did look at that myself. It doesn't use the toolbar child property (too lazy to look and figure out what that's properly called right now). Instead it is an independant window, with a static startup position. No mater how big or small the viewable window is, it will always start up a static amount of pixels from the left and top, even if that's not visible.

I'm not a big fan of that either. Tell me, do TTDPatch windows remember where they were closed?

-Hazelrah
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Hazelrah wrote:I also looked into the starting position of the window. Unfortunatly it looks like the starting position of windows is entirely handled in the window code and there is no 'not hackish' way of doing it. I'll keep looking though since I find one of the most annoying features of the SigGUI is that it blocks the rail icons.
Check out my toolbar fix patch in the MiniIN (r5234). You will see a line ready for the SigGUI patch ;)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

I know we don't know each other very well but I could kiss you right about now! :P

And just to make it easier for other people not so development oriented to know what richk67 is talking about:

http://www.tt-forums.net/viewtopic.php?t=22054

-Hazelrah

(edit:removed very dumb question, and added forum link)
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Steady on ;)

The next one to fix is the BUILD_TREES popup, which overlaps its parent too.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Hazelrah wrote:I'm not a big fan of that either. Tell me, do TTDPatch windows remember where they were closed?
I don't believe so. The map window remembers its size during runtime, but that is, I believe, as far as Patch's memory goes.
I usually find that the default location is close enough to where I want it to be.
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
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

*New Version: r5435*

Since I updated the Signal Auto-completion patch, I had to make a teeny tiny little change in this Signal GUI patch too. Nothing big, so I didn't bother to update the exectuable.

The bigger news is that I updated the integrated patch and executable, in the third post. It contains the new Signal Auto-completion patch along with this Signal GUI patch, and I also included richk67's Toolbar Fix patch for good measure. Have fun!

-Hazelrah
BamBam
Engineer
Engineer
Posts: 34
Joined: 06 May 2007 17:49

Post by BamBam »

I rediffed the combination against trunk r9796.
Included are:
Signal GUI
Signal Auto Completion
ToolbarOverlapFix

Edit 19. June 2007: download removed, new one see my post below (page 2)
Last edited by BamBam on 19 Jun 2007 15:32, edited 1 time in total.
User avatar
CMircea
Chairman
Chairman
Posts: 887
Joined: 29 Dec 2006 14:05

Post by CMircea »

Good. Now we need PBS working with YAPF.
TheJosh
Engineer
Engineer
Posts: 75
Joined: 17 Apr 2007 12:19
Contact:

Post by TheJosh »

This patch is the best. they had it in MiniIN
tneo
Engineer
Engineer
Posts: 58
Joined: 16 Apr 2007 07:41

Post by tneo »

Does this patch work with 0.5.1 as well?
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

they had it all the way back in I2. this patch is amongst the really old patches, wtill alive, that didn't make it into the official game.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post by DeletedUser21 »

A shame since it's a really handy thing to have. I mean, no more extra settings to be switched in the patches configuration menu every time you want to place extra signals at one go (or lesser signals), and handier switch between semaphores and light signals. :) I will add this patch into my current game.

Another thanks to BamBam the rediff master. :P
tneo
Engineer
Engineer
Posts: 58
Joined: 16 Apr 2007 07:41

Post by tneo »

Does anyone know whether or not it will make it to trunk. I know it had some minor bugs in MINI, but save so much time to signal tracks...
boekabart
Transport Coordinator
Transport Coordinator
Posts: 333
Joined: 25 Aug 2005 09:44
Location: Eindhoven, Netherlands

Post by boekabart »

tneo wrote:Does anyone know whether or not it will make it to trunk. I know it had some minor bugs in MINI, but save so much time to signal tracks...
In it's current form, no. Big/combination patches are never accepted, and the devs usually don't have time to split them up again.
Someone will have to split it up again in (at least) 3 small patches, doing 1 feature each.
Those will have to comply with coding rules, be popular AND as bugfree as possible, in order to be considered for trunk.
Good luck with that, they all have my vote!
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

i thought it was already split up so that autocomplete and the GUI were 2 seperate patches?
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 38 guests