master
abc15379 2 years ago
parent bea96620fd
commit f4d6e562b0

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Default" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (ven)" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
</modules>
</component>
</project>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.11 (ven)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyNamespacePackagesService">
<option name="namespacePackageFolders">
<list>
<option value="$MODULE_DIR$/windows" />
</list>
</option>
</component>
</module>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/windows.iml" filepath="$PROJECT_DIR$/.idea/windows.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.11" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,90 @@
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QListWidget, QListWidgetItem
from PyQt5.QtCore import Qt
from PyQt5 import uic
from translate_window import translate
from settingrule_window import settingrule
from selectRuleOrder import orderselet
class MyApp(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi('res/ui/main_window.ui', self)
self.translate_window = translate()
self.setRule_window = settingrule()
self.orderSelect_window = orderselet()
self.addRuleBtn = self.findChild(QPushButton, 'addRuleBtn')
self.delRuleBtn = self.findChild(QPushButton, 'delRuleBtn')
self.translateBtn = self.findChild(QPushButton, 'translateBtn')
self.autoplay = self.findChild(QPushButton, 'autoGameBtn')
self.ruleList = self.findChild(QListWidget, 'ruleList')
self.addRuleBtn.clicked.connect(self.show_settingrule_window)
self.translateBtn.clicked.connect(self.show_translate_window)
self.autoplay.clicked.connect(self.show_orderselect_window)
item = self.ruleList.item(0) # 假设要操作的项目在列表中的第一个位置
# 设置项目的 checkState 为未选择状态
item.setCheckState(Qt.Unchecked)
# 连接itemClicked信号到槽函数
self.ruleList.itemClicked.connect(self.onItemClicked)
self.listIndexs = self.get_item_indexs(self.ruleList)
def show_orderselect_window(self):
item_states = self.get_item_states(self.ruleList)
for item_text, item_state in item_states.items():
if item_state == Qt.Checked:
item = QListWidgetItem(item_text)
item.setFlags(item.flags()|Qt.ItemIsSelectable|Qt.ItemIsUserCheckable|Qt.ItemIsEnabled)
item.setCheckState(Qt.Unchecked)
self.orderSelect_window.order_list.addItem(item)
self.orderSelect_window.show()
def show_settingrule_window(self):
self.setRule_window.show()
def show_translate_window(self):
self.translate_window.show()
def onItemClicked(self, item):
# 处理项目的选择状态变化
if item.checkState() == Qt.Checked:
item.setCheckState(Qt.Unchecked)
else:
item.setCheckState(Qt.Checked)
@staticmethod
def get_item_states(list_widget):
item_states = {} # 用于存储项目的选择状态
for index in range(list_widget.count()):
item = list_widget.item(index)
if item:
item_text = item.text()
item_state = item.checkState()
item_states[item_text] = item_state
return item_states
@staticmethod
def get_item_indexs(list_widget):
item_indexs = {} # 用于建项目的选择状态
for index in range(list_widget.count()):
item = list_widget.item(index)
if item:
item_text = item.text()
item_indexs[item_text] = index
return item_indexs
if __name__ == "__main__":
app = QApplication(sys.argv)
window = MyApp()
window.show()
sys.exit(app.exec_())

@ -0,0 +1,9 @@
from PyQt5.QtWidgets import QMainWindow, QWidget
from PyQt5 import uic
class operateselect(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi('res/ui/operationSelect_window.ui', self)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -0,0 +1,278 @@
import os
import time
import cv2
import pyautogui as p
from PyQt5.QtCore import QThread, pyqtSignal
from windows.res.tools.deal_picture import DealPicture
p.PAUSE = 0.1
p.FAILSAFE = True
def click_once(photo):
positions = p.locateCenterOnScreen(photo, confidence=0.8)
x, y = positions.x, positions.y
p.click(x, y)
time.sleep(0.1)
def click_util(click_photo, stop_function):
count = 0
while stop_function() is False:
positions = DealPicture.find_photo_center(click_photo)
if positions:
x, y = positions.x, positions.y
p.click(x, y)
else:
count += 1
if count == 20:
break
time.sleep(0.1)
def drag_once(drop_position, xOffset=None, yOffset=None, pOffsetX=None, pOffsetY=None):
offsetx = 0
offsety = 0
poffsetx = 0
poffsety = 0
if xOffset:
offsetx = xOffset
if yOffset:
offsety = yOffset
if pOffsetX:
poffsetx = pOffsetX
if pOffsetY:
poffsety = pOffsetY
positions = p.locateCenterOnScreen(drop_position, confidence=0.8)
if positions:
x, y = positions.x, positions.y
# 长按鼠标左键
p.mouseDown(x=x + poffsetx, y=y + poffsety, button='left')
# 向上移动鼠标这里移动了100像素可以根据需要调整
p.moveRel(offsetx, offsety, duration=1)
# 延迟一段时间
time.sleep(0.2)
# 松开鼠标左键
p.mouseUp(x=x + poffsetx + offsetx, y=y + poffsety + offsety, button='left')
time.sleep(0.3)
def drag_util(drop_position, stop_function, xOffset=None, yOffset=None, pOffsetX=None, pOffsetY=None):
count = 0
offsetx = 0
offsety = 0
poffsetx = 0
poffsety = 0
if xOffset:
offsetx = xOffset
if yOffset:
offsety = yOffset
if pOffsetX:
poffsetx = pOffsetX
if pOffsetY:
poffsety = pOffsetY
while stop_function() is False:
positions = DealPicture.find_photo_center(drop_position, 5)
if positions:
x, y = positions.x, positions.y
# 长按鼠标左键
p.mouseDown(x=x + poffsetx, y=y + poffsety, button='left')
# 向上移动鼠标这里移动了100像素可以根据需要调整
p.moveRel(offsetx, offsety, duration=1)
# 延迟一段时间
time.sleep(0.2)
# 松开鼠标左键
p.mouseUp(x=x + poffsetx + offsetx, y=y + poffsety + offsety, button='left')
time.sleep(0.3)
else:
count += 1
if count == 10:
break
time.sleep(0.3)
def backToTerminal():
print("back to terminal")
positions = DealPicture.find_photo_center('../pictures/terminal_photo.png', 2)
while positions is None:
click_photo = cv2.imread('../pictures/back_btn.png')
back_confirm = cv2.imread('../pictures/back_confirm.png')
if DealPicture.find_photo_center(click_photo, 1):
click_once(click_photo)
else:
return False
if DealPicture.find_photo_center(back_confirm, 1):
click_once(back_confirm)
else:
return False
positions = DealPicture.find_photo_center('../pictures/terminal_photo.png')
print("find terminal")
return True
def find_target_level():
print("finding level")
if DealPicture.find_photo_center('../pictures/cur_chapter1.png', 2):
print("on purpose chapter")
else:
return False
while DealPicture.find_photo_center(
'../pictures/level_1-1.png', 1, 0.9) is None and DealPicture.find_photo_center(
'../pictures/level_1-7.png', 1, 0.9) is None:
drag_position = cv2.imread('../pictures/back_btn.png')
name = 'level_1-7.png'
if DealPicture.find_photo_center('../pictures/back_btn.png', 2):
drag_once(drag_position, 300, 0, 0, 200)
else:
print("don't find picture ", name)
return False
while DealPicture.find_photo_center('../pictures/level_1-7.png', 1, 0.9) is None:
drag_position = cv2.imread('../pictures/back_btn.png')
if DealPicture.find_photo_center('../pictures/back_btn.png', 2):
drag_once(drag_position, -400, 0, 300, 200)
else:
print("back to terminal")
return False
click_photo = cv2.imread('../pictures/level_1-7.png')
stop_photo = [cv2.imread('../pictures/fight_photo.png')]
name = 'level_1-7.png'
if DealPicture.find_photo_center(click_photo, 1, 0.9):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photo))
else:
print("don't find picture", name)
return False
return True
def find_target_chapter():
print("finding chapter")
click_photo = cv2.imread('../pictures/terminal_photo.png')
stop_photo = [cv2.imread('../pictures/theme_word.png')]
name = 'terminal_photo.png'
if DealPicture.find_photo_center(click_photo, 1):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photo))
else:
print("don't find picture", name)
return False
click_photo = cv2.imread('../pictures/theme_word.png')
stop_photo = [cv2.imread('../pictures/black_circle.png')]
name = 'theme_word.png'
if DealPicture.find_photo_center(click_photo, 1):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photo))
else:
print("don't find picture", name)
return False
drag_position = cv2.imread('../pictures/black_circle.png')
stop_photo = [cv2.imread('../pictures/purpose_chapter.png')]
name = 'black_circle.png'
if DealPicture.find_photo_center(drag_position, 1):
drag_util(drag_position, lambda: DealPicture.find_any_photos(stop_photo), 0, 400)
else:
print("don't find picture", name)
return False
drag_position = cv2.imread('../pictures/chapter3.png')
stop_photo = [cv2.imread('../pictures/chapter2.png')]
name = 'chapter3.png'
if DealPicture.find_photo_center(drag_position, 1):
drag_util(drag_position, lambda: DealPicture.find_any_photos(stop_photo), 300, 0)
else:
print("don't find picture", name)
return False
drag_position = cv2.imread('../pictures/chapter2.png')
stop_photo = [cv2.imread('../pictures/chapter1.png')]
name = 'chapter2.png'
if DealPicture.find_photo_center(drag_position, 1):
drag_util(drag_position, lambda: DealPicture.find_any_photos(stop_photo), 300, 0)
else:
print("don't find picture", name)
return False
click_photo = cv2.imread('../pictures/chapter1.png')
stop_photos = [cv2.imread('../pictures/fight_photo.png'), cv2.imread('../pictures/cur_chapter1.png')]
name = 'chapter1.png'
if DealPicture.find_photo_center(click_photo, 1):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photos))
else:
print("don't find picture", name)
return False
return True
def fight_time():
print("fighting time!")
click_photo = cv2.imread('../pictures/fight_photo.png')
stop_photo = [cv2.imread('../pictures/start_fighting.png')]
name = 'fight_photo.png'
if DealPicture.find_photo_center(click_photo, 1):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photo))
else:
print("don't find picture", name)
return False
click_photo = cv2.imread('../pictures/start_fighting.png')
stop_photo = [cv2.imread('../pictures/fighting!.png')]
name = 'start_fighting!.png'
if DealPicture.find_photo_center(click_photo, 2):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photo))
else:
print("don't find picture", name)
return False
click_photo = cv2.imread('../pictures/fighting!.png')
while DealPicture.find_photo_center(click_photo, 10):
print("战斗中")
time.sleep(10)
click_photo = cv2.imread('../pictures/mission_fail.png')
stop_photo = [cv2.imread('../pictures/mission_complete.png')]
if DealPicture.find_photo_center(click_photo, 5):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photo))
click_photo = cv2.imread('../pictures/mission_complete.png')
stop_photo = [cv2.imread('../pictures/fight_photo.png')]
name = 'mission_complete.png'
if DealPicture.find_photo_center(click_photo, 5):
click_util(click_photo, lambda: DealPicture.find_any_photos(stop_photo))
else:
print("don't find picture", name)
return False
return True
class WorkerThread(QThread):
finished = pyqtSignal()
def run(self):
os.chdir('res/rules')
current_directory = os.getcwd()
print("Current working directory:", current_directory)
# i = 0
# if find_target_level():
# while i < 10:
# fight_time()
# else:
# backToTerminal()
# while fight_time() is False and i < 10:
# while find_target_level() is False:
# while find_target_chapter() is False:
# while backToTerminal() is False:
# print("开始")
# i += 1
os.chdir('../../../windows')
current_directory = os.getcwd()
print("Current working directory:", current_directory)
self.finished.emit()

