-
Notifications
You must be signed in to change notification settings - Fork 0
/
mutliChooseDialog.py
215 lines (179 loc) · 8.16 KB
/
mutliChooseDialog.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'mutliChooseDialog.ui'
##
## Created by: Qt User Interface Compiler version 5.14.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
QRect, QSize, QUrl, Qt)
from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QFont,
QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
QRadialGradient)
from PySide2.QtWidgets import *
from ALDialogWindow import Ui_ALWindow
from Qclass import excludeSkillPanel
attrClear = True
skillClear = True
equipClear = True
DEFENDERmode = False
excludeskilltext = ""
class Ui_mutliChooseDialog(object):
def __init__(self, *args, **kwargs):
super(Ui_mutliChooseDialog, self).__init__(*args, **kwargs)
self.value = ""
self.attrClear = False
self.skillClear = False
self.equipClear = False
self.DEFENDERmode = False
self.excludeskilltext = ""
def setupUi(self, Dialog):
if Dialog.objectName():
Dialog.setObjectName(u"Dialog")
Dialog.resize(400, 130)
self.gridLayout_2 = QGridLayout(Dialog)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout = QGridLayout()
self.gridLayout.setObjectName(u"gridLayout")
self.pushButton = QPushButton(Dialog)
self.pushButton.setObjectName(u"pushButton")
self.pushButton.clicked.connect(lambda: self.return_value("bnpc", False))
self.gridLayout.addWidget(self.pushButton, 0, 0, 1, 1)
self.pushButton_2 = QPushButton(Dialog)
self.pushButton_2.setObjectName(u"pushButton_2")
self.pushButton_2.clicked.connect(lambda: self.return_value("bpc", False))
self.gridLayout.addWidget(self.pushButton_2, 0, 1, 1, 1)
self.pushButton_3 = QPushButton(Dialog)
self.pushButton_3.setObjectName(u"pushButton_3")
self.pushButton_3.setStyleSheet("color:red;")
self.pushButton_3.clicked.connect(lambda: self.return_value("anpc", True))
self.gridLayout.addWidget(self.pushButton_3, 0, 2, 1, 1)
self.pushButton_4 = QPushButton(Dialog)
self.pushButton_4.setObjectName(u"pushButton_4")
self.pushButton_4.setStyleSheet("color:red;")
self.pushButton_4.clicked.connect(lambda: self.return_value("apc", True))
self.gridLayout.addWidget(self.pushButton_4, 0, 3, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 4)
self.pushButton_5 = QPushButton(Dialog)
self.pushButton_5.setObjectName(u"pushButton_5")
self.pushButton_5.setStyleSheet("color:red;")
self.pushButton_5.clicked.connect(lambda: self.openALDialog())
self.gridLayout_2.addWidget(self.pushButton_5, 1, 0, 1, 2)
self.gridLayout_3 = QGridLayout()
self.gridLayout_3.setObjectName(u"gridLayout3")
self.gridLayout_2.addLayout(self.gridLayout_3, 1, 2, 1, 2)
self.gridLayout_4 = QGridLayout()
self.gridLayout_4.setObjectName(u"gridLayout3")
self.gridLayout_2.addLayout(self.gridLayout_4, 2, 3, 1, 2)
self.checkbox = QCheckBox(Dialog)
self.checkbox.setStyleSheet("color:red;")
self.gridLayout_3.addWidget(self.checkbox, 0, 1, 1, 1)
self.checkbox2 = QCheckBox(Dialog)
self.checkbox2.setStyleSheet("color:red;")
self.gridLayout_3.addWidget(self.checkbox2, 0, 2, 1, 1)
self.checkbox3 = QCheckBox(Dialog)
self.checkbox3.setStyleSheet("color:red;")
self.gridLayout_3.addWidget(self.checkbox3, 0, 3, 1, 1)
self.checkbox4 = QComboBox(Dialog)
self.checkbox4.addItems(["进攻模式", "防守模式", "混合模式"])
self.gridLayout_3.addWidget(self.checkbox4, 0, 4, 1, 1)
self.tiplabel = QLabel(Dialog)
self.tiplabel.setStyleSheet("color:red;")
self.gridLayout_4.addWidget(self.tiplabel, 0, 1, 1, 1)
self.buttonBox = QDialogButtonBox(Dialog)
self.buttonBox.setObjectName(u"buttonBox")
self.buttonBox.setOrientation(Qt.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel)
self.gridLayout_2.addWidget(self.buttonBox, 3, 1, 1, 4)
self.excludeSkillPanel = excludeSkillPanel(Dialog);
self.excludeSkillPanel.selectSkillButton.setStyleSheet("color:red;")
self.gridLayout_2.addWidget(self.excludeSkillPanel, 3, 0, 1, 1)
self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept)
self.buttonBox.rejected.connect(Dialog.reject)
QMetaObject.connectSlotsByName(Dialog)
# setupUi
def retranslateUi(self, Dialog):
Dialog.setWindowTitle("测试参数")
self.pushButton.setText("bnpc")
self.pushButton_2.setText("bpc")
self.pushButton_3.setText("anpc")
self.pushButton_4.setText("apc")
self.pushButton_5.setText("al")
self.pushButton_5.hide()
self.checkbox.setText("属性自动置1")
self.checkbox2.setText("技能自动清空")
self.checkbox3.setText("装备自动清空")
self.tiplabel.setText("选择装备清空请先设置备选装备")
# retranslateUi
def return_value(self, text, aMode):
self.value = text
if aMode:
if self.checkbox.isChecked():
self.attrClear = True
if self.checkbox2.isChecked():
self.skillClear = True
if self.checkbox3.isChecked():
self.equipClear = True
self.excludeskilltext = self.excludeSkillPanel.getExcludeSkills()
self.DEFENDERmode = self.checkbox4.currentIndex()
self.accept()
def openALDialog(self):
mcw, cmd, startLevel, difficultyList = Ui_ALWindow.launch(self)
if mcw:
text = "startlevel " + str(startLevel) + "\n" + cmd + " "
for item in difficultyList:
text += str(item) + " "
self.return_value(text, True)
class mutliChooseWindow(Ui_mutliChooseDialog, QDialog):
def __init__(self, parent=None):
super(mutliChooseWindow, self).__init__(parent)
# self.setAcceptDrops(True)
self.setupUi(self)
self.setWindowModality(Qt.ApplicationModal)
self.valueInit()
@staticmethod
def launch(parent):
dlg = mutliChooseWindow(parent)
r = dlg.exec_()
if r:
return True, dlg.value, (
dlg.attrClear, dlg.skillClear, dlg.equipClear, dlg.DEFENDERmode, dlg.excludeskilltext)
return False, None, None
@staticmethod
def npcLaunch(parent):
dlg = mutliChooseWindow(parent)
dlg.pushButton_2.hide()
dlg.pushButton_4.hide()
dlg.checkbox4.hide()
r = dlg.exec_()
if r:
return True, dlg.value, (
dlg.attrClear, dlg.skillClear, dlg.equipClear, dlg.DEFENDERmode, dlg.excludeskilltext)
return False, None, None
@staticmethod
def pcLaunch(parent):
dlg = mutliChooseWindow(parent)
dlg.pushButton.hide()
dlg.pushButton_3.hide()
dlg.pushButton_5.hide()
r = dlg.exec_()
if r:
return True, dlg.value, (
dlg.attrClear, dlg.skillClear, dlg.equipClear, dlg.DEFENDERmode, dlg.excludeskilltext)
return False, None, None
def accept(self):
global attrClear, skillClear, equipClear, DEFENDERmode, excludeskilltext
attrClear = self.checkbox.isChecked()
skillClear = self.checkbox2.isChecked()
equipClear = self.checkbox3.isChecked()
DEFENDERmode = self.checkbox4.currentIndex()
excludeskilltext = self.excludeSkillPanel.getExcludeSkills()
QDialog.accept(self)
def valueInit(self):
self.checkbox.setChecked(attrClear)
self.checkbox2.setChecked(skillClear)
self.checkbox3.setChecked(equipClear)
self.checkbox4.setCurrentIndex(DEFENDERmode)
self.excludeSkillPanel.setExcludeSkills(excludeskilltext)