Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
[fix] fight: Delegate OK button judgement logic from tw/jp server for cn
Browse files Browse the repository at this point in the history
  • Loading branch information
kmou424 committed May 5, 2022
1 parent b04b470 commit 86ea567
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ class CheckTemplate:
RESULT_OFFLINE_EXIT_ROOM_BUTTON = Template(
'Result_bottom_offline_exit_room_button',
{
'cn': None,
'tw': Rect(Point(248, 1174), Point(471, 1232))
'cn': Rect(Point(249, 1175), Point(471, 1233)),
'tw': Rect(Point(249, 1175), Point(471, 1233))
}
)

Expand Down
7 changes: 3 additions & 4 deletions modules/trackers/fight.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ def track(mArgs: Args, task: Task):
# 结算
if task == Task.GO_FIGHT_RESULT:
# 台服设定,掉线后结算时的两个按钮会变成一个按钮,所以特判一下
if mArgs.GameServer == 'tw':
if Checker.checkImageWithTemplate(mArgs, CheckTemplate.RESULT_OFFLINE_EXIT_ROOM_BUTTON):
mArgs.adb.random_click(CheckTemplate.RESULT_OFFLINE_EXIT_ROOM_BUTTON.getRect(mArgs.GameServer))
return Task.GO_FIGHT_END_FAST_JUMP
if Checker.checkImageWithTemplate(mArgs, CheckTemplate.RESULT_OFFLINE_EXIT_ROOM_BUTTON):
mArgs.adb.random_click(CheckTemplate.RESULT_OFFLINE_EXIT_ROOM_BUTTON.getRect(mArgs.GameServer))
return Task.GO_FIGHT_END_FAST_JUMP
# TODO: 提供离开房间和返回房间两种不同的选项
if Checker.checkImageWithTemplate(mArgs, CheckTemplate.RESULT_BOTTOM_EXIT_ROOM_BUTTON) or \
Checker.checkImageWithTemplate(mArgs, CheckTemplate.RESULT_BOTTOM_DISBAND_ROOM_BUTTON):
Expand Down
2 changes: 1 addition & 1 deletion wfhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@ def saveAllData():


if __name__ == "__main__":
app.run(debug=cfgMan.checkoutSection('Debug').getBoolean('enabled'), host='0.0.0.0', port=int(sys.argv[1]))
app.run(debug=cfgMan.checkoutSection('Debug').getBoolean('enabled'), host='0.0.0.0', port=int(sys.argv[1]))

0 comments on commit 86ea567

Please sign in to comment.