Skip to content

Commit

Permalink
new UI system
Browse files Browse the repository at this point in the history
  • Loading branch information
AcademicDog committed Sep 27, 2019
1 parent 19bf0d3 commit d349f01
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 160 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## v1.0.0.0927
#### New features:
* 更新了UI系统,现在预留了更多的设置空间。
* 增加了狗粮更换滑块,现在可以自由设置狗粮更换的式神进度。
#### Fixes (bugs & defects):
* 修复了某些情况下,打完boss脚本会死掉的情况。
* 根据[#14](https://github.com/AcademicDog/onmyoji_bot/issues/14),修复了乘客在庭院上车,可能会出现进入其他界面问题。

## v1.0.0.0926
#### Fixes (bugs & defects):
* 修复了部分模型过大(如茨林、拍屁股),导致无法有效更换满级狗粮的问题。
Expand Down
127 changes: 72 additions & 55 deletions Ui_onmyoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,59 @@
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(288, 590)
MainWindow.setMinimumSize(QtCore.QSize(288, 590))
MainWindow.resize(545, 590)
MainWindow.setMinimumSize(QtCore.QSize(545, 590))
MainWindow.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout_6 = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout_6.setObjectName("gridLayout_6")
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setMinimumSize(QtCore.QSize(0, 0))
self.frame.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.frame.setFrameShape(QtWidgets.QFrame.Box)
self.frame.setFrameShadow(QtWidgets.QFrame.Sunken)
self.frame.setObjectName("frame")
self.gridLayout_3 = QtWidgets.QGridLayout(self.frame)
self.gridLayout_3.setObjectName("gridLayout_3")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.label_4 = QtWidgets.QLabel(self.frame)
self.label_4.setObjectName("label_4")
self.verticalLayout_2.addWidget(self.label_4)
self.textEdit = QtWidgets.QTextEdit(self.frame)
self.textEdit.setEnabled(True)
self.textEdit.setMinimumSize(QtCore.QSize(216, 124))
self.textEdit.setStatusTip("")
self.textEdit.setReadOnly(True)
self.textEdit.setObjectName("textEdit")
self.verticalLayout_2.addWidget(self.textEdit)
self.line_3 = QtWidgets.QFrame(self.frame)
self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_3.setObjectName("line_3")
self.gridLayout_3.addWidget(self.line_3, 1, 0, 1, 1)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.verticalLayout_2.addWidget(self.line_3)
self.start_btn = QtWidgets.QPushButton(self.frame)
self.start_btn.setMinimumSize(QtCore.QSize(246, 23))
self.start_btn.setLayoutDirection(QtCore.Qt.RightToLeft)
self.start_btn.setObjectName("start_btn")
self.verticalLayout_2.addWidget(self.start_btn)
self.pushButton = QtWidgets.QPushButton(self.frame)
self.pushButton.setMinimumSize(QtCore.QSize(246, 0))
self.pushButton.setObjectName("pushButton")
self.verticalLayout_2.addWidget(self.pushButton)
self.gridLayout_3.addLayout(self.verticalLayout_2, 1, 2, 1, 1)
self.label = QtWidgets.QLabel(self.frame)
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(24)
self.label.setFont(font)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
self.line_2 = QtWidgets.QFrame(self.frame)
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.verticalLayout.addWidget(self.line_2)
self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.tabWidget = QtWidgets.QTabWidget(self.frame)
self.tabWidget.setMinimumSize(QtCore.QSize(246, 115))
self.tabWidget.setMinimumSize(QtCore.QSize(0, 0))
self.tabWidget.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.tabWidget.setObjectName("tabWidget")
self.tab = QtWidgets.QWidget()
Expand Down Expand Up @@ -73,14 +91,23 @@ def setupUi(self, MainWindow):
self.tab_2.setObjectName("tab_2")
self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_2)
self.gridLayout_5.setObjectName("gridLayout_5")
self.checkBox_3 = QtWidgets.QCheckBox(self.tab_2)
self.checkBox_3.setChecked(True)
self.checkBox_3.setObjectName("checkBox_3")
self.gridLayout_5.addWidget(self.checkBox_3, 1, 0, 1, 1)
self.checkBox_2 = QtWidgets.QCheckBox(self.tab_2)
self.checkBox_2.setObjectName("checkBox_2")
self.gridLayout_5.addWidget(self.checkBox_2, 4, 0, 1, 1)
self.plainTextEdit_2 = QtWidgets.QPlainTextEdit(self.tab_2)
self.plainTextEdit_2.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.plainTextEdit_2.setReadOnly(True)
self.plainTextEdit_2.setObjectName("plainTextEdit_2")
self.gridLayout_5.addWidget(self.plainTextEdit_2, 0, 0, 1, 1)
self.checkBox_2 = QtWidgets.QCheckBox(self.tab_2)
self.checkBox_2.setObjectName("checkBox_2")
self.gridLayout_5.addWidget(self.checkBox_2, 1, 0, 1, 1)
self.horizontalSlider = QtWidgets.QSlider(self.tab_2)
self.horizontalSlider.setSliderPosition(10)
self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider.setObjectName("horizontalSlider")
self.gridLayout_5.addWidget(self.horizontalSlider, 2, 0, 1, 1)
self.tabWidget.addTab(self.tab_2, "")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
Expand All @@ -93,18 +120,18 @@ def setupUi(self, MainWindow):
self.gridLayout_4.addWidget(self.plainTextEdit, 0, 0, 1, 1)
self.tabWidget.addTab(self.tab_3, "")
self.verticalLayout.addWidget(self.tabWidget)
self.line_5 = QtWidgets.QFrame(self.frame)
self.line_5.setFrameShape(QtWidgets.QFrame.HLine)
self.line_5.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_5.setObjectName("line_5")
self.verticalLayout.addWidget(self.line_5)
self.line = QtWidgets.QFrame(self.frame)
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.verticalLayout.addWidget(self.line)
self.groupBox_2 = QtWidgets.QGroupBox(self.frame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
self.groupBox_2.setSizePolicy(sizePolicy)
self.groupBox_2.setMinimumSize(QtCore.QSize(246, 100))
self.groupBox_2.setMinimumSize(QtCore.QSize(0, 0))
self.groupBox_2.setLayoutDirection(QtCore.Qt.LeftToRight)
self.groupBox_2.setObjectName("groupBox_2")
self.gridLayout_7 = QtWidgets.QGridLayout(self.groupBox_2)
Expand All @@ -116,51 +143,35 @@ def setupUi(self, MainWindow):
self.label_2 = QtWidgets.QLabel(self.groupBox_2)
self.label_2.setObjectName("label_2")
self.gridLayout_7.addWidget(self.label_2, 2, 0, 1, 1)
self.label_3 = QtWidgets.QLabel(self.groupBox_2)
self.label_3.setObjectName("label_3")
self.gridLayout_7.addWidget(self.label_3, 3, 0, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(self.groupBox_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lineEdit.sizePolicy().hasHeightForWidth())
self.lineEdit.setSizePolicy(sizePolicy)
self.lineEdit.setMaximumSize(QtCore.QSize(16777215, 20))
self.lineEdit.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout_7.addWidget(self.lineEdit, 2, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.groupBox_2)
self.label_3.setObjectName("label_3")
self.gridLayout_7.addWidget(self.label_3, 3, 0, 1, 1)
self.lineEdit_2 = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_2.setMaximumSize(QtCore.QSize(16777215, 20))
self.lineEdit_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.lineEdit_2.setObjectName("lineEdit_2")
self.gridLayout_7.addWidget(self.lineEdit_2, 3, 1, 1, 1)
self.verticalLayout.addWidget(self.groupBox_2)
self.line_4 = QtWidgets.QFrame(self.frame)
self.line_4.setFrameShape(QtWidgets.QFrame.HLine)
self.line_4.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_4.setObjectName("line_4")
self.verticalLayout.addWidget(self.line_4)
self.textEdit = QtWidgets.QTextEdit(self.frame)
self.textEdit.setMinimumSize(QtCore.QSize(246, 124))
self.textEdit.setObjectName("textEdit")
self.verticalLayout.addWidget(self.textEdit)
self.line = QtWidgets.QFrame(self.frame)
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.verticalLayout.addWidget(self.line)
self.start_btn = QtWidgets.QPushButton(self.frame)
self.start_btn.setMinimumSize(QtCore.QSize(246, 23))
self.start_btn.setLayoutDirection(QtCore.Qt.RightToLeft)
self.start_btn.setObjectName("start_btn")
self.verticalLayout.addWidget(self.start_btn)
self.pushButton = QtWidgets.QPushButton(self.frame)
self.pushButton.setMinimumSize(QtCore.QSize(246, 0))
self.pushButton.setObjectName("pushButton")
self.verticalLayout.addWidget(self.pushButton)
self.gridLayout_3.addLayout(self.verticalLayout, 0, 0, 1, 1)
self.gridLayout_6.addWidget(self.frame, 0, 0, 1, 1)
self.gridLayout_3.addLayout(self.verticalLayout, 1, 0, 1, 1)
self.line_2 = QtWidgets.QFrame(self.frame)
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.gridLayout_3.addWidget(self.line_2, 1, 1, 1, 1)
self.gridLayout_6.addWidget(self.frame, 1, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 288, 23))
self.menubar.setGeometry(QtCore.QRect(0, 0, 545, 23))
self.menubar.setObjectName("menubar")
self.menu = QtWidgets.QMenu(self.menubar)
self.menu.setObjectName("menu")
Expand All @@ -173,6 +184,7 @@ def setupUi(self, MainWindow):
self.actionAbout_2 = QtWidgets.QAction(MainWindow)
self.actionAbout_2.setObjectName("actionAbout_2")
self.actionAbout = QtWidgets.QAction(MainWindow)
self.actionAbout.setStatusTip("")
self.actionAbout.setObjectName("actionAbout")
self.menu.addAction(self.actionAbout)
self.menubar.addAction(self.menu.menuAction())
Expand All @@ -189,15 +201,22 @@ def setupUi(self, MainWindow):
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "onmyoji_bot"))
self.label_4.setText(_translate("MainWindow", "日志"))
self.start_btn.setText(_translate("MainWindow", "开始"))
self.pushButton.setText(_translate("MainWindow", "结束"))
self.label.setText(_translate("MainWindow", "辅助助手"))
self.groupBox.setTitle(_translate("MainWindow", "模式"))
self.radioButton_2.setText(_translate("MainWindow", "单人司机"))
self.radioButton.setText(_translate("MainWindow", "单刷"))
self.radioButton_3.setText(_translate("MainWindow", "单人乘客"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "御魂/御灵"))
self.plainTextEdit_2.setPlainText(_translate("MainWindow", "把狗粮队长放在最左边,点开需要打的章节,然后开始。\n"
"支持自动换狗粮,只打经验怪。"))
self.checkBox_3.setText(_translate("MainWindow", "换狗粮拖放式神进度条,进度:"))
self.checkBox_2.setText(_translate("MainWindow", "结束后打BOSS"))
self.plainTextEdit_2.setPlainText(_translate("MainWindow", "把狗粮队长放在最左边,点开需要打的章节,然后开始。\n"
"\n"
"支持自动换狗粮,只打经验怪。\n"
"\n"
"最好把“合并相同式神”选项关闭。"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "探索"))
self.plainTextEdit.setPlainText(_translate("MainWindow", "网址:https://github.com/AcademicDog/onmyoji_bot\n"
"\n"
Expand All @@ -206,11 +225,9 @@ def retranslateUi(self, MainWindow):
self.groupBox_2.setTitle(_translate("MainWindow", "高级选项"))
self.checkBox.setText(_translate("MainWindow", "超时自动关闭阴阳师"))
self.label_2.setText(_translate("MainWindow", " 画面超时时间(秒):"))
self.lineEdit.setText(_translate("MainWindow", "100"))
self.label_3.setText(_translate("MainWindow", " 操作超时时间(秒):"))
self.lineEdit.setText(_translate("MainWindow", "100"))
self.lineEdit_2.setText(_translate("MainWindow", "20"))
self.start_btn.setText(_translate("MainWindow", "开始"))
self.pushButton.setText(_translate("MainWindow", "结束"))
self.menu.setTitle(_translate("MainWindow", "帮助"))
self.actionFile.setText(_translate("MainWindow", "File"))
self.actionAbout_2.setText(_translate("MainWindow", "About"))
Expand Down
18 changes: 16 additions & 2 deletions explore/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def __init__(self):
conf = configparser.ConfigParser()
conf.read('conf.ini')
self.fight_boss_enable = conf.getboolean('explore', 'fight_boss_enable')
self.slide_shikigami = conf.getboolean('explore', 'slide_shikigami')
self.slide_shikigami_progress = conf.getint('explore', 'slide_shikigami_progress')

def next_scene(self):
'''
Expand Down Expand Up @@ -61,7 +63,18 @@ def check_exp_full(self):
time.sleep(1)

# 拖放进度条
self.yys.mouse_drag_bg(*TansuoPos.n_slide)
if self.slide_shikigami:
# 读取坐标范围
star_x = TansuoPos.n_slide[0][0]
end_x = TansuoPos.n_slide[1][0]
length = end_x - star_x

# 计算拖放范围
pos_end_x = int(star_x + length/100*self.slide_shikigami_progress)
pos_end_y = TansuoPos.n_slide[0][1]

self.yys.mouse_drag_bg(
TansuoPos.n_slide[0], (pos_end_x, pos_end_y))

# 更换狗粮
if gouliang1:
Expand Down Expand Up @@ -150,7 +163,7 @@ def fight_moster(self, mood1, mood2):

# 在战斗结算页面
self.yys.mouse_click_bg(ut.firstposition())
self.click_until('结算', 'img\\YING-BING.png',
self.click_until('结算', 'img\\MESSAGE.png',
*CommonPos.second_position, mood2.get1mood()/1000)

def start(self):
Expand Down Expand Up @@ -187,3 +200,4 @@ def start(self):
break
self.yys.mouse_click_bg(*TansuoPos.confirm_btn)
self.log.writeinfo('结束本轮探索')
time.sleep(0.5)
Binary file added img/JIA-CHENG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/MESSAGE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mitama/fighter_passenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def start(self):
break

# 点击结算,直到回到主界面
if (not self.yys.find_game_img('img\\MAIL.png')):
if not (self.yys.find_game_img('img\\MAIL.png') or self.yys.find_game_img('img\\JIA-CHENG.png')):
self.yys.mouse_click_bg(*CommonPos.second_position)

# 检测是否有御魂邀请
Expand Down
Loading

0 comments on commit d349f01

Please sign in to comment.