CharakterVorteileWrapper.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Sephrasto 作者: Aeolitus 项目源码 文件源码
def loadVorteile(self):
        self.uiVor.treeWidget.blockSignals(True)
        vortList = [[],[],[],[],[],[],[],[]]
        for el in Wolke.DB.vorteile:
            if Wolke.Char.voraussetzungenPrüfen(Wolke.DB.vorteile[el].voraussetzungen):
                idx = Wolke.DB.vorteile[el].typ
                vortList[idx].append(el)
        for i in range(len(vortList)):
            itm = self.uiVor.treeWidget.topLevelItem(i)
            if type(itm) != QtWidgets.QTreeWidgetItem:
                    continue
            if itm == 0: 
                continue
            for j in range(itm.childCount()):
                chi = itm.child(j)
                if type(chi) != QtWidgets.QTreeWidgetItem:
                    continue
                txt = chi.text(0)
                if txt in Wolke.Char.vorteile or txt == Wolke.Char.minderpakt:    
                    chi.setCheckState(0, QtCore.Qt.Checked)
                else:
                    chi.setCheckState(0, QtCore.Qt.Unchecked) 
                if txt not in vortList[i] and txt != Wolke.Char.minderpakt:
                    chi.setHidden(True)
                    if txt in Wolke.Char.vorteile:
                        chi.setCheckState(0,QtCore.Qt.Unchecked)
                        Wolke.Char.vorteile.remove(txt)
                else:
                    chi.setHidden(False)
                if Wolke.DB.vorteile[el].variable!=0:
                    Wolke.Char.vorteileVariable[el] = self.itemWidgets[el].value()
        self.updateInfo()
        self.uiVor.treeWidget.blockSignals(False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号