From 50abb6761c5d401aaa057c4164472e2f0641ab5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 1 Oct 2024 09:03:29 +0200 Subject: [PATCH] WIP --- examples/desert.tmx | 17 +++++++++++++++-- examples/examples.tiled-project | 8 ++++++++ examples/sticker-knight/map/sandbox.tmx | 8 ++++++-- examples/sticker-knight/map/sandbox2.tmx | 5 ++++- src/tiled/propertieswidget.cpp | 8 +++++++- src/tiled/propertyeditorwidgets.cpp | 1 + src/tiled/varianteditor.cpp | 1 + 7 files changed, 42 insertions(+), 6 deletions(-) diff --git a/examples/desert.tmx b/examples/desert.tmx index cc5e30863e..ea02dfdd89 100644 --- a/examples/desert.tmx +++ b/examples/desert.tmx @@ -1,9 +1,22 @@ - + + - eJztmNkKwjAQRaN9cAPrAq5Yq3Xf6v9/nSM2VIbQJjEZR+nDwQZScrwztoORECLySBcIgZ7nc2y4KfyWDLx+Jb9nViNgDEwY+KioAXUgQN4+zpoCMwPmQAtoAx2CLFbA2oDEo9+hwG8DnIDtF/2K8ks086Tw2zH0uyMv7HcRr/6/EvvhnsPrsrxwX7rwU/0ODig/eV3mh3N1ld8eraWPaX6+64s9McesfrqcHfg1MpoifxcVEWjukyw+9AtFPl/I71pER3Of6j4bv7HI54s+MChhqLlPdZ/P3qMmFuo5h5NnTOhjM5tReN2yT51n5/v7J3F0vi46fk+ne7aX0i9l6If7mpufTX3f5wsqv9TAD2fJLT9VrTn7UeZnM5tR+v0LMQOHXwFnxe2/warGFRWf8QDjOLfP + eJztmFFPgzAUhc/cgyKJk206lQ03mRMcmP3/X2dISnJzUgqlgMzwcB5W4PbrubftzSIAUY96ALAA8NjzPG30o+F7HwHXtfhXePUMYAPgZQQ8Os0A3ACYE3cfc70CeLNQCMADcA/AH8CLA4APC8U98iUGviOAbwCff8hn8i9u6OcQfKcR8l2Ii/kyVf/5wHxcc/y7zi+uyy74dPsgIf9ODfnY1678+6qoOVv/+s4vc7JSlb+mOnfAd6t0R+PlvWSjufpO3mWufAtNf1HMsVNxC60BLJWexLh8Voxv1Xdbwbpz5Nto+guPmFbiWSDG5bOA+EvWtSaGa+15Duut4rfV3tDneCJHup4l7GAvNmXU7dlA5cmvOFOylpw2/Vld7DLH8kzhfsWW0+b+iQ1xyn3nizWHBlZTLBu+WN39B0PMmdh3K+oJpE8p3bMRraV8T9f/tOVjNo6ZUY3kNJ6rHJ1FzESwN+l3mE+e/8wWiZxW9cpHzZ3WJre8zpJv2fC8SjWM7JVL7em8tD2PuD8wsV064OMYdbJ9f2j/XNSmNxuS779oPwKGaxF7Nbb/BqccT5rkpl+Gx7i2 + + + editor->addProperty(mRota +tionProper +ty);editor->addProperty(mRota tionProper ty);editor->addProperty(mRota tionProper ty);editor->addProperty(mRota tionProper ty); + + + + + + + diff --git a/examples/examples.tiled-project b/examples/examples.tiled-project index ca25c89baa..42ced1e5d5 100644 --- a/examples/examples.tiled-project +++ b/examples/examples.tiled-project @@ -7,9 +7,12 @@ ".", "../tests" ], + "properties": [ + ], "propertyTypes": [ { "color": "#ffa0a0a4", + "drawFill": true, "id": 10, "members": [ { @@ -91,6 +94,7 @@ }, { "color": "#ffcdab8f", + "drawFill": true, "id": 5, "members": [ { @@ -109,6 +113,7 @@ }, { "color": "#ffa0a0a4", + "drawFill": true, "id": 11, "members": [ { @@ -144,6 +149,7 @@ }, { "color": "#ffad7fa8", + "drawFill": true, "id": 4, "members": [ { @@ -191,6 +197,7 @@ }, { "color": "#ff729fcf", + "drawFill": true, "id": 6, "members": [ { @@ -220,6 +227,7 @@ }, { "color": "#fffcaf3e", + "drawFill": true, "id": 8, "members": [ { diff --git a/examples/sticker-knight/map/sandbox.tmx b/examples/sticker-knight/map/sandbox.tmx index 072963fdb9..498da4296d 100644 --- a/examples/sticker-knight/map/sandbox.tmx +++ b/examples/sticker-knight/map/sandbox.tmx @@ -1,5 +1,5 @@ - + @@ -209,7 +209,7 @@ - + @@ -219,6 +219,10 @@ + + + Hello World + diff --git a/examples/sticker-knight/map/sandbox2.tmx b/examples/sticker-knight/map/sandbox2.tmx index 61bb0f632b..6aed398e0a 100644 --- a/examples/sticker-knight/map/sandbox2.tmx +++ b/examples/sticker-knight/map/sandbox2.tmx @@ -1,5 +1,5 @@ - + @@ -269,6 +269,9 @@ + + editor->addProperty(mRotationProperty); + diff --git a/src/tiled/propertieswidget.cpp b/src/tiled/propertieswidget.cpp index ba11667291..a1d5f8ea85 100644 --- a/src/tiled/propertieswidget.cpp +++ b/src/tiled/propertieswidget.cpp @@ -707,10 +707,14 @@ class MapSizeProperty : public SizeProperty MapSizeProperty(MapDocument *mapDocument, QObject *parent = nullptr) : SizeProperty(tr("Map Size"), - [this]{ return mMapDocument->map()->size(); }, {}, + [=]{ + qDebug() << "get size" << mapDocument->map()->size(); + return mapDocument->map()->size(); + }, {}, parent) , mMapDocument(mapDocument) { + qDebug() << "MapSizeProperty" << mapDocument->map()->size(); connect(mMapDocument, &MapDocument::mapChanged, this, &Property::valueChanged); } @@ -2429,6 +2433,8 @@ void CustomProperties::setDocument(Document *document) void CustomProperties::refresh() { + // todo: gather the inherited values from tile and/or class + // todo: gather the values from all selected objects if (mDocument && mDocument->currentObject()) setValue(mDocument->currentObject()->properties()); else diff --git a/src/tiled/propertyeditorwidgets.cpp b/src/tiled/propertyeditorwidgets.cpp index 284248c9a2..3f0dd449df 100644 --- a/src/tiled/propertyeditorwidgets.cpp +++ b/src/tiled/propertyeditorwidgets.cpp @@ -225,6 +225,7 @@ SizeEdit::SizeEdit(QWidget *parent) void SizeEdit::setValue(const QSize &size) { + qDebug() << "SizeEdit::setValue" << size; m_widthSpinBox->setValue(size.width()); m_heightSpinBox->setValue(size.height()); } diff --git a/src/tiled/varianteditor.cpp b/src/tiled/varianteditor.cpp index a73a3831e1..2ba9960e19 100644 --- a/src/tiled/varianteditor.cpp +++ b/src/tiled/varianteditor.cpp @@ -503,6 +503,7 @@ VariantEditor::VariantEditor(QWidget *parent) */ void VariantEditor::clear() { + qDebug() << "clear"; QHashIterator it(m_propertyWidgets); while (it.hasNext()) { it.next();