加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
KZC丶Dream 提交于 2021-10-24 21:54 . 初始化
#!/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2021/8/20 22:54
# @Author : kuang_zhi_cheng
# @Email : 873082057@qq.com
# @File : main_window.py
# @Software: PyCharm
import sys
from PySide2.QtWidgets import QApplication, QStyleFactory
from resources.main_window import *
from script.ui_logic import *
from script.calc_logic import *
ATTR_PATH = "D:\PythonProject\Demo01\Attr.xlsx"
class MyWindow(QMainWindow, Ui_MainWindow):
def __init__(self):
super(MyWindow, self).__init__()
self.setupUi(self)
load_xlsx(ATTR_PATH, self.Attacking)
load_xlsx(ATTR_PATH, self.Defensive)
def reset(self, event):
"""
重置hook
:param event:
"""
rest_table_value(self.Attacking)
rest_table_value(self.Defensive)
def column_change_attacking(self, row: int, column: int):
"""
单元格验证
:param row: 行
:param column:列
"""
column_change(row, column, self.Attacking)
def column_change_defensive(self, row: int, column: int):
"""
单元格验证
:param row: 行
:param column:列
"""
column_change(row, column, self.Defensive)
def hurt_calc(self, event):
"""
计算伤害
:param event:
"""
attacking = get_attr_bean(self.Attacking)
defensive = get_attr_bean(self.Defensive)
calc(attacking, defensive)
def main():
app = QApplication(sys.argv)
app.setStyle(QStyleFactory.create('Fusion'))
my_window = MyWindow()
my_window.show()
app.exec_()
if __name__ == '__main__':
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化