[PATCH+IN TRUNK] Delete Signs with CTRL+Click immediately

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
User avatar
osai
Traffic Manager
Traffic Manager
Posts: 132
Joined: 22 Sep 2004 14:56
Location: 10.0.1.254
Contact:

[PATCH+IN TRUNK] Delete Signs with CTRL+Click immediately

Post by osai »

In multiplayer games signs are placed very often. A lot of them become unnecessary after a while. I created a very tiny patch for faster deletion of signs. With CTRL + Click the sign it will be deleted immediately without popping up the sign edit window. To avoid abuse of this method, it is currently only available for the owner of the sign.

Though this is the first patch I every showed to the public and its a very small one. Hints and critics are welcome. :)

Regards,
Osai
Attachments
ctrl_delete_signs_r11624.patch
patch to delete sign immediately with ctrl + click on sign
(2.1 KiB) Downloaded 129 times
Last edited by osai on 12 Jun 2008 22:40, edited 1 time in total.
littlemikey
Engineer
Engineer
Posts: 117
Joined: 24 May 2007 00:30

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by littlemikey »

Good work, something us COOPers could use ^_^
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by DJ Nekkid »

hehe, so my suggestion for "sign dynamite" during the game last night actually paied off? :)
Member of the
ImageImage
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by belugas »

Good idea. May I suggest another quick approach?
Removed code duplication. Always a good thing to keep in mind ;)
Attachments
sign_removal.diff
(1.88 KiB) Downloaded 120 times
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
User avatar
osai
Traffic Manager
Traffic Manager
Posts: 132
Joined: 22 Sep 2004 14:56
Location: 10.0.1.254
Contact:

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by osai »

okay. I didn't want to add it to ShowRenameSignWindow(), because from a logically point of view its not the main job of this function. Though it removes extra lines of code.

Would be cool if you guys like it. :)
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by XeryusTC »

osai wrote:To avoid abuse of this method, it is currently only available for the owner of the sign.
And how hard is it to change ownership again? Click it, press enter, ownership changed...

Nice patch though, it is A LOT faster than the delete button I made a while ago :)
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
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by Bilbo »

XeryusTC wrote:
osai wrote:To avoid abuse of this method, it is currently only available for the owner of the sign.
And how hard is it to change ownership again? Click it, press enter, ownership changed...

Nice patch though, it is A LOT faster than the delete button I made a while ago :)
Well, you can delete other people's sign now anyway with two clicks .... click the sign, press delete. I guess it is rather a protection against accidentally deleting someone else's sign, rather than against any sort of vandalism.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
osai
Traffic Manager
Traffic Manager
Posts: 132
Joined: 22 Sep 2004 14:56
Location: 10.0.1.254
Contact:

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by osai »

Bilbo wrote:
XeryusTC wrote:
osai wrote:To avoid abuse of this method, it is currently only available for the owner of the sign.
And how hard is it to change ownership again? Click it, press enter, ownership changed...

Nice patch though, it is A LOT faster than the delete button I made a while ago :)
Well, you can delete other people's sign now anyway with two clicks .... click the sign, press delete. I guess it is rather a protection against accidentally deleting someone else's sign, rather than against any sort of vandalism.
It's just a kind of protection. Because this function is faster and not as time-consuming as the old method. In my opinion its a little bit of both, isn't it?
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 306
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by ColdIce »

nice one..

And one thing:
osai wrote:Though this is the first patch I every showed to the public and its a very small one.
Regards,
Osai
Hit us with those other patches! :o
The rest is confetti!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by planetmaker »

I like the idea and made an update.
Attachments
sign_removal_r13481.diff
remove a sign with Ctrl+click for r13481
(2.07 KiB) Downloaded 73 times
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by CommanderZ »

Great! I miss this feature so much in trunk. I hope you will fin your way into it quickly!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [PATCH] Delete Signs with CTRL+Click (trunk r13501)

Post by planetmaker »

CommanderZ wrote:I hope you will fin your way into it quickly!
I'm glad you like this patch. But I still hope that I will stay out of trunk as I'd not like to become an electronic toy - I don't mind, if the patch finds it way in there, though ;). I hope I followed all coding style rules correctly. Submitted to flyspray as #2068.

New version: major internal re-write to better fit the coding requirements for trunk. Thanks SmatZ for advice & criticism.

IN TRUNK (r13501)
Attachments
sign_removal_v2_r13495.diff
remove sign with Ctrl+Click (r13495)
(1.85 KiB) Downloaded 78 times
User avatar
osai
Traffic Manager
Traffic Manager
Posts: 132
Joined: 22 Sep 2004 14:56
Location: 10.0.1.254
Contact:

Re: [PATCH] Delete Signs with CTRL+Click immediately

Post by osai »

With r13501 this feature is in trunk of OpenTTD... I am happy =) :bow:
props pm and SmatZ =)
Last edited by osai on 13 Jun 2008 07:53, edited 1 time in total.
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: [PATCH+IN TRUNK] Delete Signs with CTRL+Click immediately

Post by DJ Nekkid »

yey! Will suit us Opencoop guys perfectly :)
Member of the
ImageImage
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: [PATCH+IN TRUNK] Delete Signs with CTRL+Click immediately

Post by CommanderZ »

Congratulations. OTTD is one more little bit better than before.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests