def get_all_combo(self): combo_list = list() for primal in self.get_all_primal(): if primal.kicker_type is not None: kicker_list = self.get_kicker(primal) if kicker_list is None: continue for kicker in kicker_list: combo = Combo(primal, kicker) combo_list.append(combo) else: combo = Combo(primal) combo_list.append(combo) return combo_list
def create_combos(self): for student in self.students: for preference in student.preferences: preferred_company = self.companies[preference - 1] combo = Combo(student, preferred_company) if(combo not in self.combos_dict.keys()): self.combos_dict[combo] = 1 else: self.combos_dict[combo] += 1 for company in self.companies: for preference in company.preferences: preferred_student = self.students[preference - 1] combo = Combo(preferred_student, company) if(combo not in self.combos_dict.keys()): self.combos_dict[combo] = 1 else: self.combos_dict[combo] += 1
def __init__(self, duel, phase, times, three, track): self.duel = duel # type: Duel self.phase = Phase(*phase) self.times = abs(times) self.three = three self.track = tuple(track[:-2]) + tuple(Combo.fromargs(args) for args in track[-2:]) g = self.duel.g if self.three: pass g.SetText(g.times, str(self.times)) countdown = COUNTDOWN.get(self.phase.name) if countdown: g.countdown = countdown
def catch_up(self, phase, times, three, track): g = self.duel.g times = abs(times) if self.times != times: self.times = times g.SetText(g.times, str(times)) if self.three != three: self.three = three pass phase = Phase(*phase) name = self.phase.name if name == 'DrawPhase': if name != phase.name: g.SetVisible(g.court + '/showhand', False) elif name == 'GangPhase': if name != phase.name: g.SetVisible(g.gang, False) g.SetVisible(g.mclock, False) g.SetVisible(g.lclock, False) g.SetVisible(g.rclock, False) g.SetVisible(g.choice, False) g.SetVisible(g.lchoice, False) g.SetVisible(g.rchoice, False) elif name == 'PlusPhase': if name != phase.name: g.SetVisible(g.plus, False) g.SetVisible(g.clock, False) g.SetVisible(g.choice, False) g.SetVisible(g.lchoice, False) g.SetVisible(g.rchoice, False) elif name == 'MainPhase': if name != phase.name: pass elif self.phase.turn == self.duel.uid != phase.turn: g.selected.clear() for i in xrange(20): h = g.mh + '/m{}'.format(i) g.SetPosition(h, g.origins[i]) self.phase = phase if len(self.track) != len(track): g.SetVisible(g.notice, False) self.track = tuple(track[:-2]) + tuple(Combo.fromargs(args) for args in track[-2:]) countdown = COUNTDOWN.get(self.phase.name) if countdown: g.countdown = countdown
def propose(self, kws): if kws["TouchEvent"] == clientApi.GetMinecraftEnum().TouchEvent.TouchUp: if self.duel and self.duel.chain: phase = self.duel.chain.phase track = self.duel.chain.track if phase.turn == self.duel.uid and phase.name == 'MainPhase': if self.proposals is None: self.last_proposal = None cards = {} for card in self.duel.gamblers[self.duel.uid].cards.itervalues(): cards.setdefault(card[0], []).append(card) duo = list(track[-2:]) duo.extend(None for _ in xrange(2 - len(track))) if duo == [None, None]: combo = None else: try: duo.remove(None) except ValueError: pass combo = duo[-1] self.proposals = Combo.propose(cards, combo) if not self.proposals: self.SetVisible(self.notice, True) proposals = self.proposals # type: list if proposals: if len(proposals) != 1 or self.last_proposal != self.selected: self.SetVisible(self.notice, False) proposals.append(proposals.pop(0)) proposal = proposals[-1][-1].copy() cards = self.duel.gamblers[self.duel.uid].cards for i in xrange(max(cards), min(cards) - 1, -1): x, y = self.origins[i] h = self.mh + '/m{}'.format(i) if cards[i][0] in proposal: k = cards[i][0] proposal[k] -= 1 if not proposal[k]: del proposal[k] self.selected.add(i) self.SetPosition(h, (x, y - 14.0)) else: self.selected.discard(i) self.SetPosition(h, (x, y)) if not self.last_proposal and len(proposals) == 1: self.last_proposal = self.selected.copy()
def search_around(self, i, j): right = 1 down = 1 #Find combos in right direction for id in range(i + 1, 5): if self.map[id, j] == self.map[i, j]: right += 1 else: break #Find combos in down direction for jd in range(j + 1, 6): if self.map[i, jd] == self.map[i, j]: down += 1 else: break #Create combo found cb = Combo([i, j]) cb.add_node([i, j]) has_combo = False if right >= 3: has_combo = True for id in range(i + 1, i + right): self.check[id, j] = 1 cb.add_node([id, j]) if down >= 3: has_combo = True for jd in range(j + 1, j + down): self.check[i, jd] = 1 cb.add_node([i, jd]) if has_combo: self.num_combos += 1 self.num_cbnodes += cb.len() self.combos.append(cb)
def _build(self): for item in self.orderlist: if item["type"] == "textenter": item["widget"] = QtGui.QLineEdit(str(item["value"])) elif item["type"] == "checkbox": item["widget"] = QtGui.QCheckBox() item["widget"].setChecked(item["value"]) elif item["type"] == "combobox": item["widget"] = Combo(self) item["widget"].addlist(item["list"]) item["widget"].setCurrentIndex(item["value"]-1) elif item["type"] == "button": item["widget"] = QtGui.QPushButton(item["text"]) item["widget"].released.connect(item["callback"]) else: raise(TypeError, "Type %s not yet supported" % item["type"]) item["labelw"] = QtGui.QLabel(item["label"]) self.addRow(item["labelw"], item["widget"])
def aStarSearch(r, maxDepth=25): visited = set() solutions = list() depthStates = dict() cost = 0 nullH = NullHeuristic(r.getBoard()) redH = RedDistHeuristic(r.getBoard()) carsH = NumCars(r.getBoard()) lingerH = LingeringCars(r.getBoard()) comboH = Combo(r.getBoard()) queue = PriorityQueue() queue.push((r, tuple(), cost), r.getBoard()) while not queue.isEmpty(): s, score = queue.pop() board = s[0] path = s[1] curCost = s[2] newPath = path + tuple([board]) depthStates[len(newPath)] = depthStates.get(len(newPath), 0) + 1 curCost += 1 if s[0] in visited: continue else: visited.add(board) if s[0].solved(): solutions.append(newPath) return { 'visited': visited, 'solutions': solutions, 'depthStates': depthStates, 'cost': curCost } else: successors = s[0].moves() for succ in successors: string_board = succ.getBoard() queue.push((succ, newPath, curCost), lingerH.eval(string_board)) return { 'visited': visited, 'solutions': solutions, 'depthStates': depthStates, 'cost': curCost }
def play(self, kws): if kws["TouchEvent"] == clientApi.GetMinecraftEnum().TouchEvent.TouchUp: if self.duel and self.duel.chain: phase = self.duel.chain.phase if self.selected and phase.turn == self.duel.uid and phase.name == 'MainPhase': if self.last_result[0] != self.selected: cards = {} gambler = self.duel.gamblers[self.duel.uid] for i in self.selected: card = gambler.cards[i] cards.setdefault(card[0], []).append(card) valid = Combo.fromcards(cards, None) self.last_result = self.selected.copy(), valid and cards if not valid: self.SetVisible(self.notice, True) cards = self.last_result[1] if cards: self._cli.NotifyToServer('G_COURT', { 'pid': clientApi.GetLocalPlayerId(), 'name': 'play', 'args': [cards] })
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 612) MainWindow.setWindowTitle("MyTerm") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_2.setSpacing(0) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.centerFrame = QtWidgets.QFrame(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.centerFrame.sizePolicy().hasHeightForWidth()) self.centerFrame.setSizePolicy(sizePolicy) self.centerFrame.setObjectName("centerFrame") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centerFrame) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.txtEdtOutput = QtWidgets.QTextEdit(self.centerFrame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(3) sizePolicy.setHeightForWidth(self.txtEdtOutput.sizePolicy().hasHeightForWidth()) self.txtEdtOutput.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Courier 10 Pitch") font.setPointSize(10) self.txtEdtOutput.setFont(font) self.txtEdtOutput.setObjectName("txtEdtOutput") self.verticalLayout_2.addWidget(self.txtEdtOutput) self.horizontalLayout_2.addWidget(self.centerFrame) MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.dockWidget_PortConfig = QtWidgets.QDockWidget(MainWindow) self.dockWidget_PortConfig.setContextMenuPolicy(QtCore.Qt.PreventContextMenu) self.dockWidget_PortConfig.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea|QtCore.Qt.RightDockWidgetArea) self.dockWidget_PortConfig.setWindowTitle("Port Config") self.dockWidget_PortConfig.setObjectName("dockWidget_PortConfig") self.dockWidgetContents = QtWidgets.QWidget() self.dockWidgetContents.setObjectName("dockWidgetContents") self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.dockWidgetContents) self.verticalLayout_6.setContentsMargins(0, 0, 0, 0) self.verticalLayout_6.setSpacing(0) self.verticalLayout_6.setObjectName("verticalLayout_6") self.frame = QtWidgets.QFrame(self.dockWidgetContents) self.frame.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame.setFrameShadow(QtWidgets.QFrame.Plain) self.frame.setObjectName("frame") self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.frame) self.verticalLayout_8.setContentsMargins(3, 3, 3, 3) self.verticalLayout_8.setSpacing(1) self.verticalLayout_8.setObjectName("verticalLayout_8") self.verticalLayout_1 = QtWidgets.QVBoxLayout() self.verticalLayout_1.setContentsMargins(1, 1, 1, 1) self.verticalLayout_1.setSpacing(0) self.verticalLayout_1.setObjectName("verticalLayout_1") self.btnEnumPorts = QtWidgets.QToolButton(self.frame) self.btnEnumPorts.setText("Enum Ports") self.btnEnumPorts.setObjectName("btnEnumPorts") self.verticalLayout_1.addWidget(self.btnEnumPorts) self.label_Port = QtWidgets.QLabel(self.frame) self.label_Port.setMinimumSize(QtCore.QSize(0, 20)) self.label_Port.setMaximumSize(QtCore.QSize(16777215, 20)) self.label_Port.setText("Port") self.label_Port.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft) self.label_Port.setObjectName("label_Port") self.verticalLayout_1.addWidget(self.label_Port) self.cmbPort = Combo(self.frame) self.cmbPort.setEditable(True) self.cmbPort.setCurrentText("") self.cmbPort.setObjectName("cmbPort") self.verticalLayout_1.addWidget(self.cmbPort) self.label_2 = QtWidgets.QLabel(self.frame) self.label_2.setMinimumSize(QtCore.QSize(0, 20)) self.label_2.setMaximumSize(QtCore.QSize(16777215, 20)) self.label_2.setText("Baud Rate") self.label_2.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft) self.label_2.setObjectName("label_2") self.verticalLayout_1.addWidget(self.label_2) self.cmbBaudRate = QtWidgets.QComboBox(self.frame) self.cmbBaudRate.setEditable(True) self.cmbBaudRate.setMaxVisibleItems(30) self.cmbBaudRate.setObjectName("cmbBaudRate") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(0, "50") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(1, "75") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(2, "110") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(3, "134") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(4, "150") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(5, "200") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(6, "300") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(7, "600") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(8, "1200") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(9, "1800") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(10, "2400") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(11, "4800") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(12, "9600") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(13, "19200") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(14, "38400") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(15, "57600") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(16, "115200") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(17, "230400") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(18, "460800") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(19, "500000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(20, "576000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(21, "921600") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(22, "1000000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(23, "1152000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(24, "1500000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(25, "2000000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(26, "2500000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(27, "3000000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(28, "3500000") self.cmbBaudRate.addItem("") self.cmbBaudRate.setItemText(29, "4000000") self.verticalLayout_1.addWidget(self.cmbBaudRate) self.label_3 = QtWidgets.QLabel(self.frame) self.label_3.setMinimumSize(QtCore.QSize(0, 20)) self.label_3.setMaximumSize(QtCore.QSize(16777215, 20)) self.label_3.setText("Data Bits") self.label_3.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft) self.label_3.setObjectName("label_3") self.verticalLayout_1.addWidget(self.label_3) self.cmbDataBits = QtWidgets.QComboBox(self.frame) self.cmbDataBits.setCurrentText("8") self.cmbDataBits.setObjectName("cmbDataBits") self.cmbDataBits.addItem("") self.cmbDataBits.setItemText(0, "8") self.cmbDataBits.addItem("") self.cmbDataBits.setItemText(1, "7") self.cmbDataBits.addItem("") self.cmbDataBits.setItemText(2, "6") self.cmbDataBits.addItem("") self.cmbDataBits.setItemText(3, "5") self.verticalLayout_1.addWidget(self.cmbDataBits) self.label_4 = QtWidgets.QLabel(self.frame) self.label_4.setMinimumSize(QtCore.QSize(0, 20)) self.label_4.setMaximumSize(QtCore.QSize(16777215, 20)) self.label_4.setText("Parity") self.label_4.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft) self.label_4.setObjectName("label_4") self.verticalLayout_1.addWidget(self.label_4) self.cmbParity = QtWidgets.QComboBox(self.frame) self.cmbParity.setCurrentText("None") self.cmbParity.setObjectName("cmbParity") self.cmbParity.addItem("") self.cmbParity.setItemText(0, "None") self.cmbParity.addItem("") self.cmbParity.setItemText(1, "Even") self.cmbParity.addItem("") self.cmbParity.setItemText(2, "Odd") self.cmbParity.addItem("") self.cmbParity.setItemText(3, "Mark") self.cmbParity.addItem("") self.cmbParity.setItemText(4, "Space") self.verticalLayout_1.addWidget(self.cmbParity) self.label_5 = QtWidgets.QLabel(self.frame) self.label_5.setMinimumSize(QtCore.QSize(0, 20)) self.label_5.setMaximumSize(QtCore.QSize(16777215, 20)) self.label_5.setText("Stop Bits") self.label_5.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft) self.label_5.setObjectName("label_5") self.verticalLayout_1.addWidget(self.label_5) self.cmbStopBits = QtWidgets.QComboBox(self.frame) self.cmbStopBits.setCurrentText("1") self.cmbStopBits.setObjectName("cmbStopBits") self.cmbStopBits.addItem("") self.cmbStopBits.setItemText(0, "1") self.cmbStopBits.addItem("") self.cmbStopBits.setItemText(1, "1.5") self.cmbStopBits.addItem("") self.cmbStopBits.setItemText(2, "2") self.verticalLayout_1.addWidget(self.cmbStopBits) spacerItem = QtWidgets.QSpacerItem(0, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_1.addItem(spacerItem) self.groupBox = QtWidgets.QGroupBox(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) self.groupBox.setSizePolicy(sizePolicy) self.groupBox.setTitle("HandShake") self.groupBox.setObjectName("groupBox") self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.groupBox) self.verticalLayout_7.setContentsMargins(2, 2, 2, 2) self.verticalLayout_7.setSpacing(0) self.verticalLayout_7.setObjectName("verticalLayout_7") self.chkRTSCTS = QtWidgets.QCheckBox(self.groupBox) self.chkRTSCTS.setMaximumSize(QtCore.QSize(16777215, 22)) self.chkRTSCTS.setText("RTS/CTS") self.chkRTSCTS.setObjectName("chkRTSCTS") self.verticalLayout_7.addWidget(self.chkRTSCTS) self.chkXonXoff = QtWidgets.QCheckBox(self.groupBox) self.chkXonXoff.setMaximumSize(QtCore.QSize(16777215, 22)) self.chkXonXoff.setText("Xon/Xoff") self.chkXonXoff.setObjectName("chkXonXoff") self.verticalLayout_7.addWidget(self.chkXonXoff) self.verticalLayout_1.addWidget(self.groupBox) spacerItem1 = QtWidgets.QSpacerItem(0, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_1.addItem(spacerItem1) self.btnOpen = QtWidgets.QToolButton(self.frame) self.btnOpen.setEnabled(True) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.btnOpen.sizePolicy().hasHeightForWidth()) self.btnOpen.setSizePolicy(sizePolicy) self.btnOpen.setText("Open") self.btnOpen.setObjectName("btnOpen") self.verticalLayout_1.addWidget(self.btnOpen) spacerItem2 = QtWidgets.QSpacerItem(0, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_1.addItem(spacerItem2) self.btnClear = QtWidgets.QToolButton(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.btnClear.sizePolicy().hasHeightForWidth()) self.btnClear.setSizePolicy(sizePolicy) self.btnClear.setText("Clear") self.btnClear.setObjectName("btnClear") self.verticalLayout_1.addWidget(self.btnClear) spacerItem3 = QtWidgets.QSpacerItem(0, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_1.addItem(spacerItem3) self.btnSaveLog = QtWidgets.QToolButton(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.btnSaveLog.sizePolicy().hasHeightForWidth()) self.btnSaveLog.setSizePolicy(sizePolicy) self.btnSaveLog.setText("Save Log") self.btnSaveLog.setObjectName("btnSaveLog") self.verticalLayout_1.addWidget(self.btnSaveLog) spacerItem4 = QtWidgets.QSpacerItem(0, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_1.addItem(spacerItem4) self.verticalLayout_8.addLayout(self.verticalLayout_1) self.verticalLayout_6.addWidget(self.frame) self.dockWidget_PortConfig.setWidget(self.dockWidgetContents) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget_PortConfig) self.dockWidget_SendHex = QtWidgets.QDockWidget(MainWindow) self.dockWidget_SendHex.setContextMenuPolicy(QtCore.Qt.PreventContextMenu) self.dockWidget_SendHex.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea|QtCore.Qt.LeftDockWidgetArea|QtCore.Qt.RightDockWidgetArea) self.dockWidget_SendHex.setWindowTitle("Send Hex") self.dockWidget_SendHex.setObjectName("dockWidget_SendHex") self.dockWidgetContents_2 = QtWidgets.QWidget() self.dockWidgetContents_2.setObjectName("dockWidgetContents_2") self.verticalLayout = QtWidgets.QVBoxLayout(self.dockWidgetContents_2) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setSpacing(0) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setContentsMargins(-1, -1, 2, -1) self.horizontalLayout.setSpacing(2) self.horizontalLayout.setObjectName("horizontalLayout") self.txtEdtInput = QtWidgets.QTextEdit(self.dockWidgetContents_2) self.txtEdtInput.setObjectName("txtEdtInput") self.horizontalLayout.addWidget(self.txtEdtInput) self.btnSendHex = QtWidgets.QToolButton(self.dockWidgetContents_2) self.btnSendHex.setText("Send") self.btnSendHex.setObjectName("btnSendHex") self.horizontalLayout.addWidget(self.btnSendHex) self.verticalLayout.addLayout(self.horizontalLayout) self.dockWidget_SendHex.setWidget(self.dockWidgetContents_2) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8), self.dockWidget_SendHex) self.dockWidget_QuickSend = QtWidgets.QDockWidget(MainWindow) self.dockWidget_QuickSend.setContextMenuPolicy(QtCore.Qt.PreventContextMenu) self.dockWidget_QuickSend.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea|QtCore.Qt.LeftDockWidgetArea|QtCore.Qt.RightDockWidgetArea) self.dockWidget_QuickSend.setWindowTitle("Quick Send") self.dockWidget_QuickSend.setObjectName("dockWidget_QuickSend") self.dockWidgetContents_3 = QtWidgets.QWidget() self.dockWidgetContents_3.setObjectName("dockWidgetContents_3") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.dockWidgetContents_3) self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setSpacing(0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.quickSendTable = QtWidgets.QTableWidget(self.dockWidgetContents_3) font = QtGui.QFont() font.setFamily("Consolas") self.quickSendTable.setFont(font) self.quickSendTable.setEditTriggers(QtWidgets.QAbstractItemView.AllEditTriggers) self.quickSendTable.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection) self.quickSendTable.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) self.quickSendTable.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) self.quickSendTable.setRowCount(10) self.quickSendTable.setColumnCount(2) self.quickSendTable.setObjectName("quickSendTable") self.quickSendTable.horizontalHeader().setVisible(False) self.quickSendTable.horizontalHeader().setMinimumSectionSize(16) self.quickSendTable.horizontalHeader().setStretchLastSection(True) self.quickSendTable.verticalHeader().setVisible(False) self.quickSendTable.verticalHeader().setDefaultSectionSize(16) self.quickSendTable.verticalHeader().setMinimumSectionSize(16) self.verticalLayout_3.addWidget(self.quickSendTable) self.dockWidget_QuickSend.setWidget(self.dockWidgetContents_3) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget_QuickSend) self.toolBar = QtWidgets.QToolBar(MainWindow) self.toolBar.setMinimumSize(QtCore.QSize(0, 31)) self.toolBar.setMaximumSize(QtCore.QSize(16777215, 31)) self.toolBar.setContextMenuPolicy(QtCore.Qt.PreventContextMenu) self.toolBar.setMovable(False) self.toolBar.setAllowedAreas(QtCore.Qt.TopToolBarArea) self.toolBar.setFloatable(False) self.toolBar.setObjectName("toolBar") MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) self.actionSave_Log = QtWidgets.QAction(MainWindow) self.actionSave_Log.setText("Save Log") self.actionSave_Log.setIconText("Save Log") self.actionSave_Log.setToolTip("Save Log") self.actionSave_Log.setStatusTip("Save Log") self.actionSave_Log.setObjectName("actionSave_Log") self.actionExit = QtWidgets.QAction(MainWindow) self.actionExit.setText("Exit") self.actionExit.setIconText("Exit") self.actionExit.setToolTip("Exit") self.actionExit.setStatusTip("Exit") self.actionExit.setObjectName("actionExit") self.actionOpen = QtWidgets.QAction(MainWindow) self.actionOpen.setText("Open") self.actionOpen.setIconText("Open") self.actionOpen.setToolTip("Open the port") self.actionOpen.setStatusTip("Open the port") self.actionOpen.setObjectName("actionOpen") self.actionClose = QtWidgets.QAction(MainWindow) self.actionClose.setText("Close") self.actionClose.setIconText("Close") self.actionClose.setToolTip("Close the port") self.actionClose.setStatusTip("Close the port") self.actionClose.setObjectName("actionClose") self.actionPort_Config_Panel = QtWidgets.QAction(MainWindow) self.actionPort_Config_Panel.setCheckable(True) self.actionPort_Config_Panel.setText("Port Config Panel") self.actionPort_Config_Panel.setIconText("Show Port Config") self.actionPort_Config_Panel.setToolTip("Show or hide Port Config Panel") self.actionPort_Config_Panel.setStatusTip("Show or hide Port Config Panel") self.actionPort_Config_Panel.setObjectName("actionPort_Config_Panel") self.actionAlways_On_Top = QtWidgets.QAction(MainWindow) self.actionAlways_On_Top.setCheckable(True) self.actionAlways_On_Top.setText("Always On Top") self.actionAlways_On_Top.setIconText("Always on top") self.actionAlways_On_Top.setToolTip("Always on most top") self.actionAlways_On_Top.setStatusTip("Always on most top") self.actionAlways_On_Top.setObjectName("actionAlways_On_Top") self.actionLocal_Echo = QtWidgets.QAction(MainWindow) self.actionLocal_Echo.setCheckable(True) self.actionLocal_Echo.setText("Local Echo") self.actionLocal_Echo.setIconText("Local echo") self.actionLocal_Echo.setToolTip("Local Echo") self.actionLocal_Echo.setStatusTip("Echo what you typed") self.actionLocal_Echo.setObjectName("actionLocal_Echo") self.actionAscii = QtWidgets.QAction(MainWindow) self.actionAscii.setCheckable(True) self.actionAscii.setText("Ascii") self.actionAscii.setIconText("Ascii") self.actionAscii.setToolTip("Show as ascii") self.actionAscii.setStatusTip("Show as ascii") self.actionAscii.setObjectName("actionAscii") self.actionHex_lowercase = QtWidgets.QAction(MainWindow) self.actionHex_lowercase.setCheckable(True) self.actionHex_lowercase.setText("hex(lowercase)") self.actionHex_lowercase.setIconText("hex(lowercase)") self.actionHex_lowercase.setToolTip("Show as hex(lowercase)") self.actionHex_lowercase.setStatusTip("Show as hex(lowercase)") self.actionHex_lowercase.setObjectName("actionHex_lowercase") self.actionHEX_UPPERCASE = QtWidgets.QAction(MainWindow) self.actionHEX_UPPERCASE.setCheckable(True) self.actionHEX_UPPERCASE.setText("HEX(UPPERCASE)") self.actionHEX_UPPERCASE.setIconText("HEX(UPPERCASE)") self.actionHEX_UPPERCASE.setToolTip("Show as HEX(UPPERCASE)") self.actionHEX_UPPERCASE.setStatusTip("Show as HEX(UPPERCASE)") self.actionHEX_UPPERCASE.setObjectName("actionHEX_UPPERCASE") self.actionSend_Hex_Panel = QtWidgets.QAction(MainWindow) self.actionSend_Hex_Panel.setCheckable(True) self.actionSend_Hex_Panel.setText("Send Hex Panel") self.actionSend_Hex_Panel.setIconText("Send Hex Panel") self.actionSend_Hex_Panel.setToolTip("Show or hide Send Hex Panel") self.actionSend_Hex_Panel.setStatusTip("Show or hide Hex Transmit Panel") self.actionSend_Hex_Panel.setObjectName("actionSend_Hex_Panel") self.actionAbout = QtWidgets.QAction(MainWindow) self.actionAbout.setText("About MyTerm") self.actionAbout.setIconText("About MyTerm") self.actionAbout.setToolTip("About MyTerm") self.actionAbout.setStatusTip("About MyTerm") self.actionAbout.setObjectName("actionAbout") self.actionAbout_Qt = QtWidgets.QAction(MainWindow) self.actionAbout_Qt.setText("About Qt") self.actionAbout_Qt.setIconText("About Qt") self.actionAbout_Qt.setToolTip("About Qt") self.actionAbout_Qt.setStatusTip("About Qt") self.actionAbout_Qt.setObjectName("actionAbout_Qt") self.actionOpen_Cmd_File = QtWidgets.QAction(MainWindow) self.actionOpen_Cmd_File.setIconText("Open Cmd File") self.actionOpen_Cmd_File.setStatusTip("Open Cmd File") self.actionOpen_Cmd_File.setObjectName("actionOpen_Cmd_File") self.actionQuick_Send_Panel = QtWidgets.QAction(MainWindow) self.actionQuick_Send_Panel.setCheckable(True) self.actionQuick_Send_Panel.setText("Quick Send Panel") self.actionQuick_Send_Panel.setIconText("Quick Send Panel") self.actionQuick_Send_Panel.setToolTip("Show or hide Quick Send Panel") self.actionQuick_Send_Panel.setStatusTip("Show or hide Quick Send Panel") self.actionQuick_Send_Panel.setObjectName("actionQuick_Send_Panel") self.retranslateUi(MainWindow) self.cmbBaudRate.setCurrentIndex(12) QtCore.QMetaObject.connectSlotsByName(MainWindow)
powerhouse = Ability("Powerhouse", 'f1', 60, 0, 15) battlecry = Ability("Battle Cry", 'f2', 45, 0, 10) intimidating_shout = Ability("Intimidating Shout", 'f3', 60, 0, 12) tactic_provoke = Ability("Tactic: Provoke", 'e', 0, 0, 0) tactic_provoke.modifier = 'ctrl' tactic_defense = Ability("Tactic: Defense", 'q', 0, 0, 0) tactic_defense.modifier = 'ctrl' cry_of_havoc = Ability("Cry of Havok", 'q', 15, 0, 0) irritate = Ability("Irritate", 'z', 20, 0, 0) switch_weapons = Ability("Switch Weapons", 'Z', 0, 0, 0) # Groups buffs = (powerhouse, battlecry, intimidating_shout) # Combos shield_slam = Combo("Shield Slam", 'g', ["e", "2"], 9, 1) dulling_blow = Combo("Dulling Blow", '6', ["3"], 9, 1) guard_destroyer = Combo("Guard Destroyer", '4', ["3"], 32, 1.5) titanic_smash = Combo("Titanic Smash", 't', ["1", "2"], 20, 1) titanic_smash_B = Combo("Titanic Smash (Buffs)", 't', ["1", "2"], 20, 1) titanic_smash_B.attach_prefinishers(buffs) counterweight = Combo("Counterweight", 'r', ["2", "1"], 1, 2) counterweight.should_weave = True overreachV = Combo("Overreach V", '8', ["e", "1"], 1, 1.5)