Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn committed Oct 1, 2024
1 parent 2339f35 commit 50abb67
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
17 changes: 15 additions & 2 deletions examples/desert.tmx
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" tiledversion="1.1.5" orientation="orthogonal" renderorder="right-down" width="40" height="40" tilewidth="32" tileheight="32" infinite="0" nextlayerid="2" nextobjectid="1">
<map version="1.11" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="40" height="40" tilewidth="32" tileheight="32" infinite="0" nextlayerid="3" nextobjectid="5">
<tileset firstgid="1" source="desert.tsx"/>
<tileset firstgid="49" source="sticker-knight/map/objs.tsx"/>
<layer id="1" name="Ground" width="40" height="40">
<data encoding="base64" compression="zlib">
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
</data>
</layer>
<objectgroup id="2" name="Object Layer 1">
<object id="1" x="32" y="32" width="736" height="256">
<text fontfamily="Noto Sans Mono Condensed Medium" pixelsize="28" wrap="1" halign="center" valign="center">editor-&gt;addProperty(mRota
tionProper
ty);editor-&gt;addProperty(mRota tionProper ty);editor-&gt;addProperty(mRota tionProper ty);editor-&gt;addProperty(mRota tionProper ty);</text>
</object>
<object id="2" x="1024" y="256">
<point/>
</object>
<object id="3" x="928" y="448" width="96" height="96"/>
<object id="4" gid="60" x="1088" y="384" width="160" height="192"/>
</objectgroup>
</map>
8 changes: 8 additions & 0 deletions examples/examples.tiled-project
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
".",
"../tests"
],
"properties": [
],
"propertyTypes": [
{
"color": "#ffa0a0a4",
"drawFill": true,
"id": 10,
"members": [
{
Expand Down Expand Up @@ -91,6 +94,7 @@
},
{
"color": "#ffcdab8f",
"drawFill": true,
"id": 5,
"members": [
{
Expand All @@ -109,6 +113,7 @@
},
{
"color": "#ffa0a0a4",
"drawFill": true,
"id": 11,
"members": [
{
Expand Down Expand Up @@ -144,6 +149,7 @@
},
{
"color": "#ffad7fa8",
"drawFill": true,
"id": 4,
"members": [
{
Expand Down Expand Up @@ -191,6 +197,7 @@
},
{
"color": "#ff729fcf",
"drawFill": true,
"id": 6,
"members": [
{
Expand Down Expand Up @@ -220,6 +227,7 @@
},
{
"color": "#fffcaf3e",
"drawFill": true,
"id": 8,
"members": [
{
Expand Down
8 changes: 6 additions & 2 deletions examples/sticker-knight/map/sandbox.tmx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="79" height="45" tilewidth="32" tileheight="32" infinite="0" parallaxoriginx="1264" parallaxoriginy="720" backgroundcolor="#27b99a" nextlayerid="12" nextobjectid="203">
<map version="1.11" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="79" height="45" tilewidth="32" tileheight="32" infinite="0" parallaxoriginx="1264" parallaxoriginy="720" backgroundcolor="#27b99a" nextlayerid="12" nextobjectid="205">
<tileset firstgid="1" source="objs.tsx"/>
<objectgroup id="11" name="static" parallaxx="0" parallaxy="0">
<object id="90" gid="16" x="146.97" y="693.727" width="192" height="192"/>
Expand Down Expand Up @@ -209,7 +209,7 @@
<object id="198" gid="45" x="2496" y="1440" width="32" height="448"/>
<object id="199" gid="45" x="0" y="1440" width="32" height="448"/>
</objectgroup>
<objectgroup id="7" name="game">
<objectgroup draworder="index" id="7" name="game">
<object id="58" template="templates/hero.tx" x="45" y="979.5"/>
<object id="111" template="templates/block.tx" x="594" y="571"/>
<object id="182" template="templates/block.tx" x="1344" y="799"/>
Expand All @@ -219,6 +219,10 @@
<object id="200" template="templates/diamond.tx" x="1583.45" y="829.318"/>
<object id="201" template="templates/diamond.tx" x="1826.45" y="832.318"/>
<object id="202" template="templates/diamond.tx" x="1697.45" y="742.318"/>
<object id="204" gid="12" x="457.5" y="247.5" width="160" height="16"/>
<object id="203" x="491" y="229" width="87.7188" height="21.7969">
<text wrap="1" color="#ffffff">Hello World</text>
</object>
</objectgroup>
<objectgroup id="8" name="above">
<object id="118" gid="19" x="481" y="997" width="224" height="32"/>
Expand Down
5 changes: 4 additions & 1 deletion examples/sticker-knight/map/sandbox2.tmx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="80" height="31" tilewidth="32" tileheight="32" infinite="0" backgroundcolor="#35495e" nextlayerid="9" nextobjectid="387">
<map version="1.11" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="80" height="31" tilewidth="32" tileheight="32" infinite="0" backgroundcolor="#35495e" nextlayerid="9" nextobjectid="388">
<tileset firstgid="1" source="objs.tsx"/>
<objectgroup id="1" name="background">
<object id="193" gid="6" x="0" y="1184" width="1280" height="416"/>
Expand Down Expand Up @@ -269,6 +269,9 @@
<object id="192" type="coin" gid="17" x="96" y="416" width="64" height="64"/>
<object id="231" template="templates/block.tx" x="488" y="448"/>
<object id="285" type="coin" gid="17" x="1536" y="576" width="64" height="64"/>
<object id="387" x="736" y="64" width="320" height="64">
<text wrap="1">editor-&gt;addProperty(mRotationProperty);</text>
</object>
</objectgroup>
<objectgroup id="7" name="above">
<object id="379" type="spikes" gid="51" x="1280" y="995" width="128" height="32"/>
Expand Down
8 changes: 7 additions & 1 deletion src/tiled/propertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/tiled/propertyeditorwidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
1 change: 1 addition & 0 deletions src/tiled/varianteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ VariantEditor::VariantEditor(QWidget *parent)
*/
void VariantEditor::clear()
{
qDebug() << "clear";
QHashIterator<Property *, PropertyWidgets> it(m_propertyWidgets);
while (it.hasNext()) {
it.next();
Expand Down

0 comments on commit 50abb67

Please sign in to comment.