clean rme UI, undo / redo history, new city maps
This commit is contained in:
parent
d3a16d34df
commit
83f3cef52e
10 changed files with 1230 additions and 785 deletions
|
@ -6,25 +6,231 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>709</width>
|
||||
<height>619</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
<string>Region Map Editor</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<widget class="QScrollArea" name="scrollArea_CM_Metatiles">
|
||||
<widget class="QPushButton" name="pushButton_Zoom_In_Map_Image">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>450</x>
|
||||
<x>10</x>
|
||||
<y>250</y>
|
||||
<width>301</width>
|
||||
<height>181</height>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Zoom_Out_Map_Image">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>250</y>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>280</y>
|
||||
<width>691</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>City Map:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_CityMap_picker"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_CityMap_add">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Add a new city map.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<activeon>:/icons/add.ico</activeon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_CityMap_save">
|
||||
<property name="text">
|
||||
<string>save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea_City_Map">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents_City_Map">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>420</width>
|
||||
<height>225</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_20">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_CM_West">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>166</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_CM_North">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>166</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_CM_South">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>166</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGraphicsView" name="graphicsView_City_Map">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="dragMode">
|
||||
<enum>QGraphicsView::NoDrag</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_CM_East">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>166</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QScrollArea" name="scrollArea_CM_Metatiles">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -52,8 +258,8 @@
|
|||
<rect>
|
||||
<x>8</x>
|
||||
<y>0</y>
|
||||
<width>283</width>
|
||||
<height>179</height>
|
||||
<width>242</width>
|
||||
<height>269</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -86,6 +292,9 @@
|
|||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
|
@ -145,15 +354,121 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QTabWidget" name="tabWidget_Region_Map">
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Zoom_In_City_Map">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>19</x>
|
||||
<y>9</y>
|
||||
<width>321</width>
|
||||
<height>221</height>
|
||||
<x>10</x>
|
||||
<y>550</y>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Zoom_Out_City_Map">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>550</y>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Zoom_Out_City_Tiles">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>681</x>
|
||||
<y>550</y>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Zoom_In_City_Tiles">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>661</x>
|
||||
<y>550</y>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Zoom_In_Image_Tiles">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>661</x>
|
||||
<y>250</y>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Zoom_Out_Image_Tiles">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>681</x>
|
||||
<y>250</y>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>691</width>
|
||||
<height>241</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget_Region_Map">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
|
@ -164,10 +479,10 @@
|
|||
<widget class="QScrollArea" name="scrollArea_RM_BkgImg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>-10</x>
|
||||
<y>-10</y>
|
||||
<width>331</width>
|
||||
<height>211</height>
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
<width>341</width>
|
||||
<height>213</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -184,8 +499,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>329</width>
|
||||
<height>209</height>
|
||||
<width>339</width>
|
||||
<height>211</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_18">
|
||||
|
@ -289,10 +604,10 @@
|
|||
<widget class="QScrollArea" name="scrollArea_RM_Layout">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>-10</x>
|
||||
<y>-10</y>
|
||||
<width>331</width>
|
||||
<height>211</height>
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
<width>341</width>
|
||||
<height>213</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -309,8 +624,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>329</width>
|
||||
<height>209</height>
|
||||
<width>339</width>
|
||||
<height>211</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_19">
|
||||
|
@ -408,26 +723,20 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget_RM_Options">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>440</x>
|
||||
<y>20</y>
|
||||
<width>351</width>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_RM_BkgImg_Options">
|
||||
<widget class="QScrollArea" name="scrollArea_RM_Metatiles">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>20</y>
|
||||
<width>281</width>
|
||||
<height>171</height>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>342</width>
|
||||
<height>230</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -459,8 +768,8 @@
|
|||
<rect>
|
||||
<x>8</x>
|
||||
<y>0</y>
|
||||
<width>263</width>
|
||||
<height>169</height>
|
||||
<width>324</width>
|
||||
<height>228</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -501,6 +810,19 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer_RMM_West">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGraphicsView" name="graphicsView_RegionMap_Tiles">
|
||||
<property name="enabled">
|
||||
|
@ -523,19 +845,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer_RMM_West">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_RMM_East">
|
||||
<property name="orientation">
|
||||
|
@ -560,10 +869,10 @@
|
|||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>331</width>
|
||||
<height>211</height>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>342</width>
|
||||
<height>230</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -581,7 +890,7 @@
|
|||
<widget class="QPushButton" name="pushButton_RM_Options_save">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<x>10</x>
|
||||
<y>170</y>
|
||||
<width>107</width>
|
||||
<height>32</height>
|
||||
|
@ -591,7 +900,7 @@
|
|||
<string>Set Values</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<widget class="QWidget" name="layoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>13</x>
|
||||
|
@ -647,7 +956,7 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<widget class="QWidget" name="layoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
|
@ -679,164 +988,20 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<widget class="QPushButton" name="pushButton_RM_Options_delete">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>250</y>
|
||||
<width>341</width>
|
||||
<height>281</height>
|
||||
<x>210</x>
|
||||
<y>170</y>
|
||||
<width>113</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>City Map:</string>
|
||||
<string>Delete Square</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_CityMap_picker"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_CityMap_save">
|
||||
<property name="text">
|
||||
<string>save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea_City_Map">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents_City_Map">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>337</width>
|
||||
<height>235</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_20">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGraphicsView" name="graphicsView_City_Map">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="dragMode">
|
||||
<enum>QGraphicsView::NoDrag</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_CM_West">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>166</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_CM_South">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>166</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_CM_East">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>166</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_CM_North">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>166</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -848,7 +1013,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<width>709</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -858,7 +1023,15 @@
|
|||
</property>
|
||||
<addaction name="action_RegionMap_Save"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuEdit">
|
||||
<property name="title">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
<addaction name="action_RegionMap_Undo"/>
|
||||
<addaction name="action_RegionMap_Redo"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="action_RegionMap_Save">
|
||||
|
@ -869,6 +1042,22 @@
|
|||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_RegionMap_Undo">
|
||||
<property name="text">
|
||||
<string>Undo</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Z</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_RegionMap_Redo">
|
||||
<property name="text">
|
||||
<string>Redo</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Y</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -12,4 +12,19 @@ public:
|
|||
~HistoryItem();
|
||||
};
|
||||
|
||||
enum RegionMapEditorBox {
|
||||
BackgroundImage = 1,
|
||||
CityMapImage = 2,
|
||||
};
|
||||
|
||||
class RegionMapHistoryItem {
|
||||
public:
|
||||
int which;// region map or city map
|
||||
int index;
|
||||
unsigned tile;
|
||||
unsigned prev;
|
||||
RegionMapHistoryItem(int type, int index, unsigned prev, unsigned tile);
|
||||
~RegionMapHistoryItem();
|
||||
};
|
||||
|
||||
#endif // HISTORYITEM_H
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "project.h"
|
||||
#include "map.h"
|
||||
#include "tilemaptileselector.h"
|
||||
#include "history.h"
|
||||
#include "historyitem.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
|
@ -73,6 +75,8 @@ public:
|
|||
//RegionMapSquare *map_squares = nullptr;// array of RegionMapSquares
|
||||
QList<RegionMapSquare> map_squares;
|
||||
|
||||
History<RegionMapHistoryItem*> history;
|
||||
|
||||
QString temp_path;// delete this
|
||||
QString city_map_squares_path;
|
||||
QString region_map_png_path;
|
||||
|
@ -125,6 +129,8 @@ public:
|
|||
unsigned getTileId(int, int);
|
||||
int getMapSquareIndex(int, int);
|
||||
|
||||
void deleteLayoutSquare(int);
|
||||
|
||||
// implement these here?
|
||||
void undo();
|
||||
void redo();
|
||||
|
@ -134,6 +140,7 @@ public:
|
|||
// TODO: move read / write functions to private (and others)
|
||||
private:
|
||||
//
|
||||
//History<QPair<int, uint8_t>> *history;// (index, tile)
|
||||
int layout_width_;
|
||||
int layout_height_;
|
||||
int img_width_;
|
||||
|
|
|
@ -18,6 +18,7 @@ public:
|
|||
|
||||
QString file;
|
||||
|
||||
// TODO: make private and use access functions
|
||||
int width;
|
||||
int height;
|
||||
|
||||
|
@ -28,6 +29,11 @@ public:
|
|||
void create(QString);
|
||||
virtual void paint(QGraphicsSceneMouseEvent*);
|
||||
virtual void draw();
|
||||
int getIndexAt(int, int);
|
||||
|
||||
//private:
|
||||
// int width;
|
||||
// int height;
|
||||
|
||||
signals:
|
||||
void mouseEvent(QGraphicsSceneMouseEvent *, CityMapPixmapItem *);
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include "citymappixmapitem.h"
|
||||
#include "regionmaplayoutpixmapitem.h"
|
||||
#include "regionmap.h"
|
||||
#include "history.h"
|
||||
#include "historyitem.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
|
@ -55,17 +57,45 @@ public:
|
|||
void onRegionMapLayoutHoveredTileChanged(int);
|
||||
void onRegionMapLayoutHoveredTileCleared();
|
||||
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
Ui::RegionMapEditor *ui;
|
||||
Project *project;
|
||||
|
||||
QString rmStatusbarMessage;
|
||||
History<RegionMapHistoryItem*> history;
|
||||
|
||||
double scaleUpFactor = 2.0;
|
||||
double scaleDownFactor = 1.0 / scaleUpFactor;
|
||||
|
||||
double scaleRegionMapTiles = 1.0;
|
||||
double scaleRegionMapImage = 1.0;
|
||||
double scaleCityMapTiles = 1.0;
|
||||
double scaleCityMapImage = 1.0;
|
||||
|
||||
void scaleUp(QGraphicsView *, qreal factor, qreal width, qreal height);
|
||||
|
||||
bool createCityMap(QString);
|
||||
|
||||
private slots:
|
||||
void on_action_RegionMap_Save_triggered();
|
||||
void on_action_RegionMap_Undo_triggered();
|
||||
void on_action_RegionMap_Redo_triggered();
|
||||
void on_tabWidget_Region_Map_currentChanged(int);
|
||||
void on_pushButton_RM_Options_save_clicked();
|
||||
void on_pushButton_RM_Options_delete_clicked();
|
||||
void on_pushButton_CityMap_save_clicked();
|
||||
void on_pushButton_CityMap_add_clicked();//
|
||||
void on_pushButton_Zoom_In_Image_Tiles_clicked();
|
||||
void on_pushButton_Zoom_Out_Image_Tiles_clicked();
|
||||
void on_pushButton_Zoom_In_City_Tiles_clicked();
|
||||
void on_pushButton_Zoom_Out_City_Tiles_clicked();
|
||||
void on_pushButton_Zoom_In_City_Map_clicked();//
|
||||
void on_pushButton_Zoom_Out_City_Map_clicked();
|
||||
void on_pushButton_Zoom_In_Map_Image_clicked();
|
||||
void on_pushButton_Zoom_Out_Map_Image_clicked();//
|
||||
void on_comboBox_CityMap_picker_currentTextChanged(const QString &);
|
||||
void onHoveredRegionMapTileChanged(int, int);
|
||||
void onHoveredRegionMapTileCleared();
|
||||
|
|
|
@ -9,3 +9,12 @@ HistoryItem::HistoryItem(Blockdata *metatiles, int layoutWidth, int layoutHeight
|
|||
HistoryItem::~HistoryItem() {
|
||||
if (this->metatiles) delete this->metatiles;
|
||||
}
|
||||
|
||||
RegionMapHistoryItem::RegionMapHistoryItem(int which_, int index_, unsigned prev_, unsigned tile_) {
|
||||
this->which = which_;
|
||||
this->index = index_;
|
||||
this->prev = prev_;
|
||||
this->tile = tile_;
|
||||
}
|
||||
|
||||
RegionMapHistoryItem::~RegionMapHistoryItem() {}
|
||||
|
|
|
@ -342,7 +342,6 @@ void Map::_floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void Map::undo() {
|
||||
HistoryItem *commit = metatileHistory.back();
|
||||
if (!commit)
|
||||
|
|
|
@ -37,7 +37,7 @@ void CityMapPixmapItem::draw() {
|
|||
}
|
||||
|
||||
void CityMapPixmapItem::save() {
|
||||
//
|
||||
// TODO: logError / logWarn if fail
|
||||
QFile binFile(file);
|
||||
if (!binFile.open(QIODevice::WriteOnly)) return;
|
||||
binFile.write(data);
|
||||
|
@ -49,7 +49,7 @@ void CityMapPixmapItem::paint(QGraphicsSceneMouseEvent *event) {
|
|||
QPointF pos = event->pos();
|
||||
int x = static_cast<int>(pos.x()) / 8;
|
||||
int y = static_cast<int>(pos.y()) / 8;
|
||||
int index = 2 * (x + y * width);
|
||||
int index = getIndexAt(x, y);
|
||||
data[index] = static_cast<uint8_t>(this->tile_selector->selectedTile);
|
||||
|
||||
draw();
|
||||
|
@ -61,3 +61,8 @@ void CityMapPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
|||
int y = static_cast<int>(pos.y()) / 8;
|
||||
emit mouseEvent(event, this);
|
||||
}
|
||||
|
||||
int CityMapPixmapItem::getIndexAt(int x, int y) {
|
||||
//
|
||||
return 2 * (x + y * width);
|
||||
}
|
||||
|
|
|
@ -2,14 +2,21 @@
|
|||
#include "ui_regionmapeditor.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFormLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QColor>
|
||||
#include <QTimer>
|
||||
|
||||
RegionMapEditor::RegionMapEditor(QWidget *parent, Project *pro) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::RegionMapEditor)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->ui->setupUi(this);
|
||||
this->project = pro;
|
||||
this->region_map = new RegionMap;
|
||||
this->setFixedSize(this->size());//statusbar->setSizeGripEnabled(false);
|
||||
}
|
||||
|
||||
RegionMapEditor::~RegionMapEditor()
|
||||
|
@ -158,6 +165,7 @@ void RegionMapEditor::displayCityMapTileSelector() {
|
|||
this->ui->graphicsView_City_Map_Tiles->setScene(this->scene_city_map_tiles);
|
||||
this->ui->graphicsView_City_Map_Tiles->setFixedSize(this->city_map_selector_item->pixelWidth + 2,
|
||||
this->city_map_selector_item->pixelHeight + 2);
|
||||
//this->ui->graphicsView_City_Map_Tiles->scale(2,2);
|
||||
}
|
||||
|
||||
void RegionMapEditor::displayCityMap(QString f) {
|
||||
|
@ -182,10 +190,39 @@ void RegionMapEditor::displayCityMap(QString f) {
|
|||
scene_city_map_image->setSceneRect(this->scene_city_map_image->sceneRect());
|
||||
|
||||
this->ui->graphicsView_City_Map->setScene(scene_city_map_image);
|
||||
this->ui->graphicsView_City_Map->setFixedSize(QSize(82,82));
|
||||
// set fixed size?
|
||||
this->ui->graphicsView_City_Map->setFixedSize(QSize(8 * city_map_item->width + 2, 8 * city_map_item->height + 2));
|
||||
}
|
||||
|
||||
bool RegionMapEditor::createCityMap(QString name) {
|
||||
//
|
||||
bool errored = false;
|
||||
|
||||
QString file = this->project->root + "/graphics/pokenav/city_maps/" + name + ".bin";
|
||||
|
||||
uint8_t filler = 0x30;
|
||||
uint8_t border = 0x7;
|
||||
uint8_t blank = 0x1;
|
||||
QByteArray new_data(400, filler);
|
||||
for (int i = 0; i < new_data.size(); i++) {
|
||||
if (i % 2) continue;
|
||||
int x = i % 20;
|
||||
int y = i / 20;
|
||||
if (y <= 1 || y >= 8 || x <= 3 || x >= 16)
|
||||
new_data[i] = border;
|
||||
else
|
||||
new_data[i] = blank;
|
||||
}
|
||||
|
||||
QFile binFile(file);
|
||||
if (!binFile.open(QIODevice::WriteOnly)) errored = true;
|
||||
binFile.write(new_data);
|
||||
binFile.close();
|
||||
|
||||
loadCityMaps();
|
||||
this->ui->comboBox_CityMap_picker->setCurrentText(name);
|
||||
|
||||
return !errored;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -211,7 +248,7 @@ void RegionMapEditor::onRegionMapLayoutSelectedTileChanged(int index) {
|
|||
QString message = QString();
|
||||
if (this->region_map->map_squares[index].has_map) {
|
||||
//
|
||||
message = QString("Map: %1").arg(this->project->mapSecToMapHoverName->value(
|
||||
message = QString("\t %1").arg(this->project->mapSecToMapHoverName->value(
|
||||
this->region_map->map_squares[index].mapsec)).remove("{NAME_END}");//.remove("{NAME_END}")
|
||||
}
|
||||
this->ui->statusbar->showMessage(message);
|
||||
|
@ -228,7 +265,7 @@ void RegionMapEditor::onRegionMapLayoutHoveredTileChanged(int index) {
|
|||
message = QString("(%1, %2)").arg(x).arg(y);
|
||||
if (this->region_map->map_squares[index].has_map) {
|
||||
//
|
||||
message += QString("Map: %1").arg(this->project->mapSecToMapHoverName->value(
|
||||
message += QString("\t %1").arg(this->project->mapSecToMapHoverName->value(
|
||||
this->region_map->map_squares[index].mapsec)).remove("{NAME_END}");
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +282,7 @@ void RegionMapEditor::onRegionMapLayoutHoveredTileCleared() {
|
|||
message = QString("(%1, %2)").arg(x).arg(y);
|
||||
if (this->region_map->map_squares[index].has_map) {
|
||||
//
|
||||
message += QString("Map: %1").arg(this->project->mapSecToMapHoverName->value(
|
||||
message += QString("\t %1").arg(this->project->mapSecToMapHoverName->value(
|
||||
this->region_map->map_squares[index].mapsec)).remove("{NAME_END}");
|
||||
}
|
||||
}
|
||||
|
@ -270,6 +307,13 @@ void RegionMapEditor::mouseEvent_region_map(QGraphicsSceneMouseEvent *event, Reg
|
|||
// TODO: add functionality here? replace or?
|
||||
} else {
|
||||
//
|
||||
QPointF pos = event->pos();
|
||||
int x = static_cast<int>(pos.x()) / 8;
|
||||
int y = static_cast<int>(pos.y()) / 8;
|
||||
int index = this->region_map->getMapSquareIndex(x, y);
|
||||
RegionMapHistoryItem *commit = new RegionMapHistoryItem(RegionMapEditorBox::BackgroundImage, index,
|
||||
this->region_map->map_squares[index].tile_img_id, this->mapsquare_selector_item->getSelectedTile());
|
||||
history.push(commit);
|
||||
item->paint(event);
|
||||
}
|
||||
}
|
||||
|
@ -283,6 +327,13 @@ void RegionMapEditor::mouseEvent_city_map(QGraphicsSceneMouseEvent *event, CityM
|
|||
// TODO: add functionality here? replace or?
|
||||
} else {
|
||||
//
|
||||
QPointF pos = event->pos();
|
||||
int x = static_cast<int>(pos.x()) / 8;
|
||||
int y = static_cast<int>(pos.y()) / 8;
|
||||
int index = this->city_map_item->getIndexAt(x, y);
|
||||
RegionMapHistoryItem *commit = new RegionMapHistoryItem(RegionMapEditorBox::CityMapImage, index,
|
||||
this->city_map_item->data[index], this->city_map_selector_item->getSelectedTile());
|
||||
history.push(commit);
|
||||
item->paint(event);
|
||||
}
|
||||
}
|
||||
|
@ -318,12 +369,154 @@ void RegionMapEditor::on_pushButton_CityMap_save_clicked() {
|
|||
this->city_map_item->save();
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_RM_Options_delete_clicked() {
|
||||
qDebug() << "delete it fat";
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_CityMap_add_clicked() {
|
||||
QDialog popup(this, Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
|
||||
popup.setWindowTitle("New City Map");
|
||||
popup.setWindowModality(Qt::NonModal);
|
||||
|
||||
QFormLayout form(&popup);
|
||||
|
||||
QLineEdit *input = new QLineEdit();
|
||||
form.addRow(new QLabel("Name:"), input);
|
||||
|
||||
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &popup);
|
||||
|
||||
QString name;
|
||||
|
||||
form.addRow(&buttonBox);
|
||||
connect(&buttonBox, SIGNAL(rejected()), &popup, SLOT(reject()));
|
||||
connect(&buttonBox, &QDialogButtonBox::accepted, [&popup, &input, &name](){
|
||||
name = input->text().remove(QRegularExpression("[^a-zA-Z0-9_]+"));
|
||||
if (!name.isEmpty())
|
||||
popup.accept();
|
||||
});
|
||||
|
||||
if (popup.exec() == QDialog::Accepted) {
|
||||
createCityMap(name);
|
||||
}
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_action_RegionMap_Undo_triggered() {
|
||||
RegionMapHistoryItem *commit = history.current();
|
||||
if (!commit) return;
|
||||
|
||||
uint8_t tile = static_cast<uint8_t>(commit->prev);
|
||||
|
||||
history.back();
|
||||
|
||||
switch (commit->which)
|
||||
{
|
||||
case RegionMapEditorBox::BackgroundImage:
|
||||
history.back();// TODO: why do I need to do this?
|
||||
this->region_map->map_squares[commit->index].tile_img_id = tile;
|
||||
this->region_map_item->draw();
|
||||
break;
|
||||
case RegionMapEditorBox::CityMapImage:
|
||||
this->city_map_item->data[commit->index] = tile;
|
||||
this->city_map_item->draw();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_action_RegionMap_Redo_triggered() {
|
||||
RegionMapHistoryItem *commit = history.next();
|
||||
if (!commit) return;
|
||||
|
||||
uint8_t tile = static_cast<uint8_t>(commit->tile);
|
||||
|
||||
switch (commit->which)
|
||||
{
|
||||
case RegionMapEditorBox::BackgroundImage:
|
||||
history.next();// TODO: why do I need to do this?
|
||||
this->region_map->map_squares[commit->index].tile_img_id = tile;
|
||||
this->region_map_item->draw();
|
||||
break;
|
||||
case RegionMapEditorBox::CityMapImage:
|
||||
this->city_map_item->data[commit->index] = tile;
|
||||
this->city_map_item->draw();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_comboBox_CityMap_picker_currentTextChanged(const QString &file) {
|
||||
this->displayCityMap(file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TODO: prevent huge images with limits on zoom
|
||||
void RegionMapEditor::on_pushButton_Zoom_In_Image_Tiles_clicked() {
|
||||
//
|
||||
scaleRegionMapTiles *= 2.0;
|
||||
this->ui->graphicsView_RegionMap_Tiles->setFixedSize(this->mapsquare_selector_item->pixelWidth * scaleRegionMapTiles + 2,
|
||||
this->mapsquare_selector_item->pixelHeight * scaleRegionMapTiles + 2);
|
||||
this->ui->graphicsView_RegionMap_Tiles->scale(2.0, 2.0);
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_Zoom_Out_Image_Tiles_clicked() {
|
||||
//
|
||||
scaleRegionMapTiles /= 2.0;
|
||||
this->ui->graphicsView_RegionMap_Tiles->setFixedSize(this->mapsquare_selector_item->pixelWidth * scaleRegionMapTiles + 2,
|
||||
this->mapsquare_selector_item->pixelHeight * scaleRegionMapTiles + 2);
|
||||
this->ui->graphicsView_RegionMap_Tiles->scale(0.5, 0.5);
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_Zoom_In_City_Tiles_clicked() {
|
||||
//
|
||||
scaleCityMapTiles *= 2.0;
|
||||
this->ui->graphicsView_City_Map_Tiles->setFixedSize(this->city_map_selector_item->pixelWidth * scaleCityMapTiles + 2,
|
||||
this->city_map_selector_item->pixelHeight * scaleCityMapTiles + 2);
|
||||
this->ui->graphicsView_City_Map_Tiles->scale(2.0,2.0);
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_Zoom_Out_City_Tiles_clicked() {
|
||||
//
|
||||
scaleCityMapTiles /= 2.0;
|
||||
this->ui->graphicsView_City_Map_Tiles->setFixedSize(this->city_map_selector_item->pixelWidth * scaleCityMapTiles + 2,
|
||||
this->city_map_selector_item->pixelHeight * scaleCityMapTiles + 2);
|
||||
this->ui->graphicsView_City_Map_Tiles->scale(0.5,0.5);
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_Zoom_In_City_Map_clicked() {
|
||||
//
|
||||
scaleCityMapImage *= 2.0;
|
||||
this->ui->graphicsView_City_Map->setFixedSize(QSize(8 * city_map_item->width * scaleCityMapImage + 2, 8 * city_map_item->height * scaleCityMapImage + 2));
|
||||
this->ui->graphicsView_City_Map->scale(2.0,2.0);
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_Zoom_Out_City_Map_clicked() {
|
||||
//
|
||||
scaleCityMapImage /= 2.0;
|
||||
this->ui->graphicsView_City_Map->setFixedSize(QSize(8 * city_map_item->width * scaleCityMapImage + 2, 8 * city_map_item->height * scaleCityMapImage + 2));
|
||||
this->ui->graphicsView_City_Map->scale(0.5,0.5);
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_Zoom_In_Map_Image_clicked() {
|
||||
//
|
||||
//qDebug() << "scale:" << scaleRegionMapImage;
|
||||
scaleRegionMapImage *= 2.0;
|
||||
this->ui->graphicsView_Region_Map_BkgImg->setFixedSize(this->region_map->imgSize() * scaleRegionMapImage);
|
||||
this->ui->graphicsView_Region_Map_Layout->setFixedSize(this->region_map->imgSize() * scaleRegionMapImage);
|
||||
this->ui->graphicsView_Region_Map_BkgImg->scale(2.0,2.0);
|
||||
this->ui->graphicsView_Region_Map_Layout->scale(2.0,2.0);
|
||||
}
|
||||
|
||||
void RegionMapEditor::on_pushButton_Zoom_Out_Map_Image_clicked() {
|
||||
//
|
||||
if (scaleRegionMapImage <= 1.0) return;
|
||||
scaleRegionMapImage /= 2.0;
|
||||
this->ui->graphicsView_Region_Map_BkgImg->setFixedSize(this->region_map->imgSize() * scaleRegionMapImage);
|
||||
this->ui->graphicsView_Region_Map_Layout->setFixedSize(this->region_map->imgSize() * scaleRegionMapImage);
|
||||
this->ui->graphicsView_Region_Map_BkgImg->scale(0.5,0.5);
|
||||
this->ui->graphicsView_Region_Map_Layout->scale(0.5,0.5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -331,16 +524,6 @@ void RegionMapEditor::on_comboBox_CityMap_picker_currentTextChanged(const QStrin
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// the function that draws the map on the scene
|
||||
// (qnqlogous to Map::render)
|
||||
// TODO: figure out why this is being called twice!!
|
||||
// (this also affects the history)
|
||||
void RegionMapPixmapItem::draw() {
|
||||
if (!region_map) return;
|
||||
|
||||
|
@ -31,7 +32,8 @@ void RegionMapPixmapItem::paint(QGraphicsSceneMouseEvent *event) {
|
|||
QPointF pos = event->pos();
|
||||
int x = static_cast<int>(pos.x()) / 8;
|
||||
int y = static_cast<int>(pos.y()) / 8;
|
||||
this->region_map->map_squares[x + y * region_map->width()].tile_img_id = this->tile_selector->selectedTile;
|
||||
int index = x + y * region_map->width();
|
||||
this->region_map->map_squares[index].tile_img_id = this->tile_selector->selectedTile;
|
||||
}
|
||||
draw();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue