def initVorteile(self):
self.uiVor.treeWidget.blockSignals(True)
vortList = [[],[],[],[],[],[],[],[]]
for el in Wolke.DB.vorteile:
if Wolke.DB.vorteile[el].kosten > 20 and Wolke.DB.vorteile[el].variable == 0:
continue
if Wolke.DB.vorteile[el].kosten < 0:
continue
if el in Wolke.Char.vorteile:
continue
idx = Wolke.DB.vorteile[el].typ
vortList[idx].append(el)
for i in range(len(vortList)):
parent = QtWidgets.QTreeWidgetItem(self.uiVor.treeWidget)
parent.setText(0, VorteilTypen[i])
parent.setText(1,"")
parent.setExpanded(True)
for el in vortList[i]:
child = QtWidgets.QTreeWidgetItem(parent)
child.setText(0, Wolke.DB.vorteile[el].name)
if Wolke.DB.vorteile[el].variable!=0:
child.setText(1, "20 EP")
else:
child.setText(1, str(Wolke.DB.vorteile[el].kosten) + " EP")
self.updateInfo()
self.uiVor.treeWidget.blockSignals(False)
评论列表
文章目录