-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopWindowClass.py
111 lines (90 loc) · 4.1 KB
/
topWindowClass.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
from PySide2.QtWidgets import QApplication, QMainWindow, QMessageBox, QFrame, QDialog
# from PySide2.QtCore import Qt
from PySide2 import QtGui
from PVPWindow import Ui_pvpwindow
from battlereadyWindow import Ui_battleReadyForm
from dailyBattleWindow import Ui_dailybattlewindow
from mainWindow import Ui_MainWindow
from mycardWindow import Ui_mycardForm
from enemycardWindow import Ui_enemycardForm
from npcWindow import Ui_npcForm
import global_env
class MyWindow(Ui_MainWindow, QMainWindow):
def __init__(self, parent=None):
super(MyWindow, self).__init__(parent)
# self.setAcceptDrops(True)
# self.setupUi(self)
self.setWindowIcon(QtGui.QIcon(':/bitbug_favicon.ico'))
# def wheelEvent(self, event):
# super()
#
# angle=event.angleDelta() / 108 # 返回QPoint对象,为滚轮转过的数值,单位为1/8度
# angleX=angle.x() # 水平滚过的距离(此处用不上)
# angleY=angle.y() # 竖直滚过的距离
# if angleY > 0:
# action_def.previous_page()
# print("鼠标滚轮上滚") # 响应测试语句
# else: # 滚轮下滚
# action_def.next_page()
# print("鼠标滚轮下滚") # 响应测试语句
def closeEvent(self, event):
global_env.storeSaveData()
# if not global_env.data_saved:
# reply = QtWidgets.QMessageBox.question(self,
# '将关闭程序',
# "是否保存?",
# QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Cancel,
# QtWidgets.QMessageBox.Cancel)
# if reply == QtWidgets.QMessageBox.Yes:
# global_env.keep_data_store()
# event.accept()
# elif reply == QtWidgets.QMessageBox.No:
# event.accept()
# else:
# event.ignore()
# else:
# event.accept()
def resizeEvent(self, event):
if not self.mpShadeWindow.isHidden():
self.mpShadeWindow.setGeometry(0, 0, self.width(), self.height())
event.accept()
class myCardWindow(Ui_mycardForm, QFrame):
def __init__(self, parent=None):
super(myCardWindow, self).__init__(parent)
# self.setAcceptDrops(True)
self.setupUi(self)
self.setWindowIcon(QtGui.QIcon(':/bitbug_favicon.ico'))
class enemyCardWindow(Ui_enemycardForm, QFrame):
def __init__(self, parent=None):
super(enemyCardWindow, self).__init__(parent)
# self.setAcceptDrops(True)
self.setupUi(self)
self.setWindowIcon(QtGui.QIcon(':/bitbug_favicon.ico'))
class npcWindow(Ui_npcForm, QFrame):
def __init__(self, parent=None):
super(npcWindow, self).__init__(parent)
# self.setAcceptDrops(True)
self.setupUi(self)
self.setWindowIcon(QtGui.QIcon(':/bitbug_favicon.ico'))
class battleReadyWindow(Ui_battleReadyForm, QFrame):
def __init__(self, parent=None):
super(battleReadyWindow, self).__init__(parent)
# self.setAcceptDrops(True)
self.setupUi(self)
self.setWindowIcon(QtGui.QIcon(':/bitbug_favicon.ico'))
class dailyBattleWindow(Ui_dailybattlewindow, QMainWindow):
def __init__(self, parent=None):
super(dailyBattleWindow, self).__init__(parent)
# self.setAcceptDrops(True)
self.myCardForm = myCardWindow(self)
self.npcFormList = [npcWindow(self) for i in range(10)]
self.setupUi(self)
self.setWindowIcon(QtGui.QIcon(':/bitbug_favicon.ico'))
class PVPWindow(Ui_pvpwindow, QMainWindow):
def __init__(self, parent=None):
super(PVPWindow, self).__init__(parent)
# self.setAcceptDrops(True)
self.myCardForm = myCardWindow(self)
self.enemyCardForm = enemyCardWindow(self)
self.setupUi(self)
self.setWindowIcon(QtGui.QIcon(':/bitbug_favicon.ico'))