Skip to content

Commit

Permalink
✨ 🐛: 修复识别订单状态错误,ui修改
Browse files Browse the repository at this point in the history
  • Loading branch information
Amber-siley committed Oct 11, 2024
1 parent b0395b8 commit c13d98d
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 3 deletions.
30 changes: 30 additions & 0 deletions UI.ui
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,36 @@ QPushButton:pressed, QPushButton:checked {
<string>角色养成材料一览</string>
</property>
</widget>
<widget class="QPushButton" name="choice_Chips_Button">
<property name="geometry">
<rect>
<x>0</x>
<y>126</y>
<width>175</width>
<height>42</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: #ffffff;
border: 1px solid #dcdfe6;
border-radius: 1px;
}

QPushButton:hover {
background-color: #ecf5ff;
color: #409eff;
}

QPushButton:pressed, QPushButton:checked {
border: 1px solid #3a8ee6;
color: #409eff;
}</string>
</property>
<property name="text">
<string>自选箱芯片一览</string>
</property>
</widget>
</widget>
</widget>
</widget>
Expand Down
19 changes: 19 additions & 0 deletions Ui_UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,24 @@ def setupUi(self, Form):
" color: #409eff;\n"
"}")
self.growthItems_Button.setObjectName("growthItems_Button")
self.choice_Chips_Button = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents_2)
self.choice_Chips_Button.setGeometry(QtCore.QRect(0, 126, 175, 42))
self.choice_Chips_Button.setStyleSheet("QPushButton {\n"
" background-color: #ffffff;\n"
" border: 1px solid #dcdfe6;\n"
" border-radius: 1px;\n"
"}\n"
"\n"
"QPushButton:hover {\n"
" background-color: #ecf5ff;\n"
" color: #409eff;\n"
"}\n"
"\n"
"QPushButton:pressed, QPushButton:checked {\n"
" border: 1px solid #3a8ee6;\n"
" color: #409eff;\n"
"}")
self.choice_Chips_Button.setObjectName("choice_Chips_Button")
self.scrollArea.setWidget(self.scrollAreaWidgetContents_2)
self.functionALL_tabWidget.addTab(self.Charts_tab, "")
self.orderList_scrollArea = QtWidgets.QScrollArea(parent=Form)
Expand Down Expand Up @@ -672,6 +690,7 @@ def retranslateUi(self, Form):
self.Chips_Button.setText(_translate("Form", "芯片获得途径一览"))
self.ItemsEX_Button.setText(_translate("Form", "养成材料掉率一览"))
self.growthItems_Button.setText(_translate("Form", "角色养成材料一览"))
self.choice_Chips_Button.setText(_translate("Form", "自选箱芯片一览"))
self.functionALL_tabWidget.setTabText(self.functionALL_tabWidget.indexOf(self.Charts_tab), _translate("Form", "图表"))
self.order_exp1012w_checkBox.setText(_translate("Form", "10换12w经验"))
self.order_coin1012w_checkBox.setText(_translate("Form", "10换12w星币"))
Expand Down
12 changes: 9 additions & 3 deletions jczx.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class _Chart:
GrowthItems = joinPath("resources","toolChart","养成材料一览.png")
ItemsEX = joinPath("resources","toolChart","材料掉率一图流.jpg")
Chips = joinPath("resources","toolChart","芯片获得途径.jpg")
ChoiceChips = joinPath("resources","toolChart","自选芯片.jpg")

Chart = _Chart()

Expand Down Expand Up @@ -160,6 +161,7 @@ def __init_buttom(self):
self.growthItems_Button.clicked.connect(lambda: startfile(self.Chart.GrowthItems))
self.ItemsEX_Button.clicked.connect(lambda: startfile(self.Chart.ItemsEX))
self.Chips_Button.clicked.connect(lambda: startfile(self.Chart.Chips))
self.choice_Chips_Button.clicked.connect(lambda: startfile(self.Chart.ChoiceChips))

self.test_button.clicked.connect(self.__debug)

Expand Down Expand Up @@ -395,7 +397,7 @@ class _Buttons:
activities_button = joinPath("resources","buttons","activities.png")
apply_button = joinPath("resources","buttons","apply.png")
accept_button = joinPath("resources","buttons","accept.png")
cannotSubmit_button = joinPath("resources","buttons","cannotSubmit.png")
submit_button = joinPath("resources","buttons","submit.png")
getItem_button = joinPath("resources","buttons","getItem.png")
closeNotice_button = joinPath("resources","buttons","closeNotice.png")
noReminders_button = joinPath("resources","buttons","noReminders.png")
Expand Down Expand Up @@ -482,14 +484,15 @@ def getUserOrderPaths(self) -> list[tuple[str, _Orders.Description, _Orders.Craf
class _ScreenLocs:
friend = joinPath("resources","locations","friend.png")
levels = joinPath("resources","locations","levels.png")
notEnough = joinPath("resources","locations","notEnough.png")
whateverTradingPost = joinPath("resources","locations","whateverTradingPost.png")
illusionAward = joinPath("resources","locations","illusionAward.png")
emptyPlace2x2 = joinPath("resources","locations","emptyPlace2x2.png")
helpFriend = joinPath("resources","locations","helpFriend.png")
sureEnter = joinPath("resources","buttons","sureEnter.png")
illusions = joinPath("resources","locations","illusions.png")
activities = joinPath("resources","locations","activities.png")
notEnough = joinPath("resources","locations","notEnough.png")
notEnoughAsk = joinPath("resources","locations","notEnoughAsk.png")
tabBar = joinPath("resources","locations","tabBar.png")
getItem= joinPath("resources","buttons","getItem.png")
home = joinPath("resources","buttons","friends.png")
Expand Down Expand Up @@ -777,8 +780,9 @@ def __checkOrders(self, cutPoints = None):
x, y = locality
x0, y0 = x-w//2, y+h//2
x1, y1 = x+w//2, y+h//2+h
if self.findImageCenterLocation(self.Buttons.cannotSubmit_button, ((x0, y0), (x1, y1)), per = 0.95):
if self.findImageCenterLocation(self.ScreenLocs.notEnough, ((x0, y0), (x1, y1)), 0.8):
if not craft:
self.log.info("当前订单材料不足")
# self._clickAndMsg(self.Buttons.cancel_button, wait = 0.3, cutPoints = self.ScreenCut.cut4x2(1, 1))
continue
self.click(*locality, 0.3)
Expand Down Expand Up @@ -1024,6 +1028,8 @@ def findImageCenterLocations(self, button_path:str, cutPoints:tuple[tuple[int, i
else:
x0, y0 = 0, 0
screenshot_gray = self.grayScreenshot(cutPoints)
# cv2.imshow("1", screenshot_gray)
# cv2.waitKey()
template_gray = cv2.imread(button_path, cv2.IMREAD_GRAYSCALE)
matcher = cv2.matchTemplate(screenshot_gray, template_gray, cv2.TM_CCOEFF_NORMED)
locations = np.where(matcher > per)
Expand Down
Binary file removed resources/buttons/cannotSubmit.png
Binary file not shown.
Binary file added resources/buttons/submit.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 modified resources/locations/notEnough.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 resources/locations/notEnoughAsk.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 resources/toolChart/自选芯片.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c13d98d

Please sign in to comment.