add copy paste to some aspects of porymap

- can copy currently selected metatiles
  - can copy currently selected events
  - can copy an image of the current map
  - what is copied depends on the currently focused widget
  - copied objects can be pasted into other instances of porymap
  - copied images live on in the clipboard, cannot be pasted into porymap

TODO:
  - shortcut in Edit menu
  - other things can be copied?
This commit is contained in:
garak
2021-04-14 01:08:18 -04:00
parent d1be0d5a58
commit 296d697df0
2 changed files with 234 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
#include <QAbstractItemModel>
#include <QJSValue>
#include "project.h"
#include "orderedjson.h"
#include "config.h"
#include "map.h"
#include "editor.h"
@@ -120,6 +121,10 @@ private slots:
void openWarpMap(QString map_name, QString warp_num);
void duplicate();
void setClipboardData(poryjson::Json::object);
void setClipboardData(QImage);
void copy();
void paste();
void onLoadMapRequested(QString, QString);
void onMapChanged(Map *map);