Copy & Paste patch, reworked

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

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

So, since newest copy & paste patch here is for 0.7.3 and adf88's patch is not yet finished and I needed something working so I can put it into my patchpack, I've ported the original frostregen's patch to 1.0.0 (which should make it relatively easy to port it to trunk). It can be applied, compile and it works ...
Note that I've removed support for copying rail waypoints, as the representation of waypoints changed (in 0.7.X it was in trackbits, in 1.0.0 railway waypoint seems to be a special kind of station) and I've not (yet) figured out how to implement it properly, so the affected part of code is commented out.
Rest of the patch (copying, pasting, saving and loading templates seems to be working well :)

If someone knows what happened to the railway waypoints between 0.7.5 and 1.0.0, please enlighten me, I may be able to put support for them back in :)
Attachments
copypaste_100.patch
Copy & paste patch for 1.0.0
(120.26 KiB) Downloaded 314 times
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)
Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Re: Copy & Paste patch, reworked

Post by Starbud »

Thanks :)
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

And here comes version for trunk - for r19639
Attachments
copypaste_r19639.patch
Copy & paste for r19639
(120.4 KiB) Downloaded 206 times
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)
dbncoold
Engineer
Engineer
Posts: 11
Joined: 22 Aug 2009 22:04

Re: Copy & Paste patch, reworked

Post by dbncoold »

Here is the 1.0.0 Copy & Paste binary built for win32
Last edited by Rubidium on 21 Apr 2010 17:15, edited 2 times in total.
Reason: The license was missing as such in violation with GPL and removed. Furthermore you're better of posting a proper bundle as you need the copy-paste language files and grfs too
themroc
Engineer
Engineer
Posts: 1
Joined: 10 Apr 2010 15:34

Re: Copy & Paste patch, reworked

Post by themroc »

I am geting the error message "No available language packs (invalid versions?)"
I just replaced my old executable with the c&p-one and don't know what the problem is, since all lng files are in ..\lang\ folder.
Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Re: Copy & Paste patch, reworked

Post by Starbud »

I think you need the other files from the right version.
I might be wrong but i get the feeling that you have an older version than the executable is intended for.
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Copy & Paste patch, reworked

Post by ChillCore »

Starbud wrote:
themroc wrote: I am geting the error message "No available language packs (invalid versions?)"
I just replaced my old executable with the c&p-one and don't know what the problem is, since all lng files are in ..\lang\ folder.
I think you need the other files from the right version.
I might be wrong but i get the feeling that you have an older version than the executable is intended for.
The problem is that dbncoold only included the executable and not everything from the bin.
And even if it worked ... there is no liscence which is against the liscence.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Copy & Paste patch, reworked

Post by ChillCore »

Double post, but for a good reason. :mrgreen:

Changed:
---------
- Some coding style in copy_paste_gui:
-> Move "struct CopyPasteWindow : Window" above "static const NWidgetPart _nested_copy_paste_widgets[]".
-> Removed a few blank lines.
- Some coding style in language files -> Move and rename STR_COPY_PASTE_LOAD_TEMPLATE to STR_SAVELOAD_LOAD_COPY_PASTE_TEMPLATE (same for ...SAVE...).
- Rename getFastestAvailableBridgeType() to GetFastestAvailableBridgeType().

Fixed:
-----
- Crash when clicking the buttons in the terraingeneration toolbar -> Introduced ShowCopyPasteToolbarGui() and removing ShowCopyPasteToolbar(int button) in terraform_gui.cpp. ShowCopyPasteToolbar() is still used for when the shortcuts are used.
- Crashes when clicking the buttons to save or load templates. -> Included the renamed save/load strings mentioned above in misc_gui.cpp.
- compiler warning: STRING1 to STRING in german.txt.

Remaining Compiler warnings:
------------------------------
- copy_paste.cpp:
line 716: name lookup of a^ tile has changed
line 514: matches this a^ tile a^ under ISO standard rules
line 549: matches this a^ tile a^ under old rules


ps:
Bilbo,
RAIL_TILE_WAYPOINT is now STATION_WAYPOINT. See station_type.h
Attachments
copypaste_r19692.diff
(122.31 KiB) Downloaded 266 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
unitedhate
Engineer
Engineer
Posts: 2
Joined: 08 May 2010 09:29

Re: Copy & Paste patch, reworked

Post by unitedhate »

Hi,
i want to say thanks for developing this great patch. i needed a long time to create a complex train-cross over and over again and asked me why there is no feature to create a template. this patch makes the game much better as it anyway is. so thank you all for developing and i hope that will be continued a long time. :bow:
ClubxzBoy
Engineer
Engineer
Posts: 11
Joined: 27 May 2010 20:58