@ -0,0 +1,57 @@
import time
import cv2
import pyautogui as p
class DealPicture:
@staticmethod
def screenShot():
p.screenshot().save('../pictures/screenshot.png')
@staticmethod
def find_photo_center(photo, run_time=None, confidence=None):
"""
:param photo: 图片地址或是一个imread
:param run_time: 单位秒
:param confidence: 可选参数图片相似度
:return: 一个positions参数为xy
"""
count = 5
i = 0
if confidence is not None:
confidence = confidence
else:
confidence = 0.8
if run_time:
count = run_time * 10
while i < count:
positions = p.locateCenterOnScreen(photo, confidence=confidence)
if positions:
return positions
i += 1
time.sleep(0.1)
return None
@staticmethod
def find_any_photos(photos, run_time=None):
"""
:param photos: 多个图片地址
:param run_time: 单位秒
:return: true or false
"""
count = 5
i = 0
if run_time:
count = run_time * 10
while i < count:
for photo in photos:
positions = p.locateCenterOnScreen(photo, confidence=0.8)
if positions:
return True
i += 1
time.sleep(0.1)
return False

@ -0,0 +1,7 @@
pOffsetX = 2
pOffsetY = 1
if pOffsetX:
poffsetx = pOffsetX
print(1)
if pOffsetY:
poffsety = pOffsetY

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>mainPage</class>
<widget class="QWidget" name="mainPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>352</width>
<height>803</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="widget_0" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>361</width>
<height>801</height>
</rect>
</property>
<widget class="QWidget" name="widget_1" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>-10</y>
<width>351</width>
<height>671</height>
</rect>
</property>
<widget class="QListWidget" name="ruleList">
<property name="geometry">
<rect>
<x>0</x>
<y>10</y>
<width>351</width>
<height>551</height>
</rect>
</property>
<item>
<property name="text">
<string>明日方舟自动清体力</string>
</property>
<property name="checkState">
<enum>Unchecked</enum>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
</widget>
<widget class="QPushButton" name="autoGameBtn">
<property name="geometry">
<rect>
<x>100</x>
<y>620</y>
<width>131</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>自动游戏</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>30</x>
<y>550</y>
<width>291</width>
<height>71</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="addRuleBtn">
<property name="text">
<string>添加规则</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="delRuleBtn">
<property name="text">
<string>删除规则</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="widget_2" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>660</y>
<width>331</width>
<height>131</height>
</rect>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>67</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>语言选择:</string>
</property>
</widget>
<widget class="QComboBox" name="Lauguage">
<property name="geometry">
<rect>
<x>50</x>
<y>50</y>
<width>86</width>
<height>25</height>
</rect>
</property>
<item>
<property name="text">
<string>日语</string>
</property>
</item>
<item>
<property name="text">
<string>英语</string>
</property>
</item>
</widget>
<widget class="QPushButton" name="choseLocationBtn">
<property name="geometry">
<rect>
<x>10</x>
<y>90</y>
<width>89</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>翻译区域选择</string>
</property>
</widget>
<widget class="QPushButton" name="translateBtn">
<property name="geometry">
<rect>
<x>170</x>
<y>40</y>
<width>121</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>翻译</string>
</property>
</widget>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>693</width>
<height>431</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>691</width>
<height>341</height>
</rect>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGraphicsView" name="graphicsView"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>点击操作</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_2">
<property name="geometry">
<rect>
<x>130</x>
<y>0</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGraphicsView" name="graphicsView_2"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>长按操作</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_3">
<property name="geometry">
<rect>
<x>260</x>
<y>0</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGraphicsView" name="graphicsView_3"/>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>左划操作</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_4">
<property name="geometry">
<rect>
<x>390</x>
<y>0</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGraphicsView" name="graphicsView_4"/>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>右划操作</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_5">
<property name="geometry">
<rect>
<x>520</x>
<y>0</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QGraphicsView" name="graphicsView_11"/>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>键盘点击操作</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_6">
<property name="geometry">
<rect>
<x>0</x>
<y>130</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<widget class="QGraphicsView" name="graphicsView_12"/>
</item>
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>休眠操作</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_7">
<property name="geometry">
<rect>
<x>130</x>
<y>130</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<widget class="QGraphicsView" name="graphicsView_13"/>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>上划操作</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_8">
<property name="geometry">
<rect>
<x>270</x>
<y>130</y>
<width>101</width>
<height>101</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_14">
<item>
<widget class="QGraphicsView" name="graphicsView_14"/>
</item>
<item>
<widget class="QLabel" name="label_14">
<property name="text">
<string>下划操作</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>300</x>
<y>350</y>
<width>91</width>
<height>71</height>
</rect>
</property>
<property name="text">
<string>确认</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<height>394</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>0</y>
<width>571</width>
<height>421</height>
</rect>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>60</x>
<y>40</y>
<width>441</width>
<height>261</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="orderList"/>
</item>
</layout>
</widget>
<widget class="QPushButton" name="cancelBtn">
<property name="geometry">
<rect>
<x>100</x>
<y>330</y>
<width>131</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>返回</string>
</property>
</widget>
<widget class="QPushButton" name="confirmBtn">
<property name="geometry">
<rect>
<x>330</x>
<y>330</y>
<width>131</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>确认</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>151</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>选择规则执行顺序:</string>
</property>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,339 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>272</width>
<height>471</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="widget_2" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>271</width>
<height>471</height>
</rect>
</property>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>271</width>
<height>371</height>
</rect>
</property>
<widget class="QTextEdit" name="textEdit">
<property name="geometry">
<rect>
<x>0</x>
<y>40</y>
<width>201</width>
<height>31</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;图片地址&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>220</x>
<y>120</y>
<width>41</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>上传</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>0</x>
<y>10</y>
<width>271</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>判断条件(可上传多张图片):</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>0</x>
<y>90</y>
<width>251</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>操作选择:</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>50</x>
<y>120</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>操作坐标:</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>220</x>
<y>40</y>
<width>41</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>上传</string>
</property>
</widget>
<widget class="QTextEdit" name="textEdit_5">
<property name="geometry">
<rect>
<x>190</x>
<y>200</y>
<width>51</width>
<height>31</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;0&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>140</x>
<y>170</y>
<width>51</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>x偏移</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>140</x>
<y>200</y>
<width>51</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>y偏移</string>
</property>
</widget>
<widget class="QTextEdit" name="textEdit_6">
<property name="geometry">
<rect>
<x>190</x>
<y>160</y>
<width>51</width>
<height>31</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;0&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>80</x>
<y>180</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>偏移量:</string>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>60</x>
<y>250</y>
<width>251</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>操作类型:</string>
</property>
</widget>
<widget class="QComboBox" name="operateChose">
<property name="geometry">
<rect>
<x>130</x>
<y>250</y>
<width>86</width>
<height>25</height>
</rect>
</property>
<item>
<property name="text">
<string>无</string>
</property>
</item>
<item>
<property name="text">
<string>操作库选择</string>
</property>
</item>
</widget>
<widget class="QLabel" name="label_8">
<property name="geometry">
<rect>
<x>0</x>
<y>300</y>
<width>271</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>结束条件(可上传多张图片):</string>
</property>
</widget>
<widget class="QTextEdit" name="textEdit_3">
<property name="geometry">
<rect>
<x>0</x>
<y>330</y>
<width>201</width>
<height>31</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;图片地址&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="geometry">
<rect>
<x>220</x>
<y>330</y>
<width>41</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>上传</string>
</property>
</widget>
<widget class="QTextEdit" name="textEdit_2">
<property name="geometry">
<rect>
<x>120</x>
<y>120</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;图片地址&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>230</x>
<y>370</y>
<width>41</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>next</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_5">
<property name="geometry">
<rect>
<x>160</x>
<y>370</y>
<width>71</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>previous</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_7">
<property name="geometry">
<rect>
<x>160</x>
<y>410</y>
<width>89</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>保存</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_6">
<property name="geometry">
<rect>
<x>30</x>
<y>410</y>
<width>89</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1069</width>
<height>99</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>180</y>
<width>1071</width>
<height>161</height>
</rect>
</property>
</widget>
<widget class="QTextBrowser" name="orgwords">
<property name="geometry">
<rect>
<x>-10</x>
<y>0</y>
<width>1081</width>
<height>61</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:18pt;&quot;&gt;翻译原文&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QTextBrowser" name="transwords">
<property name="geometry">
<rect>
<x>-10</x>
<y>50</y>
<width>1101</width>
<height>241</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:18pt;&quot;&gt;翻译文字显示&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,41 @@
import os
from PyQt5.QtWidgets import QMainWindow, QListWidget, QPushButton
from PyQt5 import uic
from windows.res.rules.明日方舟自动清体力 import WorkerThread
class orderselet(QMainWindow):
def __init__(self):
super().__init__()
# 创建一个新窗口并加载translate.ui文件
self.worker_thread = None
uic.loadUi('res/ui/selectRuleOrder.ui', self)
self.order_list = self.findChild(QListWidget, 'orderList')
self.confirmBtn = self.findChild(QPushButton, 'confirmBtn')
self.cancelBtn = self.findChild(QPushButton, 'cancelBtn')
self.confirmBtn.clicked.connect(self.confirm_clicked)
self.cancelBtn.clicked.connect(self.cancel_clicked)
def closeEvent(self, event):
# 此方法会在窗口关闭时被调用
# 在这里,您可以添加关闭窗口前的自定义操作
self.order_list.clear()
def confirm_clicked(self):
try:
self.worker_thread = WorkerThread()
self.worker_thread.finished.connect(self.worker_thread_finished)
self.worker_thread.start()
self.close()
except Exception as e:
print(f"An error occurred: {str(e)}")
def worker_thread_finished(self):
# 处理线程完成后的逻辑
pass
def cancel_clicked(self):
self.close()

@ -0,0 +1,26 @@
from PyQt5.QtWidgets import QMainWindow, QComboBox
from PyQt5 import uic
from operateselect_window import operateselect
class settingrule(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi('res/ui/setRule_window.ui', self)
self.operateChoseBox = self.findChild(QComboBox, 'operateChose')
self.operateChoseBox.activated.connect(self.handleComboBoxActivated)
self.operateselect_window = operateselect()
def handleComboBoxActivated(self, index):
selected_option = self.operateChoseBox.itemText(index)
if selected_option == "操作库选择":
self.create新界面()
def create新界面(self):
# 显示新界面
self.operateselect_window.show()

@ -0,0 +1,9 @@
from PyQt5.QtWidgets import QMainWindow
from PyQt5 import uic
class translate(QMainWindow):
def __init__(self):
super().__init__()
# 创建一个新窗口并加载translate.ui文件
uic.loadUi('res/ui/translate_window.ui', self)
Loading…
Cancel
Save