-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprefabPreview.py
More file actions
45 lines (38 loc) · 1.55 KB
/
prefabPreview.py
File metadata and controls
45 lines (38 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from PySide.QtCore import *
from PySide.QtGui import *
import sys
#prefab info for displaying information
class prefabInfo(QDialog):
def __init__(self, parent):
super(prefabInfo,self).__init__()
self.locationOrigin = parent.pos()
self.locationAdd = parent.size()
self.setGeometry( QRect(self.locationOrigin.x()+self.locationAdd.width()-50,
self.locationOrigin.y()+self.locationAdd.height()-100,
100,190))
#define default values
self.currentPrefab = ""
self.textureList = []
self.heightList = []
self.styleList = ["Styleless",
"Desert",
"Stone",
"City",
"Alpine"]
self.prefabName = ""
#
#create window widgets
self.heightSpin = QSpinBox()
self.heightSpin.setRange(0,2048)
self.heightSpin.setValue(0)
self.heightSpin.setSingleStep(32)
self.heightSpin.setSuffix(" hammer units")
self.styleCombo = QComboBox()
self.styleCombo.addItems(self.styleList)
self.prefabTitle = QLabel(self.prefabName)
def updatePos():
self.locationOrigin = parent.pos()
self.locationAdd = parent.size()
self.setGeometry( QRect(self.locationOrigin.x()+self.locationAdd.width()-50,
self.locationOrigin.y()+self.locationAdd.height()-100,
100,190))