Skip to content

Commit 9f5da9b

Browse files
authored
fix(js): 修复有几率误判处于大厅 (#2769)
1 parent 4d7b80f commit 9f5da9b

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed
4.39 KB
Loading

repo/js/MiliastraExperiencePlayback/libs/constants/regions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ const clickToContinue = () => {
4141
const findUidText = () => {
4242
return findTextWithinBounds("UID", 1620, 1050, 300, 30, { contains: true });
4343
};
44+
//! 查找派蒙图标(判断处于奇域大世界/大厅)
45+
const findPaimon = () => {
46+
const iro = findImageWithinBounds("assets/UI_Icon_Paimon.png", 0, 0, 100, 100, {
47+
useMask: true,
48+
threshold: 0.8,
49+
});
50+
iro?.drawSelf("group_img");
51+
return iro;
52+
};
4453
//! 查找元素视野按钮(判断处于大世界)
4554
const findElementViewBtn = () => {
4655
const iro = findImageWithinBounds("assets/UI_BtnIcon_ElementView.png", 0, 0, 500, 80, {
@@ -244,6 +253,7 @@ export {
244253
findHeaderTitle,
245254
findLeaveRoomBtn,
246255
findManageStagesBtn,
256+
findPaimon,
247257
findPrepareMsg,
248258
findSaveToDeletePos,
249259
findSearchWonderlandBtn,

repo/js/MiliastraExperiencePlayback/libs/modules/lobby.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import {
77
findElementViewBtn,
88
findGotTeyvatBtn,
99
findHeaderTitle,
10+
findPaimon,
1011
} from "../constants/regions.js";
1112

1213
//#region src/modules/lobby.ts
1314
//! 判断是否处于奇域大厅
14-
const isInLobby = () => findBeyondHallBtn() !== void 0;
15+
const isInLobby = () => findPaimon() !== void 0 && findBeyondHallBtn() !== void 0;
1516
//! 判断是否处于提瓦特大陆
16-
const isInTeyvat = () => findElementViewBtn() !== void 0;
17+
const isInTeyvat = () => findPaimon() !== void 0 && findElementViewBtn() !== void 0;
1718
//! 退出大厅返回提瓦特大陆
1819
const exitLobbyToTeyvat = async () => {
1920
if (!userConfig.goToTeyvat) return;

repo/js/MiliastraExperiencePlayback/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 1,
33
"name": "千星奇域·每周经验刷取(回放通关版)",
4-
"version": "0.1.11",
4+
"version": "0.1.12",
55
"bgi_version": "0.54.0",
66
"description": "千星奇域·每周经验刷取(回放通关版)",
77
"authors": [

0 commit comments

Comments
 (0)