Re: Copy & Paste patch, reworked

Post by ClubxzBoy »

Where do i have to put that .diff file on my hard drive?
Bus
Engineer
Engineer
Posts: 32
Joined: 19 May 2010 15:28

Re: Copy & Paste patch, reworked

Post by Bus »

Hi there, I'm afraid that putting the patch file on your hard drive is not enough. You would actually have to compile OpenTTD from source codes as explained in the wiki and apply the patch as explained in the "Howto apply a patch/diff file" thread. It's not that hard to do but it does take some time to set up everything properly for the first time. You might ask someone to compile the game for you -- I might even be able to do it myself if you're fine with playing the game without sound.
Grolsch
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 08 May 2004 07:48
Location: Alkmaar, The Netherlands

Re: Copy & Paste patch, reworked

Post by Grolsch »

ClubxzBoy wrote:Where do i have to put that .diff file on my hard drive?
http://www.tt-forums.net/viewtopic.php?f=33&t=21678
Beer equals power
Bus
Engineer
Engineer
Posts: 32
Joined: 19 May 2010 15:28

Re: Copy & Paste patch, reworked

Post by Bus »

I made the binary for you -- without music support though.

Btw the unfixed warning mentioned by ChillCore will probably cause some build sounds coming from strange locations. It could be easily fixed by renaming the variables.
Attachments
copypaste_win32_nomusic_r19692.zip
(3.96 MiB) Downloaded 405 times
Locomotor
Engineer
Engineer
Posts: 6
Joined: 18 Sep 2008 01:53

Re: Copy & Paste patch, reworked

Post by Locomotor »

doesnt work at all how can i getit active the Grf file orthe winzip is not to be found in game

i whant it to work becausse i donot need to do every thing when its working


Greetz Locomotor :?: :bow:
Bus
Engineer
Engineer
Posts: 32
Joined: 19 May 2010 15:28

Re: Copy & Paste patch, reworked

Post by Bus »

Look at the first post in this thread, there are the instructions. You need to download copypaste.grf from this link http://www.tt-forums.net/download.php?id=50279 and extract it to ...\My Documents\OpenTTD\data. You'll also need to unzip the file I posted to some folder. Best to get 7zip for this (since the grf file is compressed using 7z).
Locomotor
Engineer
Engineer
Posts: 6
Joined: 18 Sep 2008 01:53

Re: Copy & Paste patch, reworked

Post by Locomotor »

whe need the 1.0.1 patch version for Copy & Paste becausse it still doesnt accept the older 1
even the 1.0.0 off the Copy & Paste patch doesnt work on Openttd build 1.0.1

i hope you can get it working again
becausse every 1 liked it from the start even i used 1 off the old version when openttd whas just out

greetz
Bus
Engineer
Engineer
Posts: 32
Joined: 19 May 2010 15:28

Re: Copy & Paste patch, reworked

Post by Bus »

The version I posted is somewhere between 1.0.1-RC2 and 1.0.1. Do you have any problem running it?
User avatar
Vaulter
Traffic Manager
Traffic Manager
Posts: 185
Joined: 21 Dec 2004 05:35
Skype: andrey-zaharov
Location: St. Petersburg, Russia
Contact:

Re: Copy & Paste patch, reworked

Post by Vaulter »

Bus wrote:The version I posted is somewhere between 1.0.1-RC2 and 1.0.1. Do you have any problem running it?

Code: Select all

-0.37 vaulter@vaulter-laptop:~/src/openttd/1.0.1$ svn update
At revision 19929.

-0.33 vaulter@vaulter-laptop:~/src/openttd/1.0.1$ svn info                                                             
Path: .
URL: svn://svn.openttd.org/tags/1.0.1
Repository Root: svn://svn.openttd.org
Repository UUID: 6aa0318a-3be1-0310-93fa-89fd2396df07
Revision: 19929
Node Kind: directory
Schedule: normal
Last Changed Author: rubidium
Last Changed Rev: 19742
Last Changed Date: 2010-05-01 01:24:33 +0400 (Sat, 01 May 2010)

