Improve block inspector with ID number, light level, and block name readouts

This commit is contained in:
David Vierra 2015-10-24 15:44:54 -10:00
parent 119fab3f92
commit fec40e9a77
2 changed files with 172 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>379</width>
<width>368</width>
<height>678</height>
</rect>
</property>
@ -20,7 +20,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="pageInspectBlock">
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -90,6 +90,160 @@
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Block Name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="blockNameLabel">
<property name="text">
<string>(name)</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Internal Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="blockInternalNameLabel">
<property name="text">
<string>(internal name)</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>BlockState:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="blockStateLabel">
<property name="text">
<string>(blockstate)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_14">
<property name="text">
<string>Block ID:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="blockIDLabel">
<property name="text">
<string>(id)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_19">
<property name="text">
<string>BlockLight:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="blockLightLabel">
<property name="text">
<string>(blockLight)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>Block Data:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="blockDataLabel">
<property name="text">
<string>(data)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_23">
<property name="text">
<string>SkyLight:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="skyLightLabel">
<property name="text">
<string>(skyLight)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_25">
<property name="text">
<string>HeightMap:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="heightMapLabel">
<property name="text">
<string>(heightMap)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QLabel" name="label_27">
<property name="text">
<string>TileTicks</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="tileTicksSpinBox"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>

View File

@ -77,6 +77,22 @@ class InspectorWidget(QtGui.QWidget):
self.blockYLabel.setText(str(y))
self.blockZLabel.setText(str(z))
blockID = self.editorSession.currentDimension.getBlockID(x, y, z)
blockData = self.editorSession.currentDimension.getBlockData(x, y, z)
blockLight = self.editorSession.currentDimension.getBlockLight(x, y, z)
skyLight = self.editorSession.currentDimension.getSkyLight(x, y, z)
self.blockIDLabel.setText(str(blockID))
self.blockDataLabel.setText(str(blockData))
self.blockLightLabel.setText(str(blockLight))
self.skyLightLabel.setText(str(skyLight))
block = self.editorSession.currentDimension.getBlock(x, y, z)
self.blockNameLabel.setText(block.displayName)
self.blockInternalNameLabel.setText(block.internalName)
self.blockStateLabel.setText(str(block.blockState))
if self.blockEditorWidget:
self.blockTabWidget.removeTab(0)
self.blockEditorWidget = None