Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Gear Code based fast equipment exchange for GemsFarming #3491

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

guoh064
Copy link
Contributor

@guoh064 guoh064 commented Feb 13, 2024

Closes #3243

@guoh064 guoh064 marked this pull request as ready for review February 16, 2024 07:48
@guoh064 guoh064 force-pushed the gems_farming_gearcode branch 4 times, most recently from b2c1582 to 3c6603e Compare February 29, 2024 04:46
@GodofTheFallen
Copy link

目前已适配:

  • CN
  • EN
  • JP
  • TW

Copy link
Owner

@LmeSzinc LmeSzinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议提取到当前装备码之后,写入到GemsFarming_EquipmentCode的对应字段里,供下次使用
所以实际功能的描述是:根据装备码换装备,未设置装备码时,提取当前装备码

assets/cn/equipment/EQUIPMENT_CODE_PAGE_CHECK.png Outdated Show resolved Hide resolved
module/equipment/equipment_code.py Outdated Show resolved Hide resolved
module/campaign/gems_farming.py Outdated Show resolved Hide resolved
module/equipment/equipment_code.py Outdated Show resolved Hide resolved
module/equipment/equipment_code.py Outdated Show resolved Hide resolved
@LmeSzinc LmeSzinc added the feature request / 功能请求 New feature or requests label Mar 20, 2024
@Air111
Copy link
Contributor

Air111 commented Apr 3, 2024

我在bluestacks 5.13.200.1028 P64上测试发现u2.send_actionu2.send_keys(与FastInputIME有关的)均无效,研究了一整天的结果是,必须在bluestacks选择输入法设置中选择“启动屏幕键盘”(默认是“启用物理键盘”)

此外,可以使用u2(focused=True, className="android.widget.EditText").set_text()(其中selector二选一即可)进行文本输入,但也许需要测试其他模拟器。可以使用u2.clipboard获取剪贴板内容,进而实现粘贴。

如果用adb的话,可以使用input text来输入装备码。可以使用如下方式来“清空”

adb shell input keyevent 123 # KEYCODE_MOVE_END
adb shell input keyevent 67 67 67 ... # KEYCODE_DEL

而关闭输入框我试下来目前只有u2.send_action这一种比较“优雅”的办法,但我觉得点击屏幕顶部中间区域(例如(640, 20)附近)是一个可以被接受的方法,因为装备码界面中间都是不可点击的。

因此adb的缺点是:

  • 暂未发现优雅的方式进行clear_text(如果有人了解select all的方法,或者通过send event区分按键的按下和抬起等方式实现ctrl+a组合键,请告诉我),但我觉得没必要,每次进入装备码页面都是清空状态。
  • 暂未发现优雅的方式关闭输入框

u2的缺点是:

  • 可能需要修改模拟器设置
  • 如果不使用FastInputIME,使用UiObject.set_text(),则一样暂未发现优雅的方式关闭输入框

我个人的倾向是放弃u2,使用纯adb+点击关闭输入框的方式。有没有哪个模拟器默认弹出一个全屏的输入框?

脑子有点乱,编辑了好多次,不好意思

@Air111
Copy link
Contributor

Air111 commented Apr 4, 2024

我这边发现关闭FastInputIME后(IME变成“Android 键盘(AOSP)”)回车可以关闭输入框,不知道其他模拟器如何

u2.set_fastinput_ime(True)


屏幕截图 2024-04-04 145651

u2.set_fastinput_ime(False)

屏幕截图 2024-04-04 145637

u2:

u2.press('enter')

adb:

adb shell input keyevent KEYCODE_ENTER

@guoh064

This comment was marked as outdated.

@Air111
Copy link
Contributor

Air111 commented Apr 4, 2024

我本来就是想帮忙改改的(急急急我要刷b1b3),测试中发现了这个问题,感觉似乎没有完美的方案,都有一些取舍,所以先来问问

如果能通过拼凑得到一套兼容性强的方案,也不是非要提供纯adb和纯u2两种操控方案

@guoh064
Copy link
Contributor Author

guoh064 commented Apr 17, 2024

1a60ce9 重做了equipment_code.py、input.py和相关接口,主要改变如下:

  • 重构EquipmentCode类,只进行config的导入、修改、导出这三个功能;
  • 新建EquipmentCodeHandler类,为StorageHandler子类,包括在装备码界面的各种操作,目标是接替已有的EquipmentChange类完成装备替换。
    与此对应地,在gems_farming.py中:
  • 新建GemsEquipCodeHandler类,为EquipmentCodeHandler子类,指定了对应的更换船只和装备码设置位置。
  • 删除了原来使用的EquipmentChange类,并删除相关函数调用。

另外,在确认功能性没有问题后,后期计划将分支rebase到最新dev分支(或者dev分支merge到当前分支),以解决目前的合并冲突问题(需要 @LmeSzinc 的确认)

@guoh064 guoh064 requested a review from LmeSzinc April 17, 2024 00:24
module/equipment/equipment_code.py Outdated Show resolved Hide resolved
module/equipment/equipment_code.py Outdated Show resolved Hide resolved
@guoh064

This comment was marked as outdated.

@guoh064 guoh064 marked this pull request as ready for review September 14, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request / 功能请求 New feature or requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants