-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy/paste single elements #4737
Conversation
74cdfd6
to
cfe7784
Compare
} | ||
|
||
static void window_tile_inspector_paste_element(rct_window *w) { | ||
rct_map_element *const pastedElement = map_element_insert(windowTileInspectorTileX, windowTileInspectorTileY, tileInspectorCopiedElement.base_height, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably returns NULL
when the limit has been reached. I've got to test this out, and display an error when that happens.
@@ -570,6 +578,10 @@ void window_tile_inspector_open() { | |||
window_tile_inspector_auto_set_buttons(window); | |||
} | |||
|
|||
void window_tile_inspector_clear_clipboard() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opening braces of functions should go onto their own line. (I'm leaving this comment once, but it applies to every instance in this PR, of course.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gymnasiast Whoops, will fix it when I get home.
Your copy and paste images, did you make them yourself? |
@duncanspumpkin: Yes, I made the copy icon from scratch, and the paste one based on: http://icons.veryicon.com/ico/Application/Toolbar%20Icons/Paste.ico First I simply applied the game pallet to the ico file to get the correct colours, then drew this one by hand too, and copied one page from the copy icon onto it. |
ae715c9
to
964e7ba
Compare
964e7ba
to
9c19983
Compare
In case anyone is willing to test this, the 64-bit build can be downloaded here. As this was quite straightforward I don't expect many issues. If someone can take a look at where the clipboard gets cleared, then that would be nice. I tried to find all locations where a new park is loaded (and found a lot of duplicated code while doing so). |
Pasted park entrances have an ID of -1 and crash the game if guests enter through it. |
All non-central park entrances have a park index of -1, and I am unable to reproduce this crash. Everything seems to work fine, even when I make a guest make contact with the entrance. |
They have to enter through it not just touch it |
@Margen67: I'm still unable to reproduce the crash. Park entrance is indeed -1, because it's looking for the park entrance array using its position as the key, but it can't find anything, hence why it's -1. I'm not entirely sure if this is really a bug to do with the tile inspector, it sounds more like something that has to do with the peeps (code I barely touched). It gets stuck here: https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/peep/peep.c#L8083-L8088 |
With the last fix, the game does not crash anymore (they turn around when reaching it), however guests are able to exit through it, and then will get stuck if there is no path leading from the copied entrance to their entry point. Personally I don't think this is important enough to be fixed (at this point at least). |
This PR adds a copy/paste ability to the tile inspector, a feature requested on NEDesigns. One element can be copied to the in-game clipboard at a time, and the clipboard will get cleared when a new map is loaded.