-0.50 vaulter@vaulter-laptop:~/src/openttd/1.0.1$ make                                                                 
make[1]: Entering directory `/home/vaulter/src/openttd/1.0.1/objs/lang'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/vaulter/src/openttd/1.0.1/objs/lang'
make[1]: Entering directory `/home/vaulter/src/openttd/1.0.1/objs/release'
[SRC] Compiling command_queue.cpp
/home/vaulter/src/openttd/1.0.1/src/command_queue.cpp: In function 'void CallCommandQueueTick()':
/home/vaulter/src/openttd/1.0.1/src/command_queue.cpp:72: error: 'struct GUISettings' has no member named 'cp_paste_speed'
/home/vaulter/src/openttd/1.0.1/src/command_queue.cpp:73: error: 'struct GUISettings' has no member named 'cp_paste_speed'
make[1]: *** [command_queue.o] Error 1
make[1]: Leaving directory `/home/vaulter/src/openttd/1.0.1/objs/release'
make: *** [all] Error 2

latest patch file from this thread

Code: Select all

wget --output-document="copypaste.patch" \
		--no-clobber --timeout=30 --dns-timeout=2 -- \
		http://www.tt-forums.net/download/file.php?id=128044

[+] Spoiler

Code: Select all


==> Patchin copypaste...
patching file src/fios.cpp
patching file src/toolbar_gui.cpp
Hunk #1 succeeded at 43 with fuzz 3.
Hunk #2 succeeded at 1292 (offset -11 lines).
Hunk #3 succeeded at 1532 (offset -11 lines).
patching file src/functions.h
Hunk #1 succeeded at 27 with fuzz 2.
patching file src/viewport_type.h
patching file src/lang/german.txt
Hunk #1 succeeded at 2039 (offset -10 lines).
Hunk #2 succeeded at 2250 (offset -11 lines).
patching file src/lang/english.txt
Hunk #1 succeeded at 2038 (offset -10 lines).
Hunk #2 succeeded at 2249 (offset -11 lines).
Hunk #3 succeeded at 2261 (offset -11 lines).
patching file src/settings_gui.cpp
patching file src/command_queue.cpp
patching file src/misc_gui.cpp
Hunk #1 succeeded at 1622 (offset -25 lines).
Hunk #2 succeeded at 1637 (offset -25 lines).
Hunk #3 succeeded at 1687 (offset -25 lines).
Hunk #4 succeeded at 1696 (offset -25 lines).
Hunk #5 succeeded at 1725 (offset -25 lines).
Hunk #6 succeeded at 1746 (offset -25 lines).
Hunk #7 succeeded at 1824 (offset -25 lines).
Hunk #8 succeeded at 1876 (offset -25 lines).
Hunk #9 succeeded at 1915 (offset -25 lines).
Hunk #10 succeeded at 1928 (offset -25 lines).
Hunk #11 succeeded at 1940 (offset -25 lines).
Hunk #12 succeeded at 1954 (offset -25 lines).
Hunk #13 succeeded at 2012 (offset -25 lines).
patching file src/command_queue.h
patching file src/table/sprites.h
patching file src/table/settings.h
Hunk #1 succeeded at 649 (offset -6 lines).
patching file src/copy_paste_gui.cpp
patching file src/copy_paste.h
patching file src/window_type.h
patching file src/fios.h
patching file src/rail_gui.h
patching file src/terraform_gui.cpp
patching file src/rail_gui.cpp
patching file src/tunnelbridge_cmd.cpp
Hunk #1 succeeded at 94 (offset -3 lines).
patching file src/settings_type.h
Hunk #1 succeeded at 110 with fuzz 3.
patching file src/depot_map.h
patching file src/gui.h
patching file src/copy_paste.cpp
patching file src/depot.cpp
patching file src/openttd.h
patching file src/bridge.h
patching file src/tunnel_map.cpp
patching file src/viewport.cpp
patching file src/tunnel_map.h
patching file src/pathfinder/npf/npf.cpp
patching file src/tilehighlight_type.h
patching file src/gfxinit.cpp
patching file src/openttd.cpp
Hunk #3 succeeded at 940 (offset 4 lines).
Hunk #4 succeeded at 1083 (offset 4 lines).
Hunk #5 succeeded at 1241 (offset 4 lines).
Hunk #6 succeeded at 1259 (offset 4 lines).
patching file docs/copy_paste_array.txt
patching file projects/openttd_vs80.vcproj
Hunk #3 succeeded at 832 (offset -4 lines).                                                                                    
Hunk #4 succeeded at 1792 (offset -16 lines).
patching file projects/openttd_vs90.vcproj
Hunk #3 succeeded at 845 (offset -4 lines).
Hunk #4 succeeded at 893 (offset -4 lines).
Hunk #5 succeeded at 1789 (offset -16 lines).
patching file source.list
Hunk #2 succeeded at 131 (offset -1 lines).
Hunk #3 succeeded at 373 (offset -4 lines).
==> Patchin copypaste DONE
Bus
Engineer
Engineer
Posts: 32
Joined: 19 May 2010 15:28

Re: Copy & Paste patch, reworked

Post by Bus »

Erm I was talking about the binary file I posted ;). The latest patch in this thread clearly says that it's for revision 19692 so use that one, not the latest one.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 45 guests