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
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Copy & Paste patch, reworked

Post by SirkoZ »

Thank you for the update Roest, however it's got some problems (when I compiled 0.7.0 ß1 with the patch):
-first some warnings in language files (the least important)
-second this:

Code: Select all

[SRC] Linking openttd.exe
openttd.o:openttd.cpp:(.text+0x690): undefined reference to `_command_queue'
openttd.o:openttd.cpp:(.text+0x695): undefined reference to `CommandQueue::ClearCommandQueue()'
openttd.o:openttd.cpp:(.text+0xab8): undefined reference to `_copy_paste'
openttd.o:openttd.cpp:(.text+0xac6): undefined reference to `CopyPaste::SaveLoadTemplate(char const*, int)'
openttd.o:openttd.cpp:(.text+0xad5): undefined reference to `_copy_paste'
openttd.o:openttd.cpp:(.text+0xada): undefined reference to `CopyPaste::GetErrorString()'
openttd.o:openttd.cpp:(.text+0xe31): undefined reference to `CallCommandQueueTick()'
terraform_gui.o:terraform_gui.cpp:(.text+0x827): undefined reference to `ShowCopyPasteToolbar(int)'
terraform_gui.o:terraform_gui.cpp:(.text+0x1127): undefined reference to `ShowCopyPasteToolbar(int)'
toolbar_gui.o:toolbar_gui.cpp:(.text$_ZN17MainToolbarWindow10OnKeyPressEtt[MainToolbarWindow::OnKeyPress(unsigned short, unsigned short)]+0x149): undefined reference to `ShowCopyPasteToolbar(int)'
toolbar_gui.o:toolbar_gui.cpp:(.text$_ZN17MainToolbarWindow10OnKeyPressEtt[MainToolbarWindow::OnKeyPress(unsigned short, unsigned short)]+0x2cf): undefined reference to `_command_queue'
toolbar_gui.o:toolbar_gui.cpp:(.text$_ZN17MainToolbarWindow10OnKeyPressEtt[MainToolbarWindow::OnKeyPress(unsigned short, unsigned short)]+0x2d4): undefined reference to `CommandQueue::ClearCommandQueue()'
toolbar_gui.o:toolbar_gui.cpp:(.text$_ZN17MainToolbarWindow10OnKeyPressEtt[MainToolbarWindow::OnKeyPress(unsigned short, unsigned short)]+0x31d): undefined reference to `ShowCopyPasteToolbar(int)'
toolbar_gui.o:toolbar_gui.cpp:(.text$_ZN27ScenarioEditorToolbarWindow10OnKeyPressEtt[ScenarioEditorToolbarWindow::OnKeyPress(unsigned short, unsigned short)]+0x1b1): undefined reference to `ShowCopyPasteToolbar(int)'
toolbar_gui.o:toolbar_gui.cpp:(.text$_ZN27ScenarioEditorToolbarWindow10OnKeyPressEtt[ScenarioEditorToolbarWindow::OnKeyPress(unsigned short, unsigned short)]+0x1cf): undefined reference to `ShowCopyPasteToolbar(int)'
viewport.o:viewport.cpp:(.text+0x5185): undefined reference to `_copy_paste'
viewport.o:viewport.cpp:(.text+0x51cc): undefined reference to `_copy_paste'
viewport.o:viewport.cpp:(.text+0x51de): undefined reference to `_copy_paste'
viewport.o:viewport.cpp:(.text+0x51ed): undefined reference to `CopyPaste::GetCPTrackBits(unsigned int)'
collect2: ld returned 1 exit status
make[1]: *** [openttd.exe] Error 1
make[1]: Leaving directory `/K/Progs_K/Curr_rel_source_testy/0.7.0-beta1/objs/release'
make: *** [all] Error 2
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: Copy & Paste patch, reworked

Post by Roest »

looks like source.list slipped through somehow :oops:

try adding command_queue.h and copy_paste.h to it
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Copy & Paste patch, reworked

Post by SirkoZ »

Thanks, although it still doesn't work (same error)...

Here's my edited source.list.
Attachments
source.zip
(3.9 KiB) Downloaded 126 times
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: Copy & Paste patch, reworked

Post by Roest »

Ok of course there need to be some more entries in source.list

this patch should work now
Attachments
copypaste_r15549.diff
(126.73 KiB) Downloaded 164 times
User avatar
toast
Engineer
Engineer
Posts: 9
Joined: 01 Mar 2008 21:16
Location: Victoria, BC

Re: Copy & Paste patch, reworked

Post by toast »

planetmaker wrote:With MacOS it should be quite easy: Install xcode from your DVD, install svn and you can compile yourself. An extensive walk-through is found in the sticky thread in this forum.
I just asked 'cause I thought it would be very difficult to do. It took a little while but at the end it works. Thanks for the help!
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

deDied wrote:hey there,

is it possible to make this work in the scenario editor? so i can copy industries?
Perhaps even in-game, in case funding of new industries is allowed by game settings :)

But in scenario editor, there could be more things that could be copied (houses, ownership, chunk of trees, ...) and perhaps in simpler way (no need to send commands, just copy stuff in map array / byt that wouild probably be for another, though similar, patch :)
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)
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 »

Can someone make my day by creating a Windows-build for 0.7.0 beta 1? Thanks in advance :bow:
Beer equals power
maartena
Route Supervisor
Route Supervisor
Posts: 470
Joined: 11 Jul 2003 04:53
Location: California, U.S.A.

Re: Copy & Paste patch, reworked

Post by maartena »

Grolsch wrote:Can someone make my day by creating a Windows-build for 0.7.0 beta 1? Thanks in advance :bow:
I have the same request. I don't use it much, but I do like to use it for some things I always build anyways.

Thanks!
Guess what! I got a fever! And the only prescription...... is MORE COWBELL!
flash55
Engineer
Engineer
Posts: 13
Joined: 01 Mar 2008 14:36

Re: Copy & Paste patch, reworked

Post by flash55 »

is 0.7.0 already supported ?
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Copy & Paste patch, reworked

Post by 2007Alain2007 »

here is an update to R 15597
KGAT COPY N PASTE R 15597.patch
I just testing it now

And i have a look at maybe changeing some things in it

bugs i have found:

*bridges all ways seem to build the best or last ones in the list:( so it is not copying over right
copy paste testing.png
This will go in to my patch pack as soon as the bug abover is fixed and the stations are fixed to sued new GRFs
For Community Integrated Version http://code.google.com/p/civopenttd/
yorick
Engineer
Engineer
Posts: 80
Joined: 23 Mar 2008 08:53

Re: Copy & Paste patch, reworked

Post by yorick »

2007Alain2007 wrote:
bugs i have found:

*bridges all ways seem to build the best or last ones in the list:( so it is not copying over right
Not a bug, feature. Disable the track convert tool to disable that feature ;)
Klaatu
Engineer
Engineer
Posts: 43
Joined: 04 Aug 2003 14:58

Re: Copy & Paste patch, reworked

Post by Klaatu »

maartena wrote:
Grolsch wrote:Can someone make my day by creating a Windows-build for 0.7.0 beta 1? Thanks in advance :bow:
I have the same request. I don't use it much, but I do like to use it for some things I always build anyways.
Still no kind soul willing to post a win32 binary of this and beta2 for those of us who are, shall we say, challenged? :)
maartena
Route Supervisor
Route Supervisor
Posts: 470
Joined: 11 Jul 2003 04:53
Location: California, U.S.A.

Re: Copy & Paste patch, reworked

Post by maartena »

Klaatu wrote:
maartena wrote:
Grolsch wrote:Can someone make my day by creating a Windows-build for 0.7.0 beta 1? Thanks in advance :bow:
I have the same request. I don't use it much, but I do like to use it for some things I always build anyways.
Still no kind soul willing to post a win32 binary of this and beta2 for those of us who are, shall we say, challenged? :)
I'm not sure that is going to happen.... perhaps when 0.7.0 final is released. You see, the person maintaining this patch is doing this out of his free time, and if he just doesn't feel like it, oh well. There is no guarantee that a win32 build will appear.

So just wait. Maybe it'll happen, maybe it won't :)
Guess what! I got a fever! And the only prescription...... is MORE COWBELL!
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

Klaatu wrote: Still no kind soul willing to post a win32 binary of this and beta2 for those of us who are, shall we say, challenged? :)
Well, we have RC1 now...

While I am not posting windows binaries (I have no crosscompiler here, so I can't create them) I am posting at least a patch updated to 0.7.0-RC1, since the previous version posted here does not apply to 0.7.0-RC1 anymore.

Perhaps try buildOTTD to create the windows binaries
Attachments
copypaste_070rc1.diff
patch updated to 0.7.0-RC1
(129.6 KiB) Downloaded 166 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)
User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: Copy & Paste patch, reworked

Post by Timitry »

[e] Here are win32-binaries for you :-) Ignore the post below, they should work just fine!



Old post:

Hm hm hm, i tried to compile with the 0.7.0-RC1...

The patch applied without any problems.

First of all, it gave me a lot of warnings on the language files "string name does not exist in master file", but i guess that's not really a problem. It also complained about some variables which MIGHT not be initialized, but that's the compilers fault, i had this before already.

It succeeds with linking the openttd.exe, and i can start openttd, but somehow the function to copy&paste does not appear... Maybe i'm doing something wrong there? I attached the compiled win32-binaries, maybe they work for you. I also attached the log file with the warnings.
Attachments
CopyPaste_0.7.0-RC1.7z
Copy and Paste might not work, which then makes attaching this file useless... :-/
(2.66 MiB) Downloaded 185 times
log.txt
(43.05 KiB) Downloaded 161 times
Last edited by Timitry on 18 Mar 2009 19:24, edited 1 time in total.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

Timitry wrote:It succeeds with linking the openttd.exe, and i can start openttd, but somehow the function to copy&paste does not appear... Maybe i'm doing something wrong there? I attached the compiled win32-binaries, maybe they work for you. I also attached the log file with the warnings.
I compiled it on linux (I have no Windows nearby) and it worked ... copy & paste shortcuts (ctrl-ins, shift-ins, ctrl-c, ctrl-v ...) spawn the "copy & paste" panel, plus there is button on landscaping toolbar that will spawn that panel too.

Hmm ... I have many useful templates made by older version (the one still from Frostregen). Have anybody made some tool to convert the templates from old format to the new one, or should I write it myself?
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
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: Copy & Paste patch, reworked

Post by Timitry »

Well, stupid me, my binaries do work, it's just that i searched for the copy&paste icon in the railway-toolbar etc, but not in the landscaping toolbar... :)
Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Re: Copy & Paste patch, reworked

Post by Starbud »

Seems to work fine, thanks mate, the only thing was that i had to add the copypaste.grf file manually to make it work (just as the other graphicsfiles from original TTD), otherwise the program wouldnt start at all.
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Copy & Paste patch, reworked

Post by 2007Alain2007 »

Can we also have an update for the current trunk please
For Community Integrated Version http://code.google.com/p/civopenttd/
User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: Copy & Paste patch, reworked

Post by Timitry »

Hm, while trying to update this patch to current trunk, based on the last version by bilbo, i had some strange errors / warnings...

1. 3 Strings were removed from the language-master-file "english.txt", which made the other language files complain about them missing there. So i changed the patch NOT to remove those three strings.
2. One unneccessary string was added to german.txt, which made this file complain about that string missing in english.txt, too, so i removed it.
3. In projects/openttd_vs90.vcproj, the following part just changed the order of those two files, which made TortoiseSVN give me an error, it couldn't merge this file. I removed those lines and it worked fine:

Code: Select all

 			Name="Music"
 			>
 			<File
-				RelativePath=".\..\src\music\null_m.cpp"
+				RelativePath=".\..\src\music\dmusic.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\music\dmusic.cpp"
+				RelativePath=".\..\src\music\null_m.cpp"
 				>
 			</File>
 			<File
The only "problem" i have is that TortoiseSVN marks three of the files as "unversioned", now i don't know if that's bad or how to fix it, they are included in the patch, anyway.

So, here is an actual version of this patch, including the above changes, and applying cleanly, at least for me :)
I also attached win32-binaries, for those interested.
Like always, you need the copypaste.grf from the original post in order to play with this patch.
Attachments
CopyPaste_r15763.patch
(127.86 KiB) Downloaded 130 times
CopyPaste_r15763.7z
(2.66 MiB) Downloaded 138 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 45 guests