Inspector handles edits properly (find something better than the editMade signal. NBTCompoundRef?)

This commit is contained in:
David Vierra 2015-03-23 21:54:37 -10:00
parent 00c06831d5
commit 52674af7ac

View File

@ -31,12 +31,15 @@ class InspectorWidget(QtGui.QWidget):
self.tileEntity = None
self.entity = None
def editWasMade(self):
if self.currentEntity and self.currentEntity.chunk:
self.currentEntity.chunk.dirty = True
if self.entity and self.entity.chunk:
self.entity.chunk.dirty = True
if self.tileEntity and self.tileEntity.chunk:
self.tileEntity.chunk.dirty = True
def inspectBlock(self, pos):
self.entity = None
self.stackedWidget.setCurrentWidget(self.pageInspectBlock)
x, y, z = pos
self.blockXLabel.setText(str(x))
@ -50,6 +53,8 @@ class InspectorWidget(QtGui.QWidget):
self.removeTileEntityButton.setEnabled(self.tileEntity is not None)
def inspectEntity(self, entity):
self.tileEntity = None
self.entity = entity
self.stackedWidget.setCurrentWidget(self.pageInspectEntity)
self.entityIDLabel.setText(entity.id)