Add command block tile inspector
This commit is contained in:
parent
6aca9d8457
commit
d03d8c9912
@ -28,6 +28,7 @@ def unregisterBlockInspectorWidget(widgetClass):
|
||||
registerBlockInspectorWidget(ChestEditorWidget)
|
||||
registerBlockInspectorWidget(DispenserEditorWidget)
|
||||
registerBlockInspectorWidget(HopperEditorWidget)
|
||||
registerBlockInspectorWidget(CommandBlockEditorWidget)
|
||||
|
||||
class InspectorWidget(QtGui.QWidget):
|
||||
def __init__(self, editorSession):
|
||||
|
43
src/mcedit2/widgets/inspector/tileentities/command.py
Normal file
43
src/mcedit2/widgets/inspector/tileentities/command.py
Normal file
@ -0,0 +1,43 @@
|
||||
"""
|
||||
command
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
import logging
|
||||
from PySide import QtGui
|
||||
from mcedit2.widgets.layout import Column, Row
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CommandBlockEditorWidget(QtGui.QWidget):
|
||||
tileEntityID = "Control"
|
||||
def __init__(self, editorSession, tileEntityRef):
|
||||
super(CommandBlockEditorWidget, self).__init__()
|
||||
assert tileEntityRef.id == self.tileEntityID
|
||||
|
||||
self.customNameLabel = QtGui.QLabel(self.tr("Custom Name: "))
|
||||
self.customNameField = QtGui.QLineEdit()
|
||||
|
||||
self.trackOutputCheckbox = QtGui.QCheckBox(self.tr("Track Output"))
|
||||
self.successCountLabel = QtGui.QLabel(self.tr("Success Count: "))
|
||||
self.successCountSpinBox = QtGui.QSpinBox()
|
||||
|
||||
|
||||
self.commandTextEdit = QtGui.QTextEdit()
|
||||
self.commandTextEdit.setAcceptRichText(False)
|
||||
|
||||
self.commandGroup = QtGui.QGroupBox(self.tr("Command Text:"))
|
||||
self.commandGroup.setLayout(Column(self.commandTextEdit))
|
||||
self.setLayout(Column(Row(self.customNameLabel, self.customNameField),
|
||||
Row(self.trackOutputCheckbox, None,
|
||||
self.successCountLabel, self.successCountSpinBox),
|
||||
self.commandGroup))
|
||||
|
||||
self.tileEntityRef = tileEntityRef
|
||||
|
||||
self.commandTextEdit.setText(tileEntityRef.Command)
|
||||
self.customNameField.setText(tileEntityRef.CustomName)
|
||||
self.trackOutputCheckbox.setChecked(tileEntityRef.TrackOutput != 0)
|
||||
self.successCountSpinBox.setValue(tileEntityRef.SuccessCount)
|
||||
|
||||
|
Reference in New Issue
Block a user