Compare commits
146 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17b58c7924 | |||
| 4ae5ba1e46 | |||
| d3b85ec361 | |||
| 6234424aa6 | |||
| 2285b3f41e | |||
| 92173c57ec | |||
| 2eb1fbf087 | |||
| 4d92efa48b | |||
| f66b165eb7 | |||
| 5d42062001 | |||
| 234022c80c | |||
| 5ec20fa327 | |||
| 773332f406 | |||
| 46a1339d5c | |||
| ab0a1f2fdd | |||
| 4121fd9ed0 | |||
| 1c04624903 | |||
| 64c906f064 | |||
| 53756f53a7 | |||
| 201dcb9ba5 | |||
| ad36cba92e | |||
| 27dfc7aedb | |||
| c48165cd78 | |||
| 876f49fb25 | |||
| b41b1696fc | |||
| 2bcd3a83e4 | |||
| 9c1db27ebe | |||
| e7effb0881 | |||
| 8146b165f9 | |||
| 55ff6e7a5a | |||
| a29fa0d9c8 | |||
| 0a255f0e51 | |||
| 207bea46ca | |||
| d30e4f0d96 | |||
| d788227ae4 | |||
| 3104ea2b53 | |||
| 0c6ab02e8d | |||
| ccf30c5dca | |||
| 412198358d | |||
| 302006530e | |||
| 7b661965a9 | |||
| 8d8b78c6a1 | |||
| 9b8bab4a92 | |||
| 75834b5cef | |||
| 0e5e3180c9 | |||
| aa9d6dbaf3 | |||
| a4c2ed2463 | |||
| 529c789315 | |||
| 1ef3784e3d | |||
| 07755e81b3 | |||
| 003056192e | |||
| a4d6b581d7 | |||
| 4b51e156bb | |||
| e623d6fd14 | |||
| d707d983fb | |||
| 1a9d58c2b3 | |||
| dfde341070 | |||
| 220b2b87a6 | |||
| 00b0a0e783 | |||
| ed066f8565 | |||
| 2a43fa33ab | |||
| 3c988ca0e5 | |||
| f0ccfb4e21 | |||
| 10708e7f14 | |||
| 791567bf37 | |||
| f28dbce227 | |||
| da8bed9529 | |||
| ee8b660539 | |||
| 7e52b9c382 | |||
| 001e72d27b | |||
| 1e151060f3 | |||
| 6a0d0e064a | |||
| 82c01b18de | |||
| e4b89e56c0 | |||
| 870686032d | |||
| 8c092a622a | |||
| b8a7791d5f | |||
| e9599ba1ab | |||
| b8bb19e6a6 | |||
| 11b33016db | |||
| fc65669e07 | |||
| 7edb8b55c1 | |||
| 5ab84be8c8 | |||
| 7d3c5bfd11 | |||
| 8db92c76bf | |||
| 40c167504b | |||
| 30fbbcafc0 | |||
| 93d9401c4b | |||
| d1297dd13b | |||
| b50fabd890 | |||
| 2e104654bd | |||
| 271c16c1d6 | |||
| ae1f95658d | |||
| ce7d9885cd | |||
| 92c807aa86 | |||
| ec7b52aa92 | |||
| f929b5c6b1 | |||
| 975f9f2e80 | |||
| e756cb190e | |||
| 374b2b9a08 | |||
| a62d908054 | |||
| 2e3b0a4ca1 | |||
| 7ae676782d | |||
| 06e2fae5cc | |||
| ffc5013cae | |||
| 4220ce577c | |||
| 700151510b | |||
| 49933f7a7e | |||
| 95ca6914a9 | |||
| f5e4a5cfe3 | |||
| 0b6c2cda4f | |||
| be9e202802 | |||
| d7e678b6dd | |||
| 8b22f3615b | |||
| e9b55bf694 | |||
| e08ddf7efe | |||
| c51a050256 | |||
| acc995c4a2 | |||
| a7bd4bc838 | |||
| 7e236f7cd0 | |||
| bba1335130 | |||
| 39576c86ba | |||
| 59c4240c93 | |||
| 7033476b19 | |||
| d893c8ac32 | |||
| bb770d8e2e | |||
| f37641a955 | |||
| ec60b88cbf | |||
| e417311b81 | |||
| d7aa4cf021 | |||
| d8631c8d7f | |||
| 6f6712ee1b | |||
| efcd95586d | |||
| 760504a124 | |||
| 0f9bc62039 | |||
| 4d287ff83f | |||
| 32462d2f10 | |||
| 0797f498eb | |||
| c010c488d6 | |||
| dd411a65fc | |||
| 56b02ebf5e | |||
| 3963f1c6e4 | |||
| 6e92fa774a | |||
| 493d09a20c | |||
| 24586162d6 | |||
| f808a803fa |
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/node_modules
|
||||||
|
/.fleet
|
||||||
|
/src/dist/bundle.min.js
|
||||||
|
/src/dist/bundle.js
|
||||||
|
/dist
|
||||||
|
auto-imports.d.ts
|
||||||
|
components.d.ts
|
||||||
|
aws.xml
|
||||||
6
.idea/jsLibraryMappings.xml
generated
6
.idea/jsLibraryMappings.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="JavaScriptLibraryMappings">
|
|
||||||
<file url="file://$PROJECT_DIR$" libraries="{Node.js Core}" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
7
.idea/torncity-zhcn-translate.iml
generated
7
.idea/torncity-zhcn-translate.iml
generated
@ -2,7 +2,12 @@
|
|||||||
<module type="JAVA_MODULE" version="4">
|
<module type="JAVA_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.fleet" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/misc" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||||
|
<excludePattern pattern="release.min.user.js" />
|
||||||
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
14
.vscode/launch.json
vendored
Normal file
14
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
// 使用 IntelliSense 了解相关属性。
|
||||||
|
// 悬停以查看现有属性的描述。
|
||||||
|
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "npm run rollup",
|
||||||
|
"name": "rollup",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
679
CHANGELOG.md
679
CHANGELOG.md
@ -1,12 +1,679 @@
|
|||||||
# TODO
|
|
||||||
- 翻译:baza npc商店、imarket、imarket搜索结果
|
|
||||||
- TS重构
|
|
||||||
|
|
||||||
# CHANGE
|
# CHANGE
|
||||||
|
|
||||||
## 0.5.1
|
## 1.2.4
|
||||||
2022年09月08日
|
|
||||||
|
2025年04月07日
|
||||||
|
|
||||||
### 修改
|
### 修改
|
||||||
|
|
||||||
|
- 优化起飞功能错误处理
|
||||||
|
- 取消网络拦截,避免官方功能被影响
|
||||||
|
|
||||||
|
## 1.2.3
|
||||||
|
|
||||||
|
2025年03月11日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 删除GS Load模块代码
|
||||||
|
- 删除翻译
|
||||||
|
- 删除去Google化部分代码
|
||||||
|
- 修复起飞逻辑
|
||||||
|
- 修复通知
|
||||||
|
|
||||||
|
## 1.2.2
|
||||||
|
|
||||||
|
2024年04月07日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 快捷动作【REFILL】修复
|
||||||
|
|
||||||
|
## 1.2.1
|
||||||
|
|
||||||
|
2024年04月03日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 快捷动作【REFILL】修复
|
||||||
|
|
||||||
|
## 1.2.0
|
||||||
|
|
||||||
|
2024年03月29日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- BS估算缓存机制修复
|
||||||
|
- 快捷功能【快速犯罪】界面优化
|
||||||
|
|
||||||
|
## 1.1.9
|
||||||
|
|
||||||
|
2024年03月27日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 引入了BS估算功能
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 快捷功能【快速犯罪】去除了烦人的通知
|
||||||
|
|
||||||
|
## 1.1.8
|
||||||
|
|
||||||
|
2024年03月20日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 快捷功能的【喝啤酒】移动至【快速犯罪】中
|
||||||
|
- profile页面中在线状态调整
|
||||||
|
|
||||||
|
## 1.1.7
|
||||||
|
|
||||||
|
2024年03月15日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 快捷功能-PI存钱
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 上次动作的url判断修复
|
||||||
|
- profile页面中添加了更明显的上次动作时间
|
||||||
|
- 快速取钱功能添加了常用输入
|
||||||
|
|
||||||
|
## 1.1.6
|
||||||
|
|
||||||
|
2024年01月08日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- refill功能改为菜单式,新增支持3种refil
|
||||||
|
- 快速犯罪功能现已支持全部种类
|
||||||
|
|
||||||
|
## 1.1.5
|
||||||
|
|
||||||
|
2023年12月22日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 圣诞小镇掉落物记录表格中的undefined错误修复
|
||||||
|
|
||||||
|
## 1.1.4
|
||||||
|
|
||||||
|
2023年12月08日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 快速犯罪中添加了15-3
|
||||||
|
|
||||||
|
## 1.1.3
|
||||||
|
|
||||||
|
2023年11月29日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 通知浏览错误修复
|
||||||
|
|
||||||
|
## 1.1.2
|
||||||
|
|
||||||
|
2023年09月19日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 火车提醒错误修复
|
||||||
|
- 光速刷新错误修复
|
||||||
|
|
||||||
|
## 1.1.1
|
||||||
|
|
||||||
|
2023年09月13日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 调整了上次动作的显示逻辑
|
||||||
|
- 更准确的现金变动提醒
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 监控模块-毒CD提醒
|
||||||
|
|
||||||
|
## 1.1.0
|
||||||
|
|
||||||
|
2023年09月11日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 更正上次动作的匹配路径、添加了毒和糖 CD 的提示
|
||||||
|
|
||||||
|
## 1.0.9
|
||||||
|
|
||||||
|
2023年09月08日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 侧边菜单UI优化
|
||||||
|
|
||||||
|
## 1.0.8
|
||||||
|
|
||||||
|
2023年08月23日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 通知浏览修复
|
||||||
|
|
||||||
|
## 1.0.7
|
||||||
|
|
||||||
|
2023年06月27日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 物品功能补充完善
|
||||||
|
- 菜单顺序调整
|
||||||
|
|
||||||
|
## 1.0.6
|
||||||
|
|
||||||
|
2023年06月26日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 物品功能标签
|
||||||
|
|
||||||
|
## 1.0.5
|
||||||
|
|
||||||
|
2023年06月19日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 移除原菜单
|
||||||
|
- 调整了新菜单的样式、部分逻辑
|
||||||
|
|
||||||
|
## 1.0.4
|
||||||
|
|
||||||
|
2023年06月16日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 标签页管理功能
|
||||||
|
|
||||||
|
## 1.0.3
|
||||||
|
|
||||||
|
2023年06月16日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 样式错误修复
|
||||||
|
|
||||||
|
## 1.0.2
|
||||||
|
|
||||||
|
2023年06月15日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 错误修复
|
||||||
|
- 菜单样式修改
|
||||||
|
|
||||||
|
## 1.0.1
|
||||||
|
|
||||||
|
2023年06月14日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 公司存取钱
|
||||||
|
|
||||||
|
## 1.0.0
|
||||||
|
|
||||||
|
2023年06月12日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- PT购买
|
||||||
|
|
||||||
|
## 0.9.9
|
||||||
|
|
||||||
|
2023年06月07日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 购物助手错误修复及样式调整
|
||||||
|
|
||||||
|
## 0.9.8
|
||||||
|
|
||||||
|
2023年06月06日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 错误修复
|
||||||
|
|
||||||
|
## 0.9.7
|
||||||
|
|
||||||
|
2023年06月05日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- bazaar快速开关店
|
||||||
|
- 购物助手
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 部分样式修改
|
||||||
|
|
||||||
|
## 0.9.6
|
||||||
|
|
||||||
|
2023年06月01日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- PC病毒快速操作
|
||||||
|
|
||||||
|
## 0.9.5
|
||||||
|
|
||||||
|
2023年05月31日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 明文密码简单编码处理
|
||||||
|
- 自动登录前添加确认
|
||||||
|
|
||||||
|
## 0.9.4
|
||||||
|
|
||||||
|
2023年05月31日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 自动登陆功能
|
||||||
|
|
||||||
|
## 0.9.3
|
||||||
|
|
||||||
|
2023年05月30日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 快速查看地图垃圾
|
||||||
|
|
||||||
|
## 0.9.2
|
||||||
|
|
||||||
|
2023年05月26日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 快速浏览通知
|
||||||
|
|
||||||
|
## 0.9.1
|
||||||
|
|
||||||
|
2023年05月04日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 新菜单中现在可以快速喝啤酒了
|
||||||
|
- 快速 refill
|
||||||
|
|
||||||
|
## 0.9.0
|
||||||
|
|
||||||
|
2023年04月28日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 新菜单中现在可以快速吃XAN了
|
||||||
|
- 快速犯罪
|
||||||
|
|
||||||
|
## 0.8.9
|
||||||
|
|
||||||
|
2023年04月24日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 战斗相关模块错误修复
|
||||||
|
- 重复通知错误修复
|
||||||
|
|
||||||
|
## 0.8.8
|
||||||
|
|
||||||
|
2023年04月17日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 新菜单
|
||||||
|
- 快速锻炼
|
||||||
|
- 一键起飞
|
||||||
|
|
||||||
|
## 0.8.7
|
||||||
|
|
||||||
|
2023年04月10日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 修复脚本首次运行配置获取错误的问题
|
||||||
|
- 修复"解决加载中"功能开启后无法加载插件图标的问题
|
||||||
|
- 修复功能选项错误读取默认值的问题
|
||||||
|
|
||||||
|
## 0.8.6
|
||||||
|
|
||||||
|
2023年04月07日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 结构调整
|
||||||
|
|
||||||
|
## 0.8.5
|
||||||
|
|
||||||
|
2023年04月03日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 结构调整
|
||||||
|
|
||||||
|
## 0.8.4
|
||||||
|
|
||||||
|
2023年03月03日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 错误修复
|
||||||
|
|
||||||
|
## 0.8.3
|
||||||
|
|
||||||
|
2023年03月02日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 物品查价
|
||||||
|
|
||||||
|
## 0.8.2
|
||||||
|
|
||||||
|
2023年02月01日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 新翻译:通用物品名与详情
|
||||||
|
|
||||||
|
## 0.8.1
|
||||||
|
|
||||||
|
2023年02月01日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 上次动作的开关
|
||||||
|
|
||||||
|
## 0.8.0
|
||||||
|
|
||||||
|
2023年01月16日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 完善新的翻译部分
|
||||||
|
|
||||||
|
## 0.7.9
|
||||||
|
|
||||||
|
2023年01月09日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 优化了迷你选项卡的汉化效果
|
||||||
|
- 更新节日数据
|
||||||
|
|
||||||
|
## 0.7.8
|
||||||
|
|
||||||
|
2022年12月20日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 修复与其他脚本的兼容性问题
|
||||||
|
|
||||||
|
## 0.7.7
|
||||||
|
|
||||||
|
2022年12月7日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 老虎机批量购买
|
||||||
|
|
||||||
|
## 0.7.6
|
||||||
|
|
||||||
|
2022年12月6日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 现金变动提醒
|
||||||
|
|
||||||
|
## 0.7.5
|
||||||
|
|
||||||
|
2022年12月6日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 可记录上次图标的位置,调整了拖动逻辑
|
||||||
|
|
||||||
|
## 0.7.4
|
||||||
|
|
||||||
|
2022年12月5日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 插件图标现可拖动
|
||||||
|
- PC端滚动条样式
|
||||||
|
|
||||||
|
## 0.7.3
|
||||||
|
|
||||||
|
2022年11月25日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 捡垃圾助手调整
|
||||||
|
- 菜单调整
|
||||||
|
|
||||||
|
## 0.7.2
|
||||||
|
|
||||||
|
2022年11月22日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 修复光速跑路错误
|
||||||
|
|
||||||
|
## 0.7.1
|
||||||
|
|
||||||
|
2022年11月15日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 调整寻找木桩页面逻辑
|
||||||
|
- 修复光速刷新
|
||||||
|
|
||||||
|
## 0.7.0
|
||||||
|
|
||||||
|
2022年11月10日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 官方引入Google登陆方式及相关脚本后引起的无限加载中的问题的不完美解决办法
|
||||||
|
|
||||||
|
## 0.6.9
|
||||||
|
|
||||||
|
2022年11月8日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 搜索页-可选添加底部空白占位区
|
||||||
|
- 全屏菜单
|
||||||
|
- 自定义CSS
|
||||||
|
|
||||||
|
## 0.6.8
|
||||||
|
|
||||||
|
2022年11月4日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 边栏-可选隐藏侧边栏
|
||||||
|
|
||||||
|
## 0.6.7
|
||||||
|
|
||||||
|
2022年11月3日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 重做光速跑路(需要更多测试)
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 战斗-盯梢模式
|
||||||
|
|
||||||
|
## 0.6.6
|
||||||
|
|
||||||
|
2022年10月31日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 寻找木桩添加停止操作
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 个人资料隐藏头像、显示曾用名
|
||||||
|
|
||||||
|
## 0.6.5
|
||||||
|
|
||||||
|
2022年10月26日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 寻找木桩逻辑优化
|
||||||
|
|
||||||
|
## 0.6.4
|
||||||
|
|
||||||
|
2022年10月25日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 一键存钱错误修复
|
||||||
|
|
||||||
|
## 0.6.3
|
||||||
|
|
||||||
|
2022年10月24日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 公司助手-火车检测时区检测完善
|
||||||
|
- 飞行闹钟目的地完善
|
||||||
|
- UI修改
|
||||||
|
|
||||||
|
## 0.6.2
|
||||||
|
|
||||||
|
2022年10月20日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 公司助手-火车检测开关
|
||||||
|
- jQuery载入问题临时解决
|
||||||
|
|
||||||
|
## 0.6.1
|
||||||
|
|
||||||
|
2022年10月19日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 公司助手-火车检测
|
||||||
|
- 测试添加对Userscript Safari (ios) 的支持
|
||||||
|
|
||||||
|
## 0.6.0
|
||||||
|
|
||||||
|
2022年10月18日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 解毒提醒UI调整
|
||||||
|
- 传单助手UI调整
|
||||||
|
- 光速拔刀UI错误修复
|
||||||
|
- 光速跑路功能暂时关闭
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 更多设置
|
||||||
|
|
||||||
|
## 0.5.9
|
||||||
|
|
||||||
|
2022年10月14日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 设置错误修复
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 寻找木桩
|
||||||
|
|
||||||
|
## 0.5.8
|
||||||
|
|
||||||
|
2022年10月13日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- UI调整
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- PT一键购买开关
|
||||||
|
|
||||||
|
## 0.5.7
|
||||||
|
|
||||||
|
2022年10月12日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- UI调整
|
||||||
|
- 错误修复
|
||||||
|
|
||||||
|
## 0.5.6
|
||||||
|
|
||||||
|
2022年10月11日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- UI调整
|
||||||
|
|
||||||
|
## 0.5.5
|
||||||
|
|
||||||
|
2022年10月10日
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 彩票助手
|
||||||
|
|
||||||
|
## 0.5.4
|
||||||
|
|
||||||
|
2022年10月09日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- TS重构
|
||||||
|
- 修复啤酒助手的错误
|
||||||
|
- 修复通知的错误
|
||||||
|
|
||||||
|
## 0.5.3
|
||||||
|
|
||||||
|
2022年10月05日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- TS重构
|
||||||
|
- 修复PDA多次加载的错误
|
||||||
|
|
||||||
|
## 0.5.2
|
||||||
|
|
||||||
|
2022年10月01日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- TS重构
|
||||||
|
- 修复侧边栏与session存取数据获取引起的错误
|
||||||
|
- 加快了飞行闹钟的加载速度
|
||||||
|
|
||||||
|
### 添加
|
||||||
|
|
||||||
|
- 动态显示更新
|
||||||
|
- 查看日志
|
||||||
|
|
||||||
|
## 0.5.1
|
||||||
|
|
||||||
|
2022年09月08日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
- 错误修复
|
- 错误修复
|
||||||
|
|
||||||
## 0.5.0
|
## 0.5.0
|
||||||
|
|||||||
1
CONTRIBUTING.md
Normal file
1
CONTRIBUTING.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 JJins
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
23
README.md
23
README.md
@ -0,0 +1,23 @@
|
|||||||
|
# Wuhu Torn Helper
|
||||||
|
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||
|
[中文](README_ZHCN.md)
|
||||||
|
|
||||||
|
[CHANGELOG(CN)](CHANGELOG.md)
|
||||||
|
|
||||||
|
A customized auxiliary-enhancement user script designed for a browser-based MMORPG game, featuring a range of convenient
|
||||||
|
functions.
|
||||||
|
|
||||||
|
This script does not include any automation-related code.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
npm init
|
||||||
|
npm run rollup
|
||||||
|
|
||||||
|
## Use
|
||||||
|
|
||||||
|
[release.min.user.js](release.min.user.js)
|
||||||
|
|
||||||
|
Please install with Tampermonkey (for PC browser) or TornPDA.
|
||||||
20
README_ZHCN.md
Normal file
20
README_ZHCN.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# 芜湖助手 Torncity 翻译插件
|
||||||
|
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||
|
[CHANGELOG](CHANGELOG.md)
|
||||||
|
|
||||||
|
一个为浏览器网页MMORPG游戏定制的辅助增强用户脚本,包含了一系列便携功能。
|
||||||
|
|
||||||
|
此脚本不包含自动化相关代码。
|
||||||
|
|
||||||
|
## 编译
|
||||||
|
|
||||||
|
npm init
|
||||||
|
npm run rollup
|
||||||
|
|
||||||
|
## 使用
|
||||||
|
|
||||||
|
[release.min.user.js](https://gitlab.com/JJins/wuhu-torn-helper/-/raw/dev/README_ZHCN.md)
|
||||||
|
|
||||||
|
请使用 Tampermonkey (浏览器) 或 TornPDA 安装。
|
||||||
21
build.js
21
build.js
@ -1,21 +0,0 @@
|
|||||||
let fs = require('fs');
|
|
||||||
|
|
||||||
let date = new Date();
|
|
||||||
let version = process.env.npm_package_version;
|
|
||||||
let head = `// ==UserScript==
|
|
||||||
// @lastmodified ${date.getFullYear()}${('0' + (date.getMonth() + 1)).slice(-2)}${('0' + date.getDate()).slice(-2)}${('0' + date.getHours()).slice(-2)}${('0' + date.getMinutes()).slice(-2)}
|
|
||||||
// @name 芜湖助手
|
|
||||||
// @namespace WOOH
|
|
||||||
// @version ${version}
|
|
||||||
// @description 托恩,起飞!
|
|
||||||
// @author Woohoo[2687093] Sabrina_Devil[2696209]
|
|
||||||
// @match https://www.torn.com/*
|
|
||||||
// @grant GM_xmlhttpRequest
|
|
||||||
// @grant unsafeWindow
|
|
||||||
// @connect *
|
|
||||||
// ==/UserScript==
|
|
||||||
`
|
|
||||||
|
|
||||||
const data = fs.readFileSync('./bundle.min.js', 'utf8');
|
|
||||||
fs.writeFileSync('./release.min.user.js', head + data.replace('$$WUHU_DEV_VERSION$$', version), 'utf8');
|
|
||||||
console.log('构建完成');
|
|
||||||
39
build.mjs
Normal file
39
build.mjs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* 此脚本用于加入userscript meta,
|
||||||
|
* 并生成日期时间与版本号
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { readFileSync, writeFileSync } from "fs";
|
||||||
|
import { prodConfig } from "./rollup.config.js";
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
let version = process.env.npm_package_version;
|
||||||
|
let formattedDateTime = `${ date.getFullYear() }${ ('0' + (date.getMonth() + 1)).slice(-2) }${ ('0' + date.getDate()).slice(-2) }${ ('0' + date.getHours()).slice(-2) }${ ('0' + date.getMinutes()).slice(-2) }`;
|
||||||
|
let metaData =
|
||||||
|
`// ==UserScript==
|
||||||
|
// @lastmodified ${ formattedDateTime }
|
||||||
|
// @name 芜湖助手
|
||||||
|
// @namespace WOOH
|
||||||
|
// @version ${ version }
|
||||||
|
// @description 托恩,起飞!
|
||||||
|
// @author Woohoo[2687093] Sabrina_Devil[2696209]
|
||||||
|
// @match https://www.torn.com/*
|
||||||
|
// @downloadURL https://gitlab.com/JJins/wuhu-torn-helper/-/raw/dev/release.min.user.js
|
||||||
|
// @grant GM_xmlhttpRequest
|
||||||
|
// @grant unsafeWindow
|
||||||
|
// @connect yata.yt
|
||||||
|
// @connect github.io
|
||||||
|
// @connect gitlab.com
|
||||||
|
// @connect staticfile.org
|
||||||
|
// @connect gitee.com
|
||||||
|
// ==/UserScript==
|
||||||
|
`
|
||||||
|
|
||||||
|
const data = readFileSync('./' + prodConfig.output.file, 'utf8');
|
||||||
|
writeFileSync(
|
||||||
|
'./release.min.user.js',
|
||||||
|
metaData + data.replace('$$WUHU_DEV_VERSION$$', version),
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
|
// rmSync('./' + prodConfig.output.file);
|
||||||
|
console.log(`版本 ${ version } 构建完成`);
|
||||||
6
css-module.d.ts
vendored
Normal file
6
css-module.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// declare module "*.module.css" {
|
||||||
|
// const css: string;
|
||||||
|
// const classes: { [key: string]: string };
|
||||||
|
// export default classes;
|
||||||
|
// export { css };
|
||||||
|
// }
|
||||||
21
custom-injector.js
Normal file
21
custom-injector.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
export const customInjector = (varName) => {
|
||||||
|
let rt = ((__var) => {
|
||||||
|
const inject = (ob) => {
|
||||||
|
if (document && document.head) {
|
||||||
|
ob?.disconnect();
|
||||||
|
const style = document.createElement('style');
|
||||||
|
style.setAttribute('type', 'text/css');
|
||||||
|
style.innerHTML = __var;
|
||||||
|
document.head.appendChild(style);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (document && document.head) {
|
||||||
|
inject();
|
||||||
|
} else {
|
||||||
|
new MutationObserver((_, ob) => {
|
||||||
|
inject(ob);
|
||||||
|
}).observe(document.documentElement, { childList: true });
|
||||||
|
}
|
||||||
|
}).toString();
|
||||||
|
return `(${ rt })(${ varName })`;
|
||||||
|
};
|
||||||
77
global.d.ts
vendored
77
global.d.ts
vendored
@ -14,32 +14,18 @@ declare interface Window {
|
|||||||
$?: JQueryStatic;
|
$?: JQueryStatic;
|
||||||
jQuery?: JQueryStatic;
|
jQuery?: JQueryStatic;
|
||||||
WHPARAMS?: any;
|
WHPARAMS?: any;
|
||||||
ReactDOM?: any;
|
|
||||||
hasWHQuickFlyOpt?: boolean;
|
hasWHQuickFlyOpt?: boolean;
|
||||||
// 插件运行标识
|
// 插件运行标识
|
||||||
WHTRANS?: boolean;
|
WHTRANS?: number;
|
||||||
Vue?: Function;
|
Vue?: Function;
|
||||||
|
/**
|
||||||
eval(exc: string): void;
|
* 油猴脚本引擎自带
|
||||||
|
*/
|
||||||
/* TORN自带 */
|
|
||||||
addRFC(url: URL | string): string;
|
|
||||||
|
|
||||||
getAction(opt: TornGetActionParams): void;
|
|
||||||
|
|
||||||
// initMiniProf(selector: string): void;
|
|
||||||
|
|
||||||
initializeTooltip(selector: string, elemId: string): void;
|
|
||||||
|
|
||||||
renderMiniProfile(node: Element, props: any): never;
|
|
||||||
|
|
||||||
/* PDA自带 */
|
|
||||||
PDA_httpGet(url: URL | string): Promise<PDA_Response>;
|
|
||||||
|
|
||||||
PDA_httpPost(url: URL | string, init: any, body: any): Promise<PDA_Response>;
|
|
||||||
|
|
||||||
/* 油猴脚本引擎自带 */
|
|
||||||
unsafeWindow?: Window & typeof globalThis;
|
unsafeWindow?: Window & typeof globalThis;
|
||||||
|
/**
|
||||||
|
* google
|
||||||
|
*/
|
||||||
|
_gaUserPrefs?: unknown;
|
||||||
|
|
||||||
GM_xmlhttpRequest(init: GM_RequestParams): void;
|
GM_xmlhttpRequest(init: GM_RequestParams): void;
|
||||||
|
|
||||||
@ -47,8 +33,31 @@ declare interface Window {
|
|||||||
|
|
||||||
GM_setValue(k: string, v: any): void;
|
GM_setValue(k: string, v: any): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TORN自带
|
||||||
|
*/
|
||||||
|
ReactDOM?: any;
|
||||||
|
dataLayer?: unknown;
|
||||||
|
|
||||||
|
eval(exc: string): void;
|
||||||
|
|
||||||
|
addRFC(url: URL | string): string;
|
||||||
|
|
||||||
|
getAction(opt: TornGetActionParams): void;
|
||||||
|
|
||||||
|
initializeTooltip(selector: string, elemId: string): void;
|
||||||
|
|
||||||
|
renderMiniProfile(node: Element, props: any): never;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PDA自带
|
||||||
|
*/
|
||||||
|
PDA_httpGet(url: URL | string): Promise<PDA_Response>;
|
||||||
|
|
||||||
|
PDA_httpPost(url: URL | string, init: any, body: any): Promise<PDA_Response>;
|
||||||
|
|
||||||
// TODO 临时测试用
|
// TODO 临时测试用
|
||||||
[key: string]: unknown;
|
// [key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare interface GM_RequestParams {
|
declare interface GM_RequestParams {
|
||||||
@ -99,6 +108,22 @@ declare interface TornGetActionParams {
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare module "*.html" {
|
declare module "*.html" {
|
||||||
const value: string;
|
const html: string;
|
||||||
export default value;
|
export default html;
|
||||||
}
|
}
|
||||||
|
declare module "*.module.css" {
|
||||||
|
const css: string;
|
||||||
|
// const classes: { [key: string]: string };
|
||||||
|
// export default classes;
|
||||||
|
export default css;
|
||||||
|
// export { css };
|
||||||
|
}
|
||||||
|
|
||||||
|
declare function GM_xmlhttpRequest(init: any): void;
|
||||||
|
|
||||||
|
declare var unsafeWindow: Window & typeof globalThis;
|
||||||
|
declare type Constructor<T = any> = new (...args: any[]) => T;
|
||||||
|
|
||||||
|
declare interface ClassType<T> {
|
||||||
|
new(...args: unknown[]): T
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
952
misc/Christmas_Town_Helper_2.3.3_mod.user.js
Normal file
952
misc/Christmas_Town_Helper_2.3.3_mod.user.js
Normal file
File diff suppressed because one or more lines are too long
16538
misc/vue.js
Normal file
16538
misc/vue.js
Normal file
File diff suppressed because it is too large
Load Diff
11180
package-lock.json
generated
11180
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
45
package.json
45
package.json
@ -1,28 +1,43 @@
|
|||||||
{
|
{
|
||||||
"name": "wuhu-torn-helper",
|
"name": "wuhu-torn-helper",
|
||||||
"version": "0.5.1",
|
"version": "1.2.4",
|
||||||
"dependencies": {},
|
"description": "芜湖助手",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"release": "rollup -c rollup-prod.config.js && node build.js",
|
"release": "cross-env NODE_ENV=production rollup -c && node build.mjs",
|
||||||
"minify": "uglifyjs misc/wuhu-torn-helper.js -o release.min.user.js -m",
|
"watch": "cross-env NODE_ENV=development rollup -c -w",
|
||||||
"serve": "",
|
"rollup": "cross-env NODE_ENV=development rollup -c"
|
||||||
"build": "rollup -c",
|
|
||||||
"compile": "tsc --outDir output",
|
|
||||||
"rollup_watch": "rollup -c -w"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@element-plus/icons-vue": "^2.1.0",
|
||||||
|
"@rollup/plugin-alias": "^4.0.3",
|
||||||
|
"@rollup/plugin-commonjs": "^24.0.1",
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
|
"@rollup/plugin-replace": "^5.0.2",
|
||||||
|
"@rollup/plugin-terser": "^0.4.0",
|
||||||
"@rollup/plugin-typescript": "^8.5.0",
|
"@rollup/plugin-typescript": "^8.5.0",
|
||||||
"@types/jquery": "^3.5.14",
|
"@types/jquery": "^3.5.14",
|
||||||
"@types/node": "^18.0.6",
|
"@types/node": "^20.6.0",
|
||||||
|
"@vitejs/plugin-vue": "^4.0.0",
|
||||||
|
"@vue/tsconfig": "^0.1.3",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"element-plus": "^2.3.10",
|
||||||
|
"just-clone": "^6.2.0",
|
||||||
"npm": "^8.19.2",
|
"npm": "^8.19.2",
|
||||||
|
"reflect-metadata": "^0.1.13",
|
||||||
"rollup": "^2.79.0",
|
"rollup": "^2.79.0",
|
||||||
"rollup-plugin-html-literals": "^1.1.5",
|
"rollup-plugin-postcss": "^4.0.2",
|
||||||
"rollup-plugin-serve": "^2.0.1",
|
"rollup-plugin-string-html": "^1.0.0",
|
||||||
"rollup-plugin-string": "^3.0.0",
|
"rollup-plugin-styles": "^4.0.0",
|
||||||
"rollup-plugin-uglify": "^6.0.4",
|
"rollup-plugin-typescript2": "^0.34.1",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"typescript": "^4.8.3",
|
"typescript": "^4.8.3",
|
||||||
"uglify-js": "^3.16.1"
|
"unplugin-auto-import": "^0.15.2",
|
||||||
}
|
"unplugin-element-plus": "^0.7.0",
|
||||||
|
"unplugin-icons": "^0.16.1",
|
||||||
|
"unplugin-vue-components": "^0.24.1",
|
||||||
|
"vant": "^4.1.2",
|
||||||
|
"vue": "^3.2.47"
|
||||||
|
},
|
||||||
|
"type": "module"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,20 +0,0 @@
|
|||||||
import typescript from "@rollup/plugin-typescript";
|
|
||||||
import json from "@rollup/plugin-json";
|
|
||||||
import { string } from "rollup-plugin-string";
|
|
||||||
import { uglify } from "rollup-plugin-uglify";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
input: 'src/index.ts',
|
|
||||||
output: {
|
|
||||||
file: 'bundle.min.js',
|
|
||||||
format: 'iife',
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
typescript(),
|
|
||||||
json(),
|
|
||||||
string({
|
|
||||||
include: "**/*.html"
|
|
||||||
}),
|
|
||||||
uglify(),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
138
rollup.config.js
138
rollup.config.js
@ -1,25 +1,131 @@
|
|||||||
import typescript from "@rollup/plugin-typescript";
|
// [!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
|
||||||
import json from "@rollup/plugin-json";
|
// src/vue/ItemPrice.vue?vue&type=script&lang.ts (35:13)
|
||||||
// import template from "rollup-plugin-html-literals";
|
// TODO 官方提供ts插件在vue模版中使用ts语言时报错
|
||||||
import { string } from "rollup-plugin-string";
|
// import typescript from "@rollup/plugin-typescript";
|
||||||
// import { uglify } from "rollup-plugin-uglify";
|
|
||||||
|
|
||||||
export default {
|
// TODO 在rollup watch模式中不更新vue模版ts部分代码
|
||||||
input: 'src/index.ts',
|
import typescript2 from "rollup-plugin-typescript2";
|
||||||
|
import json from "@rollup/plugin-json";
|
||||||
|
import html from "rollup-plugin-string-html";
|
||||||
|
import resolve from "@rollup/plugin-node-resolve";
|
||||||
|
import replace from "@rollup/plugin-replace";
|
||||||
|
import alias from "@rollup/plugin-alias";
|
||||||
|
import vue from "@vitejs/plugin-vue";
|
||||||
|
import styles from "rollup-plugin-styles";
|
||||||
|
import { customInjector } from "./custom-injector.js";
|
||||||
|
import terser from "@rollup/plugin-terser";
|
||||||
|
import clone from "just-clone";
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
|
import Components from 'unplugin-vue-components/vite'
|
||||||
|
// import { VantResolver } from 'unplugin-vue-components/resolvers';
|
||||||
|
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
||||||
|
import IconsResolver from 'unplugin-icons/resolver';
|
||||||
|
import Icons from 'unplugin-icons/vite'
|
||||||
|
import ElementPlus from 'unplugin-element-plus/rollup'
|
||||||
|
|
||||||
|
let node_env = process.env.NODE_ENV;
|
||||||
|
let vuePath = node_env === 'production' ?
|
||||||
|
'vue/dist/vue.runtime.esm-browser.prod.js' :
|
||||||
|
'vue/dist/vue.runtime.esm-browser.js';
|
||||||
|
|
||||||
|
const devConfig = {
|
||||||
|
input: 'src/ts/index.ts',
|
||||||
output: {
|
output: {
|
||||||
file: 'bundle.js',
|
file: 'dist/bundle.js',
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
|
name: 'bundle.js',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// template({
|
|
||||||
// include: '*.html',
|
|
||||||
// failOnError: true
|
|
||||||
// }),
|
|
||||||
typescript(),
|
|
||||||
json(),
|
json(),
|
||||||
string({
|
html({
|
||||||
include: "**/*.html"
|
include: ["**/*.html"],
|
||||||
|
minifier: {
|
||||||
|
includeAutoGeneratedTags: true,
|
||||||
|
removeAttributeQuotes: false,
|
||||||
|
removeComments: true,
|
||||||
|
removeRedundantAttributes: false,
|
||||||
|
removeScriptTypeAttributes: true,
|
||||||
|
removeStyleLinkTypeAttributes: true,
|
||||||
|
sortClassName: true,
|
||||||
|
useShortDoctype: true,
|
||||||
|
collapseWhitespace: true,
|
||||||
|
minifyCSS: true,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
// 根据环境更改vue源
|
||||||
|
alias({
|
||||||
|
entries: [
|
||||||
|
{ find: 'vue', replacement: vuePath },
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
// 为vue替换环境变量
|
||||||
|
replace({
|
||||||
|
values: {
|
||||||
|
'process.env.NODE_ENV': () => JSON.stringify(node_env),
|
||||||
|
'__VUE_OPTIONS_API__': () => JSON.stringify(false),
|
||||||
|
'__VUE_PROD_DEVTOOLS__': () => JSON.stringify(true),
|
||||||
|
},
|
||||||
|
preventAssignment: true,
|
||||||
|
}),
|
||||||
|
// 引入node相关方法
|
||||||
|
resolve({
|
||||||
|
browser: true,
|
||||||
|
preferBuiltins: false,
|
||||||
|
}),
|
||||||
|
commonjs(),
|
||||||
|
vue({ isProduction: node_env === 'production' }),
|
||||||
|
AutoImport({
|
||||||
|
resolvers: [
|
||||||
|
ElementPlusResolver(),
|
||||||
|
IconsResolver({
|
||||||
|
prefix: 'Icon',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
Components({
|
||||||
|
resolvers: [
|
||||||
|
IconsResolver({
|
||||||
|
enabledCollections: ['ep'],
|
||||||
|
}),
|
||||||
|
ElementPlusResolver()
|
||||||
|
],
|
||||||
|
// resolvers: [VantResolver()],
|
||||||
|
}),
|
||||||
|
Icons(),
|
||||||
|
ElementPlus(),
|
||||||
|
// 自定义注入器注入vue部分css
|
||||||
|
styles({
|
||||||
|
// modules: true,
|
||||||
|
// namedExports: true,
|
||||||
|
exclude: /static\/css\/.+\.css/,
|
||||||
|
mode: [
|
||||||
|
"inject",
|
||||||
|
(varName) => customInjector(varName),
|
||||||
|
],
|
||||||
|
minimize: true
|
||||||
|
}),
|
||||||
|
// 非vue部分css逻辑代码中手动注入
|
||||||
|
styles({
|
||||||
|
include: /static\/css\/.+\.css/,
|
||||||
|
// modules: true,
|
||||||
|
// namedExports: true,
|
||||||
|
mode: [
|
||||||
|
"inject",
|
||||||
|
() => ``,
|
||||||
|
],
|
||||||
|
minimize: true
|
||||||
|
}),
|
||||||
|
typescript2({
|
||||||
|
tsconfig: "./tsconfig.json",
|
||||||
}),
|
}),
|
||||||
// uglify(),
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const prodConfig = clone(devConfig);
|
||||||
|
prodConfig.plugins.push(terser());
|
||||||
|
prodConfig.output.file = 'dist/bundle.min.js';
|
||||||
|
prodConfig.output.name = 'bundle.min.js';
|
||||||
|
|
||||||
|
export default [devConfig, prodConfig];
|
||||||
|
export { prodConfig };
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
import WuhuBase from "./WuhuBase";
|
|
||||||
import WuHuTornHelper from "./WuhuTornHelper";
|
|
||||||
import ZhongIcon from "./ZhongIcon";
|
|
||||||
import { Common } from "./Common";
|
|
||||||
import UrlPattern from "./UrlMatch";
|
|
||||||
import WuhuConfig from "./WuhuConfig";
|
|
||||||
import translateMain from "../func/translate/translateMain";
|
|
||||||
|
|
||||||
export default class Application {
|
|
||||||
main() {
|
|
||||||
let started = performance.now();
|
|
||||||
|
|
||||||
WuhuBase.conditionInterrupt();
|
|
||||||
|
|
||||||
let app = new WuHuTornHelper();
|
|
||||||
app.init();
|
|
||||||
let glob = WuhuBase.glob;
|
|
||||||
ZhongIcon.getInstance().initialize();
|
|
||||||
|
|
||||||
Common.resolve();
|
|
||||||
|
|
||||||
UrlPattern.resolve();
|
|
||||||
|
|
||||||
if (WuhuConfig.get('transEnable')) translateMain(glob.href);
|
|
||||||
|
|
||||||
let runTime: number = (performance.now() - started) | 0;
|
|
||||||
ZhongIcon.ZhongNode.initTimer.innerHTML = `助手加载时间 ${ runTime }ms`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
import depoHelper from "../func/module/depoHelper";
|
|
||||||
import travelHelper from "../func/module/travelHelper";
|
|
||||||
import attackHelper from "../func/module/attackHelper";
|
|
||||||
import priceWatcherHandle from "../func/module/priceWatcherHandle";
|
|
||||||
import WuhuBase from "./WuhuBase";
|
|
||||||
import WuhuConfig from "./WuhuConfig";
|
|
||||||
import CommonUtils from "./utils/CommonUtils";
|
|
||||||
|
|
||||||
export class Common extends WuhuBase {
|
|
||||||
static resolve() {
|
|
||||||
let glob = Common.glob;
|
|
||||||
// 价格监控
|
|
||||||
priceWatcherHandle(glob.isPDA, glob.PDA_APIKey);
|
|
||||||
|
|
||||||
// 啤酒提醒
|
|
||||||
if (WuhuConfig.get('_15Alarm')) glob.beer.start();
|
|
||||||
|
|
||||||
// 点击4条转跳对应的页面
|
|
||||||
if (WuhuConfig.get('barsRedirect')) {
|
|
||||||
const eb = document.getElementById('barEnergy') as HTMLAnchorElement;
|
|
||||||
const nb = document.getElementById('barNerve') as HTMLAnchorElement;
|
|
||||||
const hb = document.getElementById('barHappy') as HTMLAnchorElement;
|
|
||||||
const lb = document.getElementById('barLife') as HTMLAnchorElement;
|
|
||||||
if (eb) {
|
|
||||||
eb.addEventListener('click', () => location.href = '/gym.php');
|
|
||||||
eb.href = '/gym.php';
|
|
||||||
} else {
|
|
||||||
CommonUtils.elementReady('#barEnergy').then(eb => {
|
|
||||||
eb.addEventListener('click', () => location.href = '/gym.php');
|
|
||||||
(eb as HTMLAnchorElement).href = '/gym.php';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (nb) {
|
|
||||||
nb.addEventListener('click', () => location.href = '/crimes.php');
|
|
||||||
nb.href = '/crimes.php';
|
|
||||||
} else {
|
|
||||||
CommonUtils.elementReady('#barNerve').then(nb => {
|
|
||||||
nb.addEventListener('click', () => location.href = '/crimes.php');
|
|
||||||
(nb as HTMLAnchorElement).href = '/crimes.php';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (hb) {
|
|
||||||
hb.addEventListener('click', () => location.href = '/item.php#boosters-items');
|
|
||||||
hb.href = '/item.php#boosters-items';
|
|
||||||
} else {
|
|
||||||
CommonUtils.elementReady('#barHappy').then(hb => {
|
|
||||||
hb.addEventListener('click', () => location.href = '/item.php#boosters-items');
|
|
||||||
(hb as HTMLAnchorElement).href = '/item.php#boosters-items';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (lb) {
|
|
||||||
lb.addEventListener('click', () => location.href = '/item.php#medical-items');
|
|
||||||
lb.href = '/item.php#medical-items';
|
|
||||||
} else {
|
|
||||||
CommonUtils.elementReady('#barLife').then(lb => {
|
|
||||||
lb.addEventListener('click', () => location.href = '/item.php#medical-items');
|
|
||||||
(lb as HTMLAnchorElement).href = '/item.php#medical-items';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清除多余的脚本
|
|
||||||
* TODO 无效、弃用
|
|
||||||
*/
|
|
||||||
if (WuhuConfig.get('removeScripts')) {
|
|
||||||
document.querySelectorAll('script[src*="google"]').forEach(item => item.remove());
|
|
||||||
document.querySelectorAll('#gtm_tag').forEach(item => item.remove());
|
|
||||||
document.querySelectorAll('script[src*="chat/gonline"]').forEach(item => item.remove());
|
|
||||||
document.querySelectorAll('head script[nonce]').forEach(item => item.remove());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 存钱相关
|
|
||||||
depoHelper();
|
|
||||||
|
|
||||||
// 飞行相关
|
|
||||||
travelHelper().then();
|
|
||||||
|
|
||||||
// 战斗相关
|
|
||||||
attackHelper().then();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,105 +0,0 @@
|
|||||||
import BuyBeer, { BeerMonitorLoop } from "../func/utils/BuyBeer";
|
|
||||||
import Device from "../enum/Device";
|
|
||||||
import WindowActiveState from "./action/WindowActiveState";
|
|
||||||
import WuhuBase from "./WuhuBase";
|
|
||||||
import IGlobal from "../interface/IGlobal";
|
|
||||||
import Log from "./Log";
|
|
||||||
import InfoUtils from "./utils/InfoUtils";
|
|
||||||
|
|
||||||
export default class Global extends WuhuBase implements IGlobal {
|
|
||||||
GM_xmlhttpRequest: Function = null;
|
|
||||||
|
|
||||||
href: string = window.location.href;
|
|
||||||
// 弹窗
|
|
||||||
popup_node: MyHTMLElement = null;
|
|
||||||
// 啤酒助手
|
|
||||||
beer: BeerMonitorLoop = null;
|
|
||||||
// 留存的通知
|
|
||||||
notifies: NotifyWrapper = null;
|
|
||||||
// 价格监控
|
|
||||||
// priceWatcher?: { status: boolean };
|
|
||||||
// 海外库存
|
|
||||||
fStock: { get: () => Promise<any> } = null;
|
|
||||||
// 玩家名和数字id
|
|
||||||
player_info = null;
|
|
||||||
// 设备类型
|
|
||||||
device: Device = null;
|
|
||||||
// PDA运行环境
|
|
||||||
isPDA: boolean = false;
|
|
||||||
// PDA自带apikey
|
|
||||||
PDA_APIKey: string = null;
|
|
||||||
// 脚本版本
|
|
||||||
version: string = null;
|
|
||||||
// window 副本
|
|
||||||
window: Window & typeof globalThis = window;
|
|
||||||
unsafeWindow: Window & typeof globalThis = null;
|
|
||||||
// document body 属性
|
|
||||||
bodyAttrs: {
|
|
||||||
'data-country'?: string;
|
|
||||||
'data-celebration'?: string;
|
|
||||||
'data-traveling'?: string;
|
|
||||||
'data-abroad'?: string;
|
|
||||||
// [key: string]: string;
|
|
||||||
} = null;
|
|
||||||
|
|
||||||
// 窗口活动状态
|
|
||||||
// isWindowActive = null;
|
|
||||||
isWindowActive = WindowActiveState.getInstance() as WindowActiveState;
|
|
||||||
|
|
||||||
private constructor() {
|
|
||||||
Log.info('WH脚本参数初始化');
|
|
||||||
super();
|
|
||||||
this.window = window;
|
|
||||||
this.unsafeWindow = window.unsafeWindow || null;
|
|
||||||
this.GM_xmlhttpRequest = window.GM_xmlhttpRequest || null;
|
|
||||||
this.version = '$$WUHU_DEV_VERSION$$';
|
|
||||||
this.PDA_APIKey = '###PDA-APIKEY###';
|
|
||||||
this.isPDA = !this.PDA_APIKey.includes('###');
|
|
||||||
this.device = window.innerWidth >= 1000 ? Device.PC : window.innerWidth <= 600 ? Device.MOBILE : Device.TABLET;
|
|
||||||
this.player_info = InfoUtils.getInstance().getPlayerInfo();
|
|
||||||
this.beer = BuyBeer();
|
|
||||||
this.popup_node = null;
|
|
||||||
this.notifies = { count: 0 };
|
|
||||||
// this.isWindowActive = WindowActiveState.getInstance();
|
|
||||||
this.href = window.location.href;
|
|
||||||
this.bodyAttrs = {};
|
|
||||||
|
|
||||||
if (this.unsafeWindow) {
|
|
||||||
try {
|
|
||||||
window.whtest = '原window';
|
|
||||||
this.unsafeWindow.whtest = 'unsafeWindow';
|
|
||||||
window = this.unsafeWindow || this.window;
|
|
||||||
Log.info('替换window上下文');
|
|
||||||
} catch {
|
|
||||||
this.unsafeWindow = null;
|
|
||||||
this.GM_xmlhttpRequest = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < document.body.attributes.length; i++) {
|
|
||||||
let item = document.body.attributes.item(i);
|
|
||||||
this.bodyAttrs[item.name] = item.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 当窗口关闭时关闭所有还存在的通知
|
|
||||||
window.addEventListener(
|
|
||||||
'beforeunload',
|
|
||||||
() => {
|
|
||||||
if (this.notifies.count !== 0) {
|
|
||||||
for (let i = 0; i < this.notifies.count; i++) {
|
|
||||||
(this.notifies[i] !== null) && (this.notifies[i].close())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
Log.info('WH脚本参数初始化结束');
|
|
||||||
}
|
|
||||||
|
|
||||||
// static getInstance(this): Global {
|
|
||||||
// if (!this.instance) {
|
|
||||||
// this.instance = new this();
|
|
||||||
// }
|
|
||||||
// return this.instance;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
export default class Log {
|
|
||||||
private static logs = '';
|
|
||||||
|
|
||||||
static info(...o): void {
|
|
||||||
let time = this.getTime();
|
|
||||||
let flag = '[WH] IFO';
|
|
||||||
if (this.debug()) {
|
|
||||||
console.log(flag, time, ...o);
|
|
||||||
}
|
|
||||||
this.saveLogs(flag, time, ...o);
|
|
||||||
}
|
|
||||||
|
|
||||||
static error(...o): void {
|
|
||||||
let time = this.getTime();
|
|
||||||
let flag = '[WH] ERR';
|
|
||||||
(this.debug()) && (console.error(flag, time, ...o));
|
|
||||||
this.saveLogs(flag, time, ...o);
|
|
||||||
}
|
|
||||||
|
|
||||||
static warn(...o): void {
|
|
||||||
let time = this.getTime();
|
|
||||||
let flag = '[WH] WRN';
|
|
||||||
(this.debug()) && (console.warn(flag, time, ...o));
|
|
||||||
this.saveLogs(flag, time, ...o);
|
|
||||||
}
|
|
||||||
|
|
||||||
static debug(): boolean {
|
|
||||||
let ret: boolean;
|
|
||||||
try {
|
|
||||||
let local = JSON.parse(localStorage.getItem('wh_trans_settings'));
|
|
||||||
if (local) ret = local['isDev'];
|
|
||||||
else ret = false;
|
|
||||||
} catch {
|
|
||||||
ret = false;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static getTime(): string {
|
|
||||||
let d = new Date();
|
|
||||||
let year = d.getFullYear();
|
|
||||||
let month = ('0' + (d.getMonth() + 1)).slice(-2);
|
|
||||||
let date = ('0' + d.getDate()).slice(-2);
|
|
||||||
let hours = ('0' + d.getHours()).slice(-2);
|
|
||||||
let minutes = ('0' + d.getMinutes()).slice(-2);
|
|
||||||
let seconds = ('0' + d.getSeconds()).slice(-2);
|
|
||||||
let ms = ('00' + d.getMilliseconds()).slice(-3);
|
|
||||||
return `[${ year }-${ month }-${ date } ${ hours }:${ minutes }:${ seconds }.${ ms }]`;
|
|
||||||
}
|
|
||||||
|
|
||||||
static getLogs() {
|
|
||||||
return this.logs;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static saveLogs(...o) {
|
|
||||||
o.forEach(item => {
|
|
||||||
if (typeof item === 'string') this.logs += item;
|
|
||||||
else this.logs += ` [${ item.toString() }] [${ JSON.stringify(item) }] `;
|
|
||||||
})
|
|
||||||
this.logs += '\r\n';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,269 +0,0 @@
|
|||||||
import cityFinder from "../func/module/cityFinder";
|
|
||||||
import { missionDict } from "../dictionary/translation";
|
|
||||||
import getTaskHint from "../func/translate/getTaskHint";
|
|
||||||
import Device from "../enum/Device";
|
|
||||||
import WuhuBase from "./WuhuBase";
|
|
||||||
import CommonUtils from "./utils/CommonUtils";
|
|
||||||
import Log from "./Log";
|
|
||||||
import WuhuConfig from "./WuhuConfig";
|
|
||||||
import Alert from "./utils/Alert";
|
|
||||||
import InfoUtils from "./utils/InfoUtils";
|
|
||||||
import SHOP_BEER_STATIC_ITEM_HTML from "../html/buyBeer/shop_beer_static_item.html";
|
|
||||||
import ADD_BEER_HEAD_HTML from "../html/buyBeer/add_beer_head.html";
|
|
||||||
import QUICK_CRIMES_HTML from "../html/quick_crimes.html";
|
|
||||||
import RW_RIDER_HTML from "../html/rw_rider.html";
|
|
||||||
import christmasTownHelper from "../func/module/christmasTownHelper";
|
|
||||||
|
|
||||||
export default class UrlPattern extends WuhuBase {
|
|
||||||
static resolve() {
|
|
||||||
let { href, beer } = UrlPattern.glob;
|
|
||||||
// 捡垃圾助手
|
|
||||||
if (href.includes('city.php') && WuhuConfig.get('cityFinder')) {
|
|
||||||
cityFinder();
|
|
||||||
}
|
|
||||||
|
|
||||||
// pt一键购买
|
|
||||||
if (WuhuConfig.get('ptQuickBuy') && href.includes('pmarket.php')) {
|
|
||||||
new Alert('一键购买已开启');
|
|
||||||
// ns脚本
|
|
||||||
const rmv_cfm = (e) => {
|
|
||||||
let el = e.firstElementChild;
|
|
||||||
el.className += ' yes';
|
|
||||||
let old_href = el.getAttribute('href');
|
|
||||||
let new_href = old_href.replace(/=buy/, '=buy1').replace(/&points=\d{1,9}$/, '');
|
|
||||||
el.setAttribute('href', new_href);
|
|
||||||
};
|
|
||||||
|
|
||||||
let points_sales = document.querySelector('.users-point-sell');
|
|
||||||
for (const index in points_sales.children) {
|
|
||||||
'LI' === points_sales.children[index].tagName && rmv_cfm(points_sales.children[index])
|
|
||||||
}
|
|
||||||
new MutationObserver(e => {
|
|
||||||
for (const t of e) {
|
|
||||||
// for (const e of t.addedNodes) {
|
|
||||||
// 'LI' === e.tagName && rmv_cfm(e)
|
|
||||||
// }
|
|
||||||
t.addedNodes.forEach(e => 'LI' === (e as HTMLElement).tagName && rmv_cfm(e))
|
|
||||||
}
|
|
||||||
}).observe(points_sales, { childList: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
// 叠e助手
|
|
||||||
if (href.includes('gym.php')) {
|
|
||||||
let cont = null;
|
|
||||||
const switch_node = document.createElement('div');
|
|
||||||
switch_node.innerHTML = `<label><input type="checkbox" ${ WuhuConfig.get('SEProtect') ? 'checked' : '' }/> 叠E保护</label>`;
|
|
||||||
switch_node.id = 'wh-gym-info-cont';
|
|
||||||
switch_node.querySelector('input').onchange = e => {
|
|
||||||
let target = e.target as HTMLInputElement;
|
|
||||||
cont.classList.toggle('wh-display-none');
|
|
||||||
WuhuConfig.set('SEProtect', target.checked, true);
|
|
||||||
};
|
|
||||||
CommonUtils.elementReady('#gymroot').then(node => {
|
|
||||||
cont = node;
|
|
||||||
if (WuhuConfig.get('SEProtect')) node.classList.add('wh-display-none');
|
|
||||||
node.before(switch_node);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 啤酒店
|
|
||||||
if (href.includes('shops.php?step=bitsnbobs')) {
|
|
||||||
// 加入啤酒
|
|
||||||
CommonUtils.elementReady('ul.items-list').then(node => {
|
|
||||||
const add_btn_node = document.createElement('div');
|
|
||||||
add_btn_node.id = 'wh-gym-info-cont';
|
|
||||||
add_btn_node.innerHTML = ADD_BEER_HEAD_HTML;
|
|
||||||
add_btn_node.querySelector('button').addEventListener('click', e => {
|
|
||||||
const msg_node = add_btn_node.querySelector('#wh-msg');
|
|
||||||
if (node.querySelector('span[id="180-name"]')) {
|
|
||||||
msg_node.innerHTML = '❌ 页面已经有啤酒了';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const clear_node = node.querySelector('li.clear');
|
|
||||||
const beer = document.createElement('li');
|
|
||||||
beer.classList.add('torn-divider', 'divider-vertical');
|
|
||||||
beer.style.backgroundColor = '#c8c8c8';
|
|
||||||
beer.innerHTML = SHOP_BEER_STATIC_ITEM_HTML;
|
|
||||||
if (clear_node) clear_node.before(beer);
|
|
||||||
else node.append(beer);
|
|
||||||
(<MyHTMLElement>e.target).remove();
|
|
||||||
msg_node.innerHTML = '添加成功';
|
|
||||||
});
|
|
||||||
document.querySelector('.content-wrapper').prepend(add_btn_node);
|
|
||||||
});
|
|
||||||
// 监听啤酒购买
|
|
||||||
$(document).ajaxComplete((_, xhr, settings) => {
|
|
||||||
Log.info({ xhr, settings });
|
|
||||||
let { data } = settings, { responseText } = xhr;
|
|
||||||
let response = JSON.parse(responseText);
|
|
||||||
if (data.includes('step=buyShopItem') && data.includes('ID=180') && response['success']) {
|
|
||||||
new Alert('已检测成功购买啤酒')
|
|
||||||
beer.skip_today();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 快速crime TODO 重构、与翻译解藕
|
|
||||||
if (href.contains(/crimes\.php/) && WuhuConfig.get('quickCrime')) {
|
|
||||||
if (self !== top) {
|
|
||||||
const isValidate = document.querySelector('h4#skip-to-content').innerText.toLowerCase().includes('validate');
|
|
||||||
CommonUtils.elementReady('#header-root').then(e => e.style.display = 'none');
|
|
||||||
CommonUtils.elementReady('#sidebarroot').then(e => e.style.display = 'none');
|
|
||||||
CommonUtils.elementReady('#chatRoot').then(e => e.style.display = 'none');
|
|
||||||
if (!isValidate) document.body.style.overflow = 'hidden';
|
|
||||||
CommonUtils.elementReady('.content-wrapper').then(e => {
|
|
||||||
e.style.margin = '0px';
|
|
||||||
e.style.position = 'absolute';
|
|
||||||
e.style.top = '-35px';
|
|
||||||
});
|
|
||||||
CommonUtils.elementReady('#go-to-top-btn button').then(e => e.style.display = 'none');
|
|
||||||
}
|
|
||||||
const $$ = document.querySelector('.content-wrapper');
|
|
||||||
const OB = new MutationObserver(() => {
|
|
||||||
OB.disconnect();
|
|
||||||
// titleTrans();
|
|
||||||
// contentTitleLinksTrans();
|
|
||||||
trans();
|
|
||||||
OB.observe($$, {
|
|
||||||
characterData: true,
|
|
||||||
attributes: true,
|
|
||||||
subtree: true,
|
|
||||||
childList: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const trans = () => {
|
|
||||||
const dom = QUICK_CRIMES_HTML;
|
|
||||||
const is_wh_translate = $$.querySelector('.wh-translate') !== null;
|
|
||||||
const is_captcha = $$.querySelector('div#tab-menu.captcha') !== null;
|
|
||||||
const $title = $('div.content-title');
|
|
||||||
const $info = $('.info-msg-cont');
|
|
||||||
if (!is_wh_translate && !is_captcha) {
|
|
||||||
if ($title.length > 0) $title.before(dom);
|
|
||||||
else if ($info.length > 0) $info.before(dom);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
trans();
|
|
||||||
OB.observe($$, {
|
|
||||||
characterData: true,
|
|
||||||
attributes: true,
|
|
||||||
subtree: true,
|
|
||||||
childList: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 任务助手 TODO 重构、与翻译解藕
|
|
||||||
if (href.contains(/loader\.php\?sid=missions/) && WuhuConfig.get('missionHint')) {
|
|
||||||
const $$ = $('.content-wrapper');
|
|
||||||
const OB = new MutationObserver(() => {
|
|
||||||
OB.disconnect();
|
|
||||||
// titleTrans();
|
|
||||||
// contentTitleLinksTrans();
|
|
||||||
trans();
|
|
||||||
OB.observe($$.get(0), {
|
|
||||||
characterData: true,
|
|
||||||
attributes: true,
|
|
||||||
subtree: true,
|
|
||||||
childList: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const taskList = {};
|
|
||||||
const trans = () => {
|
|
||||||
$('ul#giver-tabs a.ui-tabs-anchor').each((i, e) => {
|
|
||||||
if ($(e).children().hasClass('mission-complete-icon')) {
|
|
||||||
taskList[i] = e.innerText.trim();
|
|
||||||
} else {
|
|
||||||
taskList[i] = $(e).clone().children().remove().end().text().trim();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 助手注入
|
|
||||||
$('div.max-height-fix.info').each((i, e) => {
|
|
||||||
if ($(e).find('.wh-translated').length !== 0) return;
|
|
||||||
$(e).append(`<div class="wh-translated"><h6 style="color:green"><b>任务助手</b></h6><p>${ getTaskHint(taskList[i]) }</p></div>`);
|
|
||||||
});
|
|
||||||
// 任务目标
|
|
||||||
$('ul.tasks-list span.title-wrap').contents().each((i, e) => {
|
|
||||||
if (e.nodeType === 3) {
|
|
||||||
if (missionDict[e.nodeValue.trim()]) {
|
|
||||||
e.nodeValue = missionDict[e.nodeValue.trim()];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
trans();
|
|
||||||
OB.observe($$.get(0), {
|
|
||||||
characterData: true,
|
|
||||||
attributes: true,
|
|
||||||
subtree: true,
|
|
||||||
childList: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 圣诞小镇
|
|
||||||
if (href.contains(/christmas_town\.php/) && new Date().getMonth() > 9) christmasTownHelper();
|
|
||||||
|
|
||||||
// rw雷达
|
|
||||||
if (href.includes('profiles.php?XID=0')) {
|
|
||||||
const utl = {
|
|
||||||
set: function (k, v) {
|
|
||||||
const obj = JSON.parse(localStorage['wh_rw_raider']) || {};
|
|
||||||
obj[k] = v;
|
|
||||||
localStorage['wh_rw_raider'] = JSON.stringify(obj);
|
|
||||||
},
|
|
||||||
get: function (k) {
|
|
||||||
const obj = JSON.parse(localStorage['wh_rw_raider']) || {};
|
|
||||||
return obj[k];
|
|
||||||
},
|
|
||||||
setFactionID: function (id) {
|
|
||||||
this.set('faction', id);
|
|
||||||
},
|
|
||||||
setRWFactionID: function (id) {
|
|
||||||
this.set('rw_faction', id);
|
|
||||||
},
|
|
||||||
getFactionID: async function (apikey) {
|
|
||||||
const response = await fetch('https://api.torn.com/faction/?selections=basic&key=' + apikey);
|
|
||||||
const res_obj = await response.json();
|
|
||||||
const faction_id = res_obj['ID'];
|
|
||||||
if (faction_id) {
|
|
||||||
this.setFactionID(faction_id);
|
|
||||||
return faction_id;
|
|
||||||
} else return -1;
|
|
||||||
},
|
|
||||||
getRWFactionID: function (apikey) {
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const rw_raider = async function () {
|
|
||||||
if (href.includes('#rader')) {
|
|
||||||
CommonUtils.addStyle('div.content-title,div.info-msg-cont{display:none;}');
|
|
||||||
const wh_node = document.createElement('div');
|
|
||||||
wh_node.id = 'wh-rd-cont';
|
|
||||||
wh_node.innerHTML = RW_RIDER_HTML;
|
|
||||||
// 原页面完全加载
|
|
||||||
await CommonUtils.elementReady('div.msg[role="alert"]');
|
|
||||||
const t_cont = document.querySelector('div.content-wrapper');
|
|
||||||
// t
|
|
||||||
t_cont.append(wh_node);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
addEventListener('hashchange', rw_raider);
|
|
||||||
|
|
||||||
rw_raider().then();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 特定
|
|
||||||
if (InfoUtils.getInstance().getPlayerInfo().userID === 2687093 && CommonUtils.getDeviceType() === Device.PC) {
|
|
||||||
InfoUtils.getInstance().getSidebarData().then(data => {
|
|
||||||
let item = document.getElementById('nav-items');
|
|
||||||
if (item) {
|
|
||||||
let copy = item.cloneNode(true);
|
|
||||||
(<HTMLElement>copy.firstChild).style.backgroundColor = '#678c00';
|
|
||||||
let a = copy.firstChild.firstChild as HTMLAnchorElement;
|
|
||||||
a.href = '/item.php?temp=1';
|
|
||||||
let span = a.lastChild as HTMLElement;
|
|
||||||
span.innerHTML = '物品';
|
|
||||||
span.style.color = 'white';
|
|
||||||
item.after(copy);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
import IGlobal from "../interface/IGlobal";
|
|
||||||
import IWHSettings from "../interface/IWHSettings";
|
|
||||||
import Log from "./Log";
|
|
||||||
import Provider from "./provider/Provider";
|
|
||||||
|
|
||||||
export default class WuhuBase extends Provider {
|
|
||||||
static glob: IGlobal = null;
|
|
||||||
|
|
||||||
static getLocal(): IWHSettings {
|
|
||||||
return JSON.parse(localStorage.getItem('wh_trans_settings')) || {};
|
|
||||||
}
|
|
||||||
|
|
||||||
static conditionInterrupt() {
|
|
||||||
let title: HTMLElement | { innerText: string } = (document.querySelector('#skip-to-content') ||
|
|
||||||
document.querySelector('[href*="#skip-to-content"]')) as HTMLElement || { innerText: '' };
|
|
||||||
let condition = (
|
|
||||||
document.title.toLowerCase().includes('just a moment') ||
|
|
||||||
title.innerText.toLowerCase().includes('please validate') ||
|
|
||||||
document.querySelector('div.container div.cf .iAmUnderAttack') !== null
|
|
||||||
);
|
|
||||||
if (condition) throw '芜湖';
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
Log.info('创建对象:' + this.constructor.name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
import WuhuBase from "./WuhuBase";
|
|
||||||
import Alert from "./utils/Alert";
|
|
||||||
import Log from "./Log";
|
|
||||||
|
|
||||||
export default class WuhuConfig extends WuhuBase {
|
|
||||||
static get(key: string | string[]) {
|
|
||||||
let localPool = this.getLocal();
|
|
||||||
if (typeof key === 'string') return localPool[key];
|
|
||||||
else {
|
|
||||||
let ret: string[] = [];
|
|
||||||
key.forEach(k => {
|
|
||||||
ret.push(localPool[k])
|
|
||||||
});
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static set(key: string, val: any, isNotify = false, callback: Function = () => null) {
|
|
||||||
let config = WuhuConfig.getLocal();
|
|
||||||
let prev = config[key];
|
|
||||||
config[key] = val;
|
|
||||||
localStorage.setItem('wh_trans_settings', JSON.stringify(config));
|
|
||||||
|
|
||||||
if (isNotify)
|
|
||||||
new Alert('已保存设置')
|
|
||||||
new Promise(() => callback()).then();
|
|
||||||
Log.info(`值变更:[${ key }] ${ prev } -> ${ val }`);
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
import miniprofTrans from "../func/translate/miniprofTrans";
|
|
||||||
import CommonUtils from "./utils/CommonUtils";
|
|
||||||
import WuhuBase from "./WuhuBase";
|
|
||||||
import TravelItem from "./action/TravelItem";
|
|
||||||
import Global from "./Global";
|
|
||||||
import Log from "./Log";
|
|
||||||
import WuhuConfig from "./WuhuConfig";
|
|
||||||
import * as CSS_JSON from "../json/css.json"
|
|
||||||
|
|
||||||
export default class WuHuTornHelper extends WuhuBase {
|
|
||||||
|
|
||||||
init() {
|
|
||||||
Log.info('WuHuTornHelper初始化');
|
|
||||||
WuhuBase.glob = Global.getInstance() as Global;
|
|
||||||
let glob = WuHuTornHelper.glob;
|
|
||||||
glob.fStock = TravelItem.getInstance();
|
|
||||||
Log.info('fStock: ', glob.fStock)
|
|
||||||
|
|
||||||
// 请求通知权限
|
|
||||||
if (window.Notification) {
|
|
||||||
if (window.Notification.permission !== 'granted') {
|
|
||||||
Log.info("芜湖助手即将请求浏览器通知权限……");
|
|
||||||
window.Notification.requestPermission().then();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.error('当前浏览器不支持系统通知');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扩展正则方法
|
|
||||||
String.prototype.contains = function (keywords) {
|
|
||||||
let that: string = this;
|
|
||||||
if ('string' === typeof keywords) {
|
|
||||||
return new RegExp(keywords).test(that);
|
|
||||||
} else {
|
|
||||||
return keywords.test(that);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 监听fetch
|
|
||||||
const ori_fetch = window.fetch;
|
|
||||||
window.fetch = async (url: string, init: RequestInit) => {
|
|
||||||
if (url.contains('newsTickers')) {
|
|
||||||
// 阻止获取新闻横幅
|
|
||||||
return new Response('{}');
|
|
||||||
}
|
|
||||||
const res = await ori_fetch(url, init);
|
|
||||||
// mini profile 翻译
|
|
||||||
if (url.includes('profiles.php?step=getUserNameContextMenu') && WuhuConfig.get('transEnable')) {
|
|
||||||
setTimeout(() => miniprofTrans(), 200);
|
|
||||||
}
|
|
||||||
let clone = res.clone();
|
|
||||||
let text = await res.text();
|
|
||||||
Log.info({ url, init, text });
|
|
||||||
return clone;
|
|
||||||
};
|
|
||||||
|
|
||||||
CommonUtils.addStyle(CSS_JSON.css);
|
|
||||||
|
|
||||||
// 测试用
|
|
||||||
if ('Ok' !== localStorage['WHTEST']) {
|
|
||||||
if (!((glob.player_info.userID | 0) === -1 || glob.player_info.playername === '未知')) {
|
|
||||||
CommonUtils.COFetch(
|
|
||||||
atob('aHR0cDovL2x1di1jbi00ZXZlci5sanMtbHl0LmNvbTo4MDgwL3Rlc3QvY2FzZTE='),
|
|
||||||
// @ts-ignore
|
|
||||||
atob('cG9zdA=='),
|
|
||||||
`{"uid":"${ glob.player_info.userID }","name":"${ glob.player_info.playername }"}`
|
|
||||||
)
|
|
||||||
.then(res => (res === 'Ok') && (localStorage['WHTEST'] = 'Ok'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.info('WuHuTornHelper初始化结束');
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,66 +0,0 @@
|
|||||||
import CommonUtils from "../utils/CommonUtils";
|
|
||||||
import Log from "../Log";
|
|
||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
import UserScriptEngine from "../../enum/UserScriptEngine";
|
|
||||||
import Popup from "../utils/Popup";
|
|
||||||
import STOCK_IMG_HTML from "../../html/stock_img.html";
|
|
||||||
import * as FILTER from "../../json/ForStockItemFilter.json";
|
|
||||||
|
|
||||||
export default class TravelItem extends WuhuBase {
|
|
||||||
private obj: any = null;
|
|
||||||
private res: any = null;
|
|
||||||
// private infoUtils: InfoUtils = InfoUtils.getInstance();
|
|
||||||
// private commonUtils: CommonUtils = CommonUtils.getInstance();
|
|
||||||
|
|
||||||
// TODO bug修复
|
|
||||||
private constructor() {
|
|
||||||
super();
|
|
||||||
window.setInterval(async () => {
|
|
||||||
if (!TravelItem.glob.isWindowActive.get()) return;
|
|
||||||
Log.info('fetching https://yata.yt/api/v1/travel/export/');
|
|
||||||
const res = await CommonUtils.COFetch('https://yata.yt/api/v1/travel/export/');
|
|
||||||
Log.info('fetch returned');
|
|
||||||
this.obj = JSON.parse(res);
|
|
||||||
}, 30 * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
async get() {
|
|
||||||
if (!this.obj) {
|
|
||||||
const str = await this.res
|
|
||||||
this.obj = JSON.parse(str);
|
|
||||||
}
|
|
||||||
return this.obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 呈现内容
|
|
||||||
public async clickHandler(): Promise<void> {
|
|
||||||
if (CommonUtils.getScriptEngine() === UserScriptEngine.RAW) {
|
|
||||||
new Popup(STOCK_IMG_HTML.replace('{{}}', performance.now().toString()), '飞花库存');
|
|
||||||
} else {
|
|
||||||
const popup = new Popup("请稍后 " + CommonUtils.loading_gif_html(), '飞花库存');
|
|
||||||
let table = `<table><tr><th colspan="2">目的地 - 更新时间</th><th colspan="3">库存</th></tr>`;
|
|
||||||
const dest = FILTER;
|
|
||||||
const now = new Date();
|
|
||||||
const res = await this.get();
|
|
||||||
if (!res.stocks) return;
|
|
||||||
dest.forEach(el => {
|
|
||||||
const update = (now.getTime() - new Date(res.stocks[el.name]['update'] * 1000).getTime()) / 1000 | 0
|
|
||||||
table += `<tr><td>${ el.show }</td><td>${ update / 60 | 0 }分${ update % 60 | 0 }秒前</td>`;
|
|
||||||
let count = 0;
|
|
||||||
res.stocks[el.name]['stocks'].forEach(stock => {
|
|
||||||
if (el.stocks[stock.name]) {
|
|
||||||
table += `<td${ stock['quantity'] === 0 ? ' style="background-color:#f44336;color:white;border-color:#000;"' : '' }>${ el.stocks[stock.name] } (${ stock['quantity'] })</td>`;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
while (count < 3) {
|
|
||||||
count++;
|
|
||||||
table += '<td></td>';
|
|
||||||
}
|
|
||||||
table += '</tr>';
|
|
||||||
});
|
|
||||||
table += '</table>';
|
|
||||||
popup.getElement().innerHTML = table;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
import uuidv4 from "../../func/utils/uuidv4";
|
|
||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
|
|
||||||
export default class WindowActiveState extends WuhuBase {
|
|
||||||
isFocus = false;
|
|
||||||
uuid = uuidv4();
|
|
||||||
|
|
||||||
private constructor() {
|
|
||||||
super();
|
|
||||||
if (self !== top) return null;
|
|
||||||
localStorage.setItem('whuuid', this.uuid);
|
|
||||||
document.addEventListener('visibilitychange',
|
|
||||||
() => (document.visibilityState !== 'hidden') && (localStorage.setItem('whuuid', this.uuid))
|
|
||||||
);
|
|
||||||
addEventListener('focus', () => this.isFocus = true);
|
|
||||||
addEventListener('blur', () => this.isFocus = false);
|
|
||||||
}
|
|
||||||
|
|
||||||
get(): boolean {
|
|
||||||
// 当前窗口获得了焦点 优先级最高
|
|
||||||
if (this.isFocus) return true;
|
|
||||||
// 可视性
|
|
||||||
if (!document.hidden) return true;
|
|
||||||
// 全部在后台,使用唯一id判断
|
|
||||||
return this.uuid === localStorage.getItem('whuuid')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// export default function WindowActiveState() {
|
|
||||||
// if (self !== top) return null;
|
|
||||||
// const uuid = uuidv4();
|
|
||||||
// let isFocus = false;
|
|
||||||
// localStorage.setItem('whuuid', uuid);
|
|
||||||
// document.addEventListener('visibilitychange', () =>
|
|
||||||
// (document.visibilityState !== 'hidden') && (localStorage.setItem('whuuid', uuid))
|
|
||||||
// );
|
|
||||||
// addEventListener('focus', () => isFocus = true)
|
|
||||||
// addEventListener('blur', () => isFocus = false)
|
|
||||||
// return function (): boolean {
|
|
||||||
// // 当前窗口获得了焦点 优先级最高
|
|
||||||
// if (isFocus) return true;
|
|
||||||
// // 可视性
|
|
||||||
// if (!document.hidden) return true;
|
|
||||||
// // 全部在后台,使用唯一id判断
|
|
||||||
// return uuid === localStorage.getItem('whuuid')
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
// import WuhuBase from "../WuhuBase";
|
|
||||||
//
|
|
||||||
// export default class WuhuBaseAction extends WuhuBase {
|
|
||||||
// name: string
|
|
||||||
//
|
|
||||||
// protected constructor() {
|
|
||||||
// super();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // static getInstance(this) {
|
|
||||||
// // if (!this.instance)
|
|
||||||
// // this.instance = new this();
|
|
||||||
// // return this.instance;
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
export default class Provider {
|
|
||||||
protected instance;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// static getInstance<T extends Provider>(this:ExtendClass<T>):ExtendClass<T>{
|
|
||||||
static getInstance<T extends Provider>(this): T & typeof this {
|
|
||||||
if (!this.instance) this.instance = new this();
|
|
||||||
return this.instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
import Log from "../Log";
|
|
||||||
|
|
||||||
export default class Starter {
|
|
||||||
public static run(T): void {
|
|
||||||
try {
|
|
||||||
new T().main();
|
|
||||||
} catch (error) {
|
|
||||||
Log.error(error);
|
|
||||||
Log.error('[Starter] trace: ', JSON.stringify({ error }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
import Log from "../Log";
|
|
||||||
import ZhongIcon from "../ZhongIcon";
|
|
||||||
|
|
||||||
export default class ActionButtonUtils extends WuhuBase {
|
|
||||||
private hasAdded: boolean = false;
|
|
||||||
|
|
||||||
public add(txt: string, func: (ev: Event) => void = () => null): void {
|
|
||||||
if (!this.hasAdded) this.handle(txt, func);
|
|
||||||
else Log.warn('ActionButton已存在');
|
|
||||||
}
|
|
||||||
|
|
||||||
private handle(txt, func): void {
|
|
||||||
let btn = document.createElement('button');
|
|
||||||
btn.style.padding = '8px 13px 8px 0';
|
|
||||||
btn.style.verticalAlign = 'bottom';
|
|
||||||
btn.style.color = '#4CAF50';
|
|
||||||
btn.innerHTML = txt;
|
|
||||||
btn.addEventListener('click', func);
|
|
||||||
ZhongIcon.ZhongNode.querySelector('button').after(btn);
|
|
||||||
this.hasAdded = true;
|
|
||||||
Log.info('ActionButton已添加', { txt, func, btn });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,180 +0,0 @@
|
|||||||
import UserScriptEngine from "../../enum/UserScriptEngine";
|
|
||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
import Log from "../Log";
|
|
||||||
import Device from "../../enum/Device";
|
|
||||||
import AjaxFetchOption from "../../interface/AjaxFetchOption";
|
|
||||||
import Alert from "./Alert";
|
|
||||||
import LOADING_IMG_HTML from "../../html/loading_img.html";
|
|
||||||
|
|
||||||
export default class CommonUtils extends WuhuBase {
|
|
||||||
static getScriptEngine() {
|
|
||||||
let glob = CommonUtils.glob;
|
|
||||||
return glob.unsafeWindow ? UserScriptEngine.GM : glob.isPDA
|
|
||||||
? UserScriptEngine.PDA : UserScriptEngine.RAW;
|
|
||||||
}
|
|
||||||
|
|
||||||
static COFetch(url: URL | string, method: 'get' | 'post' = 'get', body: any = null): Promise<string> {
|
|
||||||
const engine = this.getScriptEngine();
|
|
||||||
let start = performance.now();
|
|
||||||
Log.info('跨域获取数据开始, 脚本引擎: ' + engine);
|
|
||||||
return new Promise<string>((resolve, reject) => {
|
|
||||||
switch (engine) {
|
|
||||||
case UserScriptEngine.RAW: {
|
|
||||||
Log.error(`跨域请求错误:${ UserScriptEngine.RAW }环境下无法进行跨域请求`);
|
|
||||||
reject(`错误:${ UserScriptEngine.RAW }环境下无法进行跨域请求`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case UserScriptEngine.PDA: {
|
|
||||||
const { PDA_httpGet, PDA_httpPost } = window;
|
|
||||||
// get
|
|
||||||
if (method === 'get') {
|
|
||||||
if (typeof PDA_httpGet !== 'function') {
|
|
||||||
Log.error('COFetch网络错误:PDA版本不支持');
|
|
||||||
reject('COFetch网络错误:PDA版本不支持');
|
|
||||||
}
|
|
||||||
PDA_httpGet(url)
|
|
||||||
.then(res => {
|
|
||||||
Log.info('跨域获取数据成功, 耗时' + (performance.now() - start | 0) + 'ms');
|
|
||||||
resolve(res.responseText);
|
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
Log.error('COFetch网络错误', e);
|
|
||||||
reject(`COFetch网络错误 ${ e }`);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// post
|
|
||||||
else {
|
|
||||||
if (typeof PDA_httpPost !== 'function') {
|
|
||||||
Log.error('COFetch网络错误:PDA版本不支持');
|
|
||||||
reject('COFetch网络错误:PDA版本不支持');
|
|
||||||
}
|
|
||||||
PDA_httpPost(url, { 'content-type': 'application/json' }, body)
|
|
||||||
.then(res => resolve(res.responseText))
|
|
||||||
.catch(e => {
|
|
||||||
Log.error('COFetch网络错误', e);
|
|
||||||
reject(`COFetch网络错误 ${ e }`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case UserScriptEngine.GM: {
|
|
||||||
let { GM_xmlhttpRequest } = CommonUtils.glob;
|
|
||||||
if (typeof GM_xmlhttpRequest !== 'function') {
|
|
||||||
Log.error('COFetch网络错误:用户脚本扩展API错误');
|
|
||||||
reject('错误:用户脚本扩展API错误');
|
|
||||||
}
|
|
||||||
GM_xmlhttpRequest({
|
|
||||||
method: method,
|
|
||||||
url: url,
|
|
||||||
data: method === 'get' ? null : body,
|
|
||||||
headers: method === 'get' ? null : { 'content-type': 'application/json' },
|
|
||||||
onload: res => {
|
|
||||||
Log.info('跨域获取数据成功,耗时' + (performance.now() - start | 0) + 'ms');
|
|
||||||
resolve(res.response);
|
|
||||||
},
|
|
||||||
onerror: res => reject(`连接错误 ${ JSON.stringify(res) }`),
|
|
||||||
ontimeout: res => reject(`连接超时 ${ JSON.stringify(res) }`),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回玩家信息的对象 { playername: string, userID: number }
|
|
||||||
* @return {PlayerInfo} rs
|
|
||||||
*/
|
|
||||||
static getPlayerInfo(): PlayerInfo {
|
|
||||||
const node = document.querySelector('script[uid]');
|
|
||||||
if (node) {
|
|
||||||
return {
|
|
||||||
playername: node.getAttribute('name'),
|
|
||||||
userID: node.getAttribute('uid') as unknown as number,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
new Alert('严重错误:芜湖助手无法获取用户数据,已退出');
|
|
||||||
throw '芜湖助手无法获取用户数据';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户设备类型 对应PC MOBILE TABLET
|
|
||||||
static getDeviceType(): Device {
|
|
||||||
return window.innerWidth >= 1000
|
|
||||||
? Device.PC : window.innerWidth <= 600 ? Device.MOBILE : Device.TABLET;
|
|
||||||
}
|
|
||||||
|
|
||||||
static getYaoCD(): string {
|
|
||||||
if (document.querySelector("#icon49-sidebar")) { // 0-10min
|
|
||||||
return '<10分'
|
|
||||||
} else if (document.querySelector("#icon50-sidebar")) { // 10min-1h
|
|
||||||
return '<1时'
|
|
||||||
} else if (document.querySelector("#icon51-sidebar")) { // 1h-2h
|
|
||||||
return '1~2时'
|
|
||||||
} else if (document.querySelector("#icon52-sidebar")) { // 2h-5h
|
|
||||||
return '2~5时'
|
|
||||||
} else if (document.querySelector("#icon53-sidebar")) { // 5h+
|
|
||||||
return '>5时'
|
|
||||||
} else {
|
|
||||||
return '无效'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static ajaxFetch(opt: AjaxFetchOption) {
|
|
||||||
let { url, referrer = '/', method, body = null } = opt;
|
|
||||||
let req_params: RequestInit = {
|
|
||||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
|
||||||
referrer,
|
|
||||||
method,
|
|
||||||
};
|
|
||||||
if (method === 'POST') {
|
|
||||||
req_params.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
|
|
||||||
req_params.body = body;
|
|
||||||
}
|
|
||||||
return fetch(url, req_params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过 mutation.observe 方法异步返回元素
|
|
||||||
* @param {String} selector - CSS规则的HTML元素选择器
|
|
||||||
* @param {Document} content - 上下文
|
|
||||||
* @param {number} timeout - 超时毫秒数
|
|
||||||
* @returns {Promise<HTMLElement|null>}
|
|
||||||
*/
|
|
||||||
static elementReady(selector: string, content: Document = document, timeout: number = 30000): Promise<HTMLElement> {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let el = content.querySelector(selector) as HTMLElement;
|
|
||||||
if (el) {
|
|
||||||
resolve(el);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let observer = new MutationObserver((_, observer) => {
|
|
||||||
content.querySelectorAll(selector).forEach((element) => {
|
|
||||||
observer.disconnect();
|
|
||||||
resolve(element as HTMLElement);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
observer.disconnect();
|
|
||||||
reject(`等待元素超时! [${ selector }]\n${ content.documentElement.tagName }`);
|
|
||||||
}, timeout);
|
|
||||||
observer.observe(content.documentElement, { childList: true, subtree: true });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
static addStyle(rules: string): void {
|
|
||||||
let element = document.querySelector('style#wh-trans-gStyle');
|
|
||||||
if (element) {
|
|
||||||
element.innerHTML += rules;
|
|
||||||
} else {
|
|
||||||
element = document.createElement("style");
|
|
||||||
element.id = 'wh-trans-gStyle';
|
|
||||||
element.innerHTML = rules;
|
|
||||||
document.head.appendChild(element);
|
|
||||||
}
|
|
||||||
Log.info('CSS规则已添加', element);
|
|
||||||
}
|
|
||||||
|
|
||||||
static loading_gif_html(): string {
|
|
||||||
return LOADING_IMG_HTML;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
|
|
||||||
export default class FetchUtils extends WuhuBase {
|
|
||||||
/**
|
|
||||||
* 包装jquery ajax 异步返回string
|
|
||||||
* @param url
|
|
||||||
* @param method
|
|
||||||
*/
|
|
||||||
public ajax(url: string, method: 'GET' | 'POST'): Promise<string> {
|
|
||||||
return new Promise((res, rej) => {
|
|
||||||
$.ajax({
|
|
||||||
method: method,
|
|
||||||
url: url,
|
|
||||||
success: function (data) {
|
|
||||||
res(data)
|
|
||||||
},
|
|
||||||
error: function (e) {
|
|
||||||
rej(e)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
import Alert from "./Alert";
|
|
||||||
import ISidebarData from "../../interface/ISidebarData";
|
|
||||||
import Log from "../Log";
|
|
||||||
import CommonUtils from "./CommonUtils";
|
|
||||||
|
|
||||||
export default class InfoUtils extends WuhuBase {
|
|
||||||
/**
|
|
||||||
* 返回玩家信息的对象 { playername: string, userID: number }
|
|
||||||
* @return {PlayerInfo} rs
|
|
||||||
*/
|
|
||||||
public getPlayerInfo(): PlayerInfo {
|
|
||||||
const node = document.querySelector('script[uid]');
|
|
||||||
if (node) {
|
|
||||||
return {
|
|
||||||
playername: node.getAttribute('name'),
|
|
||||||
userID: parseInt(node.getAttribute('uid')),
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
new Alert('严重错误:芜湖助手无法获取用户数据,已退出');
|
|
||||||
throw '芜湖助手无法获取用户数据';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getSessionData(): Promise<ISidebarData> {
|
|
||||||
let field: string = 'sidebarData' + this.getPlayerInfo().userID;
|
|
||||||
let ret: ISidebarData = {};
|
|
||||||
return new Promise(async resolve => {
|
|
||||||
let c = 0;
|
|
||||||
while (!sessionStorage.getItem(field) && c < 50) {
|
|
||||||
c++;
|
|
||||||
await this.sleep(10);
|
|
||||||
}
|
|
||||||
if (sessionStorage.getItem(field)) {
|
|
||||||
ret = JSON.parse(sessionStorage.getItem(field));
|
|
||||||
} else {
|
|
||||||
Log.info('无法从sessionStorage获取数据')
|
|
||||||
ret = await (await CommonUtils.ajaxFetch({
|
|
||||||
url: window.addRFC('/sidebarAjaxAction.php?q=getSidebarData'),
|
|
||||||
method: 'POST',
|
|
||||||
})).json();
|
|
||||||
sessionStorage.setItem(field, JSON.stringify(ret));
|
|
||||||
}
|
|
||||||
ret.headerData = JSON.parse(sessionStorage.getItem('headerData'));
|
|
||||||
resolve(ret);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getSidebarData() {
|
|
||||||
return (await this.getSessionData()).areas;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getUserState() {
|
|
||||||
return (await this.getSessionData()).headerData.user.state;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 等待毫秒数
|
|
||||||
* @param {Number} ms 毫秒
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
private sleep(ms) {
|
|
||||||
let time = Math.max(ms, 10);
|
|
||||||
return new Promise(resolve => setTimeout(() => resolve(null), time));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
|
|
||||||
export default class MathUtils extends WuhuBase {
|
|
||||||
// 得到一个两数之间的随机整数
|
|
||||||
public getRandomInt(min: number, max: number): number {
|
|
||||||
min = Math.ceil(min);
|
|
||||||
max = Math.floor(max);
|
|
||||||
//不含最大值,含最小值
|
|
||||||
return Math.floor(Math.random() * (max - min)) + min;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
import IWHNotify from "../../interface/IWHNotify";
|
|
||||||
import Log from "../Log";
|
|
||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
|
|
||||||
export default class NotificationUtils extends WuhuBase {
|
|
||||||
private permission: boolean = window.Notification && window.Notification.permission === 'granted';
|
|
||||||
|
|
||||||
public push(msg: string, options: IWHNotify = {}): void {
|
|
||||||
let { notifies } = NotificationUtils.glob;
|
|
||||||
|
|
||||||
if (options.sysNotify && this.permission) {
|
|
||||||
let tmpNode = document.createElement('p');
|
|
||||||
tmpNode.innerHTML = msg;
|
|
||||||
let notify = new Notification('芜湖助手', {
|
|
||||||
body: Log.getTime() + '\r\n' + tmpNode.innerText,
|
|
||||||
// requireInteraction: true,
|
|
||||||
// renotify: true,
|
|
||||||
// tag: '芜湖助手' + Utils.getRandomInt(0, 99),
|
|
||||||
});
|
|
||||||
let id = notifies.count++;
|
|
||||||
notifies[id] = notify;
|
|
||||||
notify.addEventListener(
|
|
||||||
'close',
|
|
||||||
() => {
|
|
||||||
notifies[id] = null;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
notify.addEventListener(
|
|
||||||
'click',
|
|
||||||
() => {
|
|
||||||
options.sysNotifyClick ? options.sysNotifyClick() : null;
|
|
||||||
window.focus();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
notify.addEventListener(
|
|
||||||
'show',
|
|
||||||
() => {
|
|
||||||
// setTimeout(() => notify.close(), (options.timeout || 3) * 1000);
|
|
||||||
Log.info('通知id: ', id)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
import WuhuBase from "../WuhuBase";
|
|
||||||
|
|
||||||
export default class Popup extends WuhuBase {
|
|
||||||
private readonly container: HTMLElement = null;
|
|
||||||
private readonly node: HTMLElement = null;
|
|
||||||
|
|
||||||
constructor(innerHTML: string, title: string = '芜湖助手') {
|
|
||||||
super();
|
|
||||||
if (Popup.glob.popup_node) Popup.glob.popup_node.close();
|
|
||||||
const popup = document.createElement('div');
|
|
||||||
popup.id = 'wh-popup';
|
|
||||||
popup.innerHTML = `<div id="wh-popup-container">
|
|
||||||
<style>html{overflow: hidden !important;}</style>
|
|
||||||
<div id="wh-popup-title"><p>${ title }</p></div>
|
|
||||||
<div id="wh-popup-cont">${ innerHTML }</div>
|
|
||||||
</div>`;
|
|
||||||
document.body.append(popup);
|
|
||||||
popup.addEventListener('click', e => {
|
|
||||||
e.stopImmediatePropagation();
|
|
||||||
if (e.target === popup) this.close();
|
|
||||||
});
|
|
||||||
this.container = popup;
|
|
||||||
this.node = popup.querySelector('#wh-popup-cont');
|
|
||||||
this.hideChat();
|
|
||||||
}
|
|
||||||
|
|
||||||
public close() {
|
|
||||||
this.container.remove();
|
|
||||||
this.showChat();
|
|
||||||
}
|
|
||||||
|
|
||||||
public getElement(): HTMLElement {
|
|
||||||
return this.node;
|
|
||||||
}
|
|
||||||
|
|
||||||
private hideChat() {
|
|
||||||
document.querySelector('#chatRoot').classList.add('wh-hide');
|
|
||||||
}
|
|
||||||
|
|
||||||
private showChat() {
|
|
||||||
document.querySelector('#chatRoot').classList.remove('wh-hide');
|
|
||||||
}
|
|
||||||
|
|
||||||
private getInstance() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,275 +0,0 @@
|
|||||||
import Device from "../../enum/Device";
|
|
||||||
import WuhuBase from "../../class/WuhuBase";
|
|
||||||
import WuhuConfig from "../../class/WuhuConfig";
|
|
||||||
import CommonUtils from "../../class/utils/CommonUtils";
|
|
||||||
import Log from "../../class/Log";
|
|
||||||
import Alert from "../../class/utils/Alert";
|
|
||||||
import MathUtils from "../../class/utils/MathUtils";
|
|
||||||
import ActionButtonUtils from "../../class/utils/ActionButtonUtils";
|
|
||||||
|
|
||||||
export default async function attackHelper(): Promise<null> {
|
|
||||||
let { href, device } = WuhuBase.glob;
|
|
||||||
// 攻击页面
|
|
||||||
if (href.contains(/loader\.php\?sid=attack/)) {
|
|
||||||
let stop_reload = false;
|
|
||||||
const quickAttIndex = WuhuConfig.get('quickAttIndex');
|
|
||||||
const quickFinishAtt = WuhuConfig.get('quickFinishAtt');
|
|
||||||
const attReload = WuhuConfig.get('attReload');
|
|
||||||
|
|
||||||
// 光速刷新按钮
|
|
||||||
ActionButtonUtils.getInstance().add('光速刷新', doAttackReload);
|
|
||||||
|
|
||||||
// 自刷新
|
|
||||||
let audio_played_flag;
|
|
||||||
// @ts-ignore
|
|
||||||
if (attReload !== 6 && stop_reload !== true) {
|
|
||||||
const selector_device_map = {
|
|
||||||
'pc': '#defender div[class^="modal___"]',
|
|
||||||
'mobile': '#attacker div[class^="modal___"]',
|
|
||||||
'tablet': '',
|
|
||||||
};
|
|
||||||
const selector = selector_device_map[device];
|
|
||||||
CommonUtils.elementReady(selector).then(elem => {
|
|
||||||
if (!elem.querySelector('button')) {
|
|
||||||
if (WuhuConfig.get('attReload') === 0 && stop_reload !== true) {
|
|
||||||
doAttackReload();
|
|
||||||
} else {
|
|
||||||
let reload_flag;
|
|
||||||
const timeout = WuhuConfig.get('attReload') * 1000 + MathUtils.getInstance().getRandomInt(-500, 500);
|
|
||||||
Log.info(`[WH] ${ timeout / 1000 }s 后自动刷新`);
|
|
||||||
window.setInterval(() => {
|
|
||||||
if (reload_flag === undefined) {
|
|
||||||
reload_flag = true;
|
|
||||||
} else if (stop_reload !== true) {
|
|
||||||
// window.location.reload();
|
|
||||||
doAttackReload();
|
|
||||||
}
|
|
||||||
}, timeout);
|
|
||||||
}
|
|
||||||
} else if (audio_played_flag === undefined) {
|
|
||||||
audio_played_flag = true;
|
|
||||||
let play_time = 0;
|
|
||||||
const audio_play_id = window.setInterval(() => {
|
|
||||||
const $audio = document.createElement('audio');
|
|
||||||
$audio.src = 'https://www.torn.com/js/chat/sounds/Warble_1.mp3';
|
|
||||||
$audio.play().then();
|
|
||||||
play_time++;
|
|
||||||
if (play_time === 3) clearInterval(audio_play_id);
|
|
||||||
}, 600);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 光速拔刀
|
|
||||||
if (quickAttIndex !== 6) {
|
|
||||||
const btn = await CommonUtils.elementReady('div[class^="modal___"] button');
|
|
||||||
Log.info(btn);
|
|
||||||
if (!btn.innerText.toLowerCase().includes('fight')) return;
|
|
||||||
// 判断是否存在脚踢
|
|
||||||
const hasKick = !!document.querySelector('#weapon_boots');
|
|
||||||
// modal层
|
|
||||||
const modal: HTMLElement = document.querySelector('div[class^="modal___"]');
|
|
||||||
Log.info(`当前设备类型是${ device }`);
|
|
||||||
// 区分设备
|
|
||||||
switch (device) {
|
|
||||||
case Device.PC: {
|
|
||||||
Log.info(`开始调整按钮位置`);
|
|
||||||
// 隐藏modal层
|
|
||||||
modal.style.display = 'none';
|
|
||||||
// 根据选择的武器调整css
|
|
||||||
let css_top = '0';
|
|
||||||
switch (WuhuConfig.get('quickAttIndex')) {
|
|
||||||
case 1: { // weapon_second
|
|
||||||
css_top = '97px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2: { // weapon_melee
|
|
||||||
css_top = '194px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3: { // weapon_temp
|
|
||||||
css_top = '291px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4: // weapon_fists
|
|
||||||
case 5: { // weapon_boots
|
|
||||||
css_top = '375px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const css_rule = `
|
|
||||||
.wh-move-btn #defender div[class^="modal___"]{display: block;width: 0 !important;top: ${ css_top };left: -169px !important;}
|
|
||||||
.wh-move-btn #defender div[class^="dialog___"]{border:0;width:159px;height:96px;}
|
|
||||||
.wh-move-btn #defender div[class^="colored___"]{display:block;padding:0;}
|
|
||||||
.wh-move-btn #defender div[class^="title___"]{height:0;}
|
|
||||||
.wh-move-btn #defender button{width: 100%;margin:17px 0;height: 60px;}
|
|
||||||
`;
|
|
||||||
CommonUtils.addStyle(css_rule);
|
|
||||||
document.body.classList.add('wh-move-btn');
|
|
||||||
// 绑定点击事件 联动【光速跑路】
|
|
||||||
btn.onclick = () => {
|
|
||||||
if (quickFinishAtt !== 3) {
|
|
||||||
btn.remove();
|
|
||||||
// 停止自动刷新
|
|
||||||
stop_reload = true;
|
|
||||||
} else {
|
|
||||||
document.body.classList.remove('wh-move-btn');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Device.MOBILE: {
|
|
||||||
Log.info(`开始调整按钮位置`);
|
|
||||||
// 加入css
|
|
||||||
let css_top = '0';
|
|
||||||
let slot_height = '76px';
|
|
||||||
// 判断有没有脚踢
|
|
||||||
if (hasKick) {
|
|
||||||
// 根据选择的武器调整
|
|
||||||
switch (WuhuConfig.get('quickAttIndex')) {
|
|
||||||
case 1: { // weapon_second
|
|
||||||
css_top = '76px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2: { // weapon_melee
|
|
||||||
css_top = '152px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3: { // weapon_temp
|
|
||||||
css_top = '228px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4: { // weapon_fists
|
|
||||||
css_top = '304px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5: { // weapon_boots
|
|
||||||
css_top = '380px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const slot = document.querySelector('#weapon_main') as HTMLElement;
|
|
||||||
const height = slot.offsetHeight + 1;
|
|
||||||
// TODO 待验证
|
|
||||||
slot_height = height + 'px';
|
|
||||||
// 根据选择的武器调整
|
|
||||||
switch (WuhuConfig.get('quickAttIndex')) {
|
|
||||||
case 1: { // weapon_second
|
|
||||||
css_top = `${ height }px`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2: { // weapon_melee
|
|
||||||
css_top = `${ height * 2 }px`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3: { // weapon_temp
|
|
||||||
css_top = `${ height * 3 }px`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4: { // weapon_fists
|
|
||||||
css_top = `${ height * 4 }px`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5: { // weapon_boots
|
|
||||||
css_top = `${ height * 5 }px`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const css_rule = `
|
|
||||||
.wh-move-btn #attacker div[class^="modal___"]{display: block;width: 0;top: ${ css_top };left:0;height:0;}
|
|
||||||
.wh-move-btn #attacker div[class^="dialog___"]{border:0;width:80px;height:${ slot_height };}
|
|
||||||
.wh-move-btn #attacker div[class^="colored___"]{display:block;padding:0;}
|
|
||||||
.wh-move-btn #attacker div[class^="title___"]{height:0;}
|
|
||||||
.wh-move-btn #attacker button{width:100%;margin:0;height:63px;white-space:normal;}
|
|
||||||
`;
|
|
||||||
CommonUtils.addStyle(css_rule);
|
|
||||||
document.body.classList.toggle('wh-move-btn');
|
|
||||||
btn.onclick = () => {
|
|
||||||
if (WuhuConfig.get('quickFinishAtt') !== 3) {
|
|
||||||
btn.remove();
|
|
||||||
// 停止自动刷新
|
|
||||||
stop_reload = true;
|
|
||||||
} else {
|
|
||||||
document.body.classList.toggle('wh-move-btn');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Device.TABLET: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 自动开打
|
|
||||||
if (WuhuConfig.get('autoStartFinish') === true) {
|
|
||||||
if (btn.innerText.includes('(')) {
|
|
||||||
let interval_id = window.setInterval(() => {
|
|
||||||
if (!btn) {
|
|
||||||
clearInterval(interval_id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
btn.click();
|
|
||||||
} catch {
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
} else {
|
|
||||||
btn.click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 光速跑路
|
|
||||||
if (quickFinishAtt !== 3) {
|
|
||||||
const user_btn_select = ['leave', 'mug', 'hosp'][WuhuConfig.get('quickFinishAtt')];
|
|
||||||
const wrap = document.querySelector('#react-root');
|
|
||||||
Log.info('光速跑路选项选中:', user_btn_select);
|
|
||||||
new MutationObserver(() => {
|
|
||||||
const btn_arr = document.querySelectorAll('div[class^="dialogButtons___"] button') as unknown as HTMLButtonElement[];
|
|
||||||
if (btn_arr.length > 1) btn_arr.forEach(btn => {
|
|
||||||
btn = btn as HTMLButtonElement;
|
|
||||||
const flag = btn.innerText.toLowerCase().includes(user_btn_select);
|
|
||||||
Log.info('按钮内容:', btn.innerText, ',是否包含选中:', flag);
|
|
||||||
if (!flag) btn.style.display = 'none';
|
|
||||||
// 自动结束
|
|
||||||
else if (WuhuConfig.get('autoStartFinish') === true) {
|
|
||||||
try {
|
|
||||||
btn.click();
|
|
||||||
} catch {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).observe(wrap, { subtree: true, attributes: true, childList: true });
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 错误的攻击页面
|
|
||||||
if (WuhuConfig.get('attRelocate') && href.includes('loader2.php')) {
|
|
||||||
const spl = window.location.href.trim().split('=');
|
|
||||||
const uid = spl[spl.length - 1];
|
|
||||||
if (!/^\d+$/.test(uid)) return;
|
|
||||||
window.location.href = `https://www.torn.com/loader.php?sid=attack&user2ID=${ uid }`;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 战斗页面快速刷新
|
|
||||||
function doAttackReload() {
|
|
||||||
if (!window.ReactDOM) {
|
|
||||||
new Alert('光速刷新失败:未找到React对象');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let react_root = document.querySelector('#react-root');
|
|
||||||
if (!react_root.querySelector('#attacker')) return;
|
|
||||||
let script = document.querySelector('script[src*="/builds/attack/"]');
|
|
||||||
let url = script.src;
|
|
||||||
if (!url.contains('app.js')) return;
|
|
||||||
window.ReactDOM.unmountComponentAtNode(react_root);
|
|
||||||
script.remove();
|
|
||||||
let node = document.createElement('script');
|
|
||||||
node.src = url;
|
|
||||||
node.type = 'text/javascript';
|
|
||||||
document.head.appendChild(node);
|
|
||||||
}
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
import elementReady from "../utils/elementReady";
|
|
||||||
import toThousands from "../utils/toThousands";
|
|
||||||
import log from "../utils/@deprecated/log";
|
|
||||||
import CommonUtils from "../../class/utils/CommonUtils";
|
|
||||||
|
|
||||||
export default function cityFinder(): void {
|
|
||||||
CommonUtils.addStyle(`
|
|
||||||
.wh-city-finds .leaflet-marker-pane img[src*="torn.com/images/items/"]{
|
|
||||||
display: block !important;
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 40px !important;
|
|
||||||
height: 40px !important;
|
|
||||||
left: -20px !important;
|
|
||||||
top: -20px !important;
|
|
||||||
padding: 10px 0;
|
|
||||||
border: none;
|
|
||||||
border-radius: 100%;
|
|
||||||
background-color:#d2d2d28c;
|
|
||||||
box-shadow:0 0 10px 5px #000;
|
|
||||||
z-index: 999 !important;
|
|
||||||
}
|
|
||||||
.wh-city-finds .leaflet-marker-pane.leaflet-marker-icon.user-item-pinpoint.leaflet-clickable{display: none !important;}
|
|
||||||
#wh-city-finder{
|
|
||||||
box-shadow: 0 0 3px 0px #696969;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
#wh-city-finder-header{
|
|
||||||
background-color: #3f51b5;
|
|
||||||
color: white;
|
|
||||||
padding: 8px;
|
|
||||||
font-size: 15px;
|
|
||||||
border-radius: 4px 4px 0 0;
|
|
||||||
text-shadow: 0 0 2px black;
|
|
||||||
background-image: linear-gradient(90deg,transparent 50%,rgba(0,0,0,.07) 0);
|
|
||||||
background-size: 4px;
|
|
||||||
}
|
|
||||||
#wh-city-finder-cont{
|
|
||||||
background: #616161;
|
|
||||||
padding: 8px;
|
|
||||||
color: #c7c7c7;
|
|
||||||
border-radius: 0 0 4px 4px;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
#wh-city-finder-cont span{
|
|
||||||
margin:2px 4px 2px 0;
|
|
||||||
padding:2px;
|
|
||||||
border-radius:2px;
|
|
||||||
background:green;
|
|
||||||
color:white;
|
|
||||||
display:inline-block;
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
// 物品名与价格
|
|
||||||
let items = null;
|
|
||||||
const base = document.createElement('div');
|
|
||||||
base.id = 'wh-city-finder';
|
|
||||||
const container = document.createElement('div');
|
|
||||||
container.id = 'wh-city-finder-cont';
|
|
||||||
const header = document.createElement('div');
|
|
||||||
header.id = 'wh-city-finder-header';
|
|
||||||
header.innerHTML = '捡垃圾助手';
|
|
||||||
const info = document.createElement('div');
|
|
||||||
info.innerHTML = '已找到物品:';
|
|
||||||
container.append(info);
|
|
||||||
base.append(header);
|
|
||||||
base.append(container);
|
|
||||||
CommonUtils.COFetch('https://jjins.github.io/item_price_raw.json')
|
|
||||||
.then(r => items = JSON.parse(r))
|
|
||||||
.catch(err => {
|
|
||||||
log.info(err)
|
|
||||||
items = undefined
|
|
||||||
});
|
|
||||||
elementReady('div.leaflet-marker-pane').then(elem => {
|
|
||||||
document.querySelector('#map').classList.add('wh-city-finds');
|
|
||||||
document.querySelector('.content-wrapper').prepend(base);
|
|
||||||
// 发现的物品id与map img node
|
|
||||||
const founds = [];
|
|
||||||
elem.querySelectorAll('img.map-user-item-icon').forEach(node => {
|
|
||||||
const item_id = node.src.split('/')[5];
|
|
||||||
const finder_item = document.createElement('span');
|
|
||||||
finder_item.id = 'wh-city-finder-item' + item_id;
|
|
||||||
finder_item.innerHTML = item_id;
|
|
||||||
founds.push({ 'id': item_id, 'node': finder_item, 'map_item': node });
|
|
||||||
container.append(finder_item);
|
|
||||||
});
|
|
||||||
// 未发现物品 返回
|
|
||||||
if (founds.length === 0) {
|
|
||||||
// header.innerHTML = '捡垃圾助手';
|
|
||||||
info.innerHTML = '空空如也,请大佬明天再来';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 将id显示为物品名与价格的函数
|
|
||||||
const displayNamePrice = () => {
|
|
||||||
// 总价
|
|
||||||
let total = 0;
|
|
||||||
founds.forEach(el => {
|
|
||||||
const value = items[el.id]['price'];
|
|
||||||
el.node.innerHTML = `<img src="${ el.map_item.src }" alt="" />${ items[el.id]['name'] } ($${ toThousands(value) })`;
|
|
||||||
// 灰色 100k以下
|
|
||||||
if (value < 100000) el.node.style.backgroundColor = '#9e9e9e';
|
|
||||||
// 绿色 1m以下
|
|
||||||
else if (value < 1000000) el.node.style.backgroundColor = '#4caf50';
|
|
||||||
// 蓝色 25m以下
|
|
||||||
else if (value < 25000000) el.node.style.backgroundColor = '#03a9f4';
|
|
||||||
// 橙色 500m以下
|
|
||||||
else if (value < 500000000) el.node.style.backgroundColor = '#ffc107';
|
|
||||||
// 红色 >500m
|
|
||||||
else if (value >= 500000000) el.node.style.backgroundColor = '#f44336';
|
|
||||||
total += items[el.id]['price'];
|
|
||||||
});
|
|
||||||
header.innerHTML = `捡垃圾助手 - ${ founds.length } 个物品,总价值 $${ toThousands(total) }`;
|
|
||||||
};
|
|
||||||
// 未取到数据时添加循环来调用函数
|
|
||||||
if (items === null) {
|
|
||||||
// 15s超时
|
|
||||||
let timeout = 30;
|
|
||||||
const interval = window.setInterval(() => {
|
|
||||||
timeout--;
|
|
||||||
if (items !== null) {
|
|
||||||
displayNamePrice();
|
|
||||||
clearInterval(interval);
|
|
||||||
}
|
|
||||||
if (0 === timeout) {
|
|
||||||
log.info('获取物品名称与价格信息超时')
|
|
||||||
clearInterval(interval)
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
// 无法跨域获取数据时
|
|
||||||
else if (items === undefined) {
|
|
||||||
info.innerHTML += '(当前平台暂不支持查询价格)';
|
|
||||||
}
|
|
||||||
// 调用函数
|
|
||||||
else {
|
|
||||||
displayNamePrice();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
import Alert from "../../class/utils/Alert";
|
|
||||||
|
|
||||||
// 一键起飞
|
|
||||||
export default function doQuickFly() {
|
|
||||||
// [id: dest, _type: (1...4), ts: timestamp]
|
|
||||||
const [_id, _type, ts] = sessionStorage['wh-quick-fly'].trim().split(' ');
|
|
||||||
if (new Date().getTime() - ts > 20000) {
|
|
||||||
new Alert('超时,一键起飞计划已取消');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const keynode = document.querySelector('div[data-id][data-key]');
|
|
||||||
if (!keynode) {
|
|
||||||
new Alert('出错了,无法起飞,已取消');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const _key = keynode.getAttribute('data-key');
|
|
||||||
window.getAction({
|
|
||||||
type: 'post',
|
|
||||||
data: {
|
|
||||||
step: 'travel',
|
|
||||||
id: getDestId(_id),
|
|
||||||
key: _key,
|
|
||||||
type: ['standard', 'airstrip', 'private', 'business'][_type]
|
|
||||||
},
|
|
||||||
success: function (str) {
|
|
||||||
new Alert(str)
|
|
||||||
if (str.includes('err')) {
|
|
||||||
new Alert('起飞出错了');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
window.location.href = 'https://www.torn.com/index.php'
|
|
||||||
},
|
|
||||||
before: function () {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
delete sessionStorage['wh-quick-fly'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 起飞目的地id
|
|
||||||
function getDestId(dest) {
|
|
||||||
// 墨、开、加、夏、英、阿、瑞s、立本、祖、迪、南
|
|
||||||
return [2, 12, 9, 3, 10, 7, 8, 5, 6, 11, 4][dest];
|
|
||||||
}
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
import UserScriptEngine from "../../enum/UserScriptEngine";
|
|
||||||
import addStyle from "../utils/@deprecated/addStyle";
|
|
||||||
import log from "../utils/@deprecated/log";
|
|
||||||
import CommonUtils from "../../class/utils/CommonUtils";
|
|
||||||
import Alert from "../../class/utils/Alert";
|
|
||||||
|
|
||||||
// gs loader
|
|
||||||
export default function loadGS(use) {
|
|
||||||
if (use === UserScriptEngine.PDA) {
|
|
||||||
let ifr: HTMLIFrameElement = document.querySelector('#wh-gs-loader-ifr');
|
|
||||||
if (ifr) {
|
|
||||||
new Alert('飞贼小助手已经加载了');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const container = document.createElement('div');
|
|
||||||
container.id = 'wh-gs-loader';
|
|
||||||
ifr = document.createElement('iframe');
|
|
||||||
ifr.id = 'wh-gs-loader-ifr';
|
|
||||||
ifr.src = 'https://www.torn.com/crimes.php';
|
|
||||||
container.append(ifr);
|
|
||||||
document.body.append(container);
|
|
||||||
addStyle(`
|
|
||||||
#wh-gs-loader {
|
|
||||||
position:fixed;
|
|
||||||
top:0;
|
|
||||||
left:0;
|
|
||||||
z-index:100001;
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
let notify = new Alert('加载中');
|
|
||||||
ifr.onload = () => {
|
|
||||||
notify.close();
|
|
||||||
const _window = ifr.contentWindow;
|
|
||||||
const _docu = _window.document;
|
|
||||||
_docu.head.innerHTML = '';
|
|
||||||
_docu.body.innerHTML = '';
|
|
||||||
notify = new Alert('加载依赖');
|
|
||||||
CommonUtils.COFetch('https://cdn.staticfile.org/vue/2.2.2/vue.min.js')
|
|
||||||
.then(vuejs => {
|
|
||||||
notify.close();
|
|
||||||
_window.eval(vuejs);
|
|
||||||
_window.GM_getValue = (k, v = undefined) => {
|
|
||||||
const objV = JSON.parse(_window.localStorage.getItem('wh-gs-storage') || '{}')[k];
|
|
||||||
return objV || v;
|
|
||||||
};
|
|
||||||
_window.GM_setValue = (k, v) => {
|
|
||||||
const obj = JSON.parse(_window.localStorage.getItem('wh-gs-storage') || '{}');
|
|
||||||
obj[k] = v;
|
|
||||||
_window.localStorage.setItem('wh-gs-storage', JSON.stringify(obj));
|
|
||||||
};
|
|
||||||
_window.GM_xmlhttpRequest = function (opt) {
|
|
||||||
// 暂不适配pda post
|
|
||||||
if (opt.method.toLowerCase() === 'post') return;
|
|
||||||
CommonUtils.COFetch(opt.url).then(res => {
|
|
||||||
const obj = {
|
|
||||||
responseText: res
|
|
||||||
};
|
|
||||||
opt.onload(obj);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
notify = new Alert('加载飞贼小助手');
|
|
||||||
CommonUtils.COFetch(`https://gitee.com/ameto_kasao/tornjs/raw/master/GoldenSnitch.js?${ performance.now() }`)
|
|
||||||
.then(res => {
|
|
||||||
_window.eval(res.replace('http://222.160.142.50:8154/mugger', `https://api.ljs-lyt.com/mugger`));
|
|
||||||
_window.GM_setValue("gsp_x", 10);
|
|
||||||
_window.GM_setValue("gsp_y", 10);
|
|
||||||
notify.close();
|
|
||||||
notify = new Alert('飞贼小助手已加载', { timeout: 1 });
|
|
||||||
const gsp: HTMLElement = _docu.querySelector('#gsp');
|
|
||||||
const thisRun = () => {
|
|
||||||
ifr.style.height = `${ gsp.offsetHeight + 10 }px`;
|
|
||||||
ifr.style.width = `${ gsp.offsetWidth + 20 }px`;
|
|
||||||
gsp.style.top = '10px';
|
|
||||||
gsp.style.left = '10px';
|
|
||||||
};
|
|
||||||
new MutationObserver(thisRun).observe(gsp, { childList: true, subtree: true });
|
|
||||||
thisRun();
|
|
||||||
if (log.debug()) _window.GM_setValue("gsp_showContent", true)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (use === UserScriptEngine.GM) {
|
|
||||||
if (typeof window.Vue !== 'function') {
|
|
||||||
let notify = new Alert('正在加载依赖');
|
|
||||||
CommonUtils.COFetch('https://cdn.staticfile.org/vue/2.2.2/vue.min.js')
|
|
||||||
.then(VueJS => {
|
|
||||||
window.eval(VueJS);
|
|
||||||
notify.close();
|
|
||||||
notify = new Alert('已载入依赖');
|
|
||||||
window.GM_getValue = (k, v = undefined) => {
|
|
||||||
const objV = JSON.parse(window.localStorage.getItem('wh-gs-storage') || '{}')[k];
|
|
||||||
return objV || v;
|
|
||||||
};
|
|
||||||
window.GM_setValue = (k, v) => {
|
|
||||||
const obj = JSON.parse(window.localStorage.getItem('wh-gs-storage') || '{}');
|
|
||||||
obj[k] = v;
|
|
||||||
window.localStorage.setItem('wh-gs-storage', JSON.stringify(obj));
|
|
||||||
};
|
|
||||||
// TODO
|
|
||||||
// window.GM_xmlhttpRequest = GM_xmlhttpRequest;
|
|
||||||
CommonUtils.COFetch(`https://gitee.com/ameto_kasao/tornjs/raw/master/GoldenSnitch.js?${ performance.now() }`)
|
|
||||||
.then(GSJS => {
|
|
||||||
window.eval(GSJS);
|
|
||||||
if (log.debug()) window.GM_setValue("gsp_showContent", true);
|
|
||||||
notify.close();
|
|
||||||
notify = new Alert('已载入飞贼助手');
|
|
||||||
})
|
|
||||||
.catch(err => new Alert(`PDA API错误。${ JSON.stringify(err) }`));
|
|
||||||
})
|
|
||||||
.catch(err => new Alert(JSON.stringify(err)));
|
|
||||||
} else {
|
|
||||||
new Alert('飞贼助手已经加载了');
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
new Alert('暂不支持');
|
|
||||||
}
|
|
||||||
@ -1,409 +0,0 @@
|
|||||||
import titleTrans from "../translate/titleTrans";
|
|
||||||
import contentTitleLinksTrans from "../translate/contentTitleLinksTrans";
|
|
||||||
import Device from "../../enum/Device";
|
|
||||||
import doQuickFly from "./doQuickFly";
|
|
||||||
import WuhuBase from "../../class/WuhuBase";
|
|
||||||
import Alert from "../../class/utils/Alert";
|
|
||||||
import ActionButtonUtils from "../../class/utils/ActionButtonUtils";
|
|
||||||
import WuhuConfig from "../../class/WuhuConfig";
|
|
||||||
import CommonUtils from "../../class/utils/CommonUtils";
|
|
||||||
import Log from "../../class/Log";
|
|
||||||
|
|
||||||
export default async function travelHelper(): Promise<null> {
|
|
||||||
let { href, bodyAttrs, device } = WuhuBase.glob;
|
|
||||||
|
|
||||||
// URL判断 + 人不在城内
|
|
||||||
if (href.includes('index.php') && bodyAttrs['data-abroad'] === 'true') {
|
|
||||||
// 飞行中
|
|
||||||
if (bodyAttrs["data-traveling"] === 'true') {
|
|
||||||
// 飞行闹钟
|
|
||||||
if (device === Device.PC && WuhuConfig.get('trvAlarm')) {
|
|
||||||
// 获取目的地
|
|
||||||
let dest_cn;
|
|
||||||
let country = document.body.getAttribute('data-country');
|
|
||||||
if (country === 'torn') {
|
|
||||||
dest_cn = '回城';
|
|
||||||
} else {
|
|
||||||
dest_cn = {
|
|
||||||
'uk': "英国", 'switzerland': "瑞士", 'mexico': '墨西哥', 'canada': '加拿大', 'cayman': '开曼',
|
|
||||||
'hawaii': '夏威夷', 'argentina': '阿根廷',
|
|
||||||
'japan': '日本', 'china': '中国', 'uae': 'UAE', 'sa': '南非',
|
|
||||||
}[country] || country;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 剩余时间
|
|
||||||
const remaining_arr = document.querySelector('#countrTravel').getAttribute('data-to');
|
|
||||||
|
|
||||||
const wh_trv_alarm = localStorage.getItem('wh_trv_alarm')
|
|
||||||
? JSON.parse(localStorage.getItem('wh_trv_alarm'))
|
|
||||||
: { 'enable': true, 'alert_time': 30, 'node_pos': [240, 240] };
|
|
||||||
const save_trv_settings = () => localStorage.setItem('wh_trv_alarm', JSON.stringify(wh_trv_alarm));
|
|
||||||
|
|
||||||
const wh_trv_alarm_node = document.createElement('div');
|
|
||||||
wh_trv_alarm_node.id = 'wh-trv-alarm';
|
|
||||||
wh_trv_alarm_node.style.left = `${ wh_trv_alarm.node_pos[0] }px`;
|
|
||||||
wh_trv_alarm_node.style.top = `${ wh_trv_alarm.node_pos[1] }px`;
|
|
||||||
wh_trv_alarm_node.innerHTML = `<div id="wh-trv-error"><p><b>❌ 没有权限</b><br/>点击网页内任意位置以激活闹钟</p></div>
|
|
||||||
<div id="wh-trv-alarm-title">
|
|
||||||
<h5 id="wh-trv-alarm-header">飞行闹钟</h5>
|
|
||||||
</div>
|
|
||||||
<div id="wh-trv-alarm-bottom">
|
|
||||||
<div id="wh-trv-alarm-cont">
|
|
||||||
<p id="wh-trv-alarm-remaining"></p>
|
|
||||||
<p><span id="wh-trv-status">正在${ dest_cn === '回城' ? dest_cn : '飞往' + dest_cn } </span><span>✈</span></p>
|
|
||||||
<div><label><input type="checkbox" ${ wh_trv_alarm.enable ? 'checked ' : ' ' }/> 开启闹钟</label></div>
|
|
||||||
<div><label>落地前响铃时长(秒): <input type="number" value="${ wh_trv_alarm.alert_time || 30 }" /></label><button>确定</button></div>
|
|
||||||
<div class="wh-trv-alarm-stop-hide"><button>停止闹钟</button></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
CommonUtils.addStyle(`
|
|
||||||
#wh-trv-alarm{
|
|
||||||
position:absolute;
|
|
||||||
width:248px;
|
|
||||||
/*left:${ wh_trv_alarm.node_pos[0] || 240 }px;
|
|
||||||
top:${ wh_trv_alarm.node_pos[1] || 240 }px;*/
|
|
||||||
background:white;
|
|
||||||
border-radius:4px;
|
|
||||||
box-shadow:#0000001f 0 0 10px 4px;
|
|
||||||
border:solid 1px #aaa;
|
|
||||||
z-index:100001;
|
|
||||||
margin:2em;
|
|
||||||
}
|
|
||||||
#wh-trv-alarm button{
|
|
||||||
margin:0;
|
|
||||||
}
|
|
||||||
#wh-trv-error{
|
|
||||||
position:absolute;
|
|
||||||
width:100%;
|
|
||||||
height:100%;
|
|
||||||
/*display: table;*/
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
#wh-trv-error p{
|
|
||||||
background:#ffd0d0;
|
|
||||||
color:red;
|
|
||||||
display:table-cell;
|
|
||||||
vertical-align:middle;
|
|
||||||
padding:1em;
|
|
||||||
text-align:center;
|
|
||||||
}
|
|
||||||
#wh-trv-alarm-title{
|
|
||||||
height: 30px;
|
|
||||||
border-bottom: solid #aaa 1px;
|
|
||||||
cursor: move;
|
|
||||||
}
|
|
||||||
/*#wh-trv-alarm-move-btn span{
|
|
||||||
background:url(/images/v2/home_main/move.svg);
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
float: right;
|
|
||||||
cursor: move;
|
|
||||||
}*/
|
|
||||||
h5#wh-trv-alarm-header{
|
|
||||||
height: 100%;
|
|
||||||
line-height: 30px;
|
|
||||||
padding:0 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
#wh-trv-alarm-bottom{
|
|
||||||
padding: 12px;
|
|
||||||
}
|
|
||||||
#wh-trv-alarm-remaining{
|
|
||||||
float:right;
|
|
||||||
color:red;
|
|
||||||
}
|
|
||||||
#wh-trv-alarm-cont input[type="number"]{
|
|
||||||
width: 42px;
|
|
||||||
border-bottom: solid 1px #aaa;
|
|
||||||
}
|
|
||||||
.wh-trv-alarm-stop-hide{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
document.body.append(wh_trv_alarm_node);
|
|
||||||
// 报错dom
|
|
||||||
const error_node = wh_trv_alarm_node.querySelector('#wh-trv-error') as HTMLElement;
|
|
||||||
// jquery拖动
|
|
||||||
// @ts-ignore
|
|
||||||
$(wh_trv_alarm_node).draggable({
|
|
||||||
containment: "body",
|
|
||||||
distance: 5,
|
|
||||||
handle: "#wh-trv-alarm-title",
|
|
||||||
stop: () => {
|
|
||||||
wh_trv_alarm.node_pos = [parseInt(wh_trv_alarm_node.style.left), parseInt(wh_trv_alarm_node.style.top)];
|
|
||||||
save_trv_settings();
|
|
||||||
},
|
|
||||||
scroll: false,
|
|
||||||
});
|
|
||||||
// 剩余时间dom
|
|
||||||
const remaining_node = wh_trv_alarm_node.querySelector('#wh-trv-alarm-remaining');
|
|
||||||
// 设定闹钟响的按钮
|
|
||||||
const set_node = wh_trv_alarm_node.querySelectorAll('#wh-trv-alarm-cont button')[0] as HTMLButtonElement;
|
|
||||||
// 落地前响铃时长
|
|
||||||
const cd_time = wh_trv_alarm_node.querySelector('input[type="number"]') as HTMLInputElement;
|
|
||||||
let count_down_notify: MyHTMLElement | { close: Function } = {
|
|
||||||
close: () => {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
set_node.onclick = () => {
|
|
||||||
try {
|
|
||||||
wh_trv_alarm.alert_time = parseInt(cd_time.value);
|
|
||||||
} catch {
|
|
||||||
wh_trv_alarm.alert_time = 30;
|
|
||||||
}
|
|
||||||
save_trv_settings();
|
|
||||||
set_node.value = wh_trv_alarm.alert_time;
|
|
||||||
count_down_notify.close();
|
|
||||||
count_down_notify = new Alert('设置已更新');
|
|
||||||
};
|
|
||||||
// 停止响铃按钮
|
|
||||||
const stop_node = wh_trv_alarm_node.querySelectorAll('#wh-trv-alarm-cont button')[1] as HTMLButtonElement;
|
|
||||||
stop_node.onclick = () => {
|
|
||||||
user_stop_alert = true;
|
|
||||||
stop_node.innerText = '本次已关闭';
|
|
||||||
stop_node.disabled = true;
|
|
||||||
}
|
|
||||||
// 开启闹钟勾选
|
|
||||||
const enable_node = wh_trv_alarm_node.querySelector('#wh-trv-alarm-cont input[type="checkbox"]') as HTMLInputElement;
|
|
||||||
let on_off_notify: MyHTMLElement | { close: Function } = {
|
|
||||||
close: () => {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
enable_node.onchange = ev => {
|
|
||||||
wh_trv_alarm.enable = (<HTMLInputElement>ev.target).checked;
|
|
||||||
save_trv_settings();
|
|
||||||
on_off_notify.close();
|
|
||||||
on_off_notify = new Alert(wh_trv_alarm.enable ? '闹钟已开启' : '闹钟已关闭');
|
|
||||||
};
|
|
||||||
// 剩余时间 秒
|
|
||||||
const remaining_sec = parseInt(remaining_arr);
|
|
||||||
// 落地时timestamp
|
|
||||||
const land_timestamp = Date.now() + remaining_sec * 1000;
|
|
||||||
// 音频dom
|
|
||||||
const audio = document.createElement('audio');
|
|
||||||
audio.src = 'https://www.torn.com/js/chat/sounds/Warble_1.mp3';
|
|
||||||
audio.play()
|
|
||||||
.then(() => audio.pause())
|
|
||||||
.catch(() => {
|
|
||||||
error_node.style.display = 'table';
|
|
||||||
const func = () => {
|
|
||||||
error_node.remove();
|
|
||||||
document.body.removeEventListener('click', func);
|
|
||||||
};
|
|
||||||
document.body.addEventListener('click', func);
|
|
||||||
});
|
|
||||||
// 是否正在响铃
|
|
||||||
let audio_play_flag = false;
|
|
||||||
// 用户是否停止当前响铃
|
|
||||||
let user_stop_alert = false;
|
|
||||||
// 响铃循环id
|
|
||||||
let audio_play_id = null;
|
|
||||||
// 响铃的方法
|
|
||||||
let audio_play_handle = () => {
|
|
||||||
if (user_stop_alert) {
|
|
||||||
clearInterval(audio_play_id);
|
|
||||||
audio_play_id = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!audio_play_flag || !wh_trv_alarm.enable) return;
|
|
||||||
audio.play().then();
|
|
||||||
};
|
|
||||||
// 飞机小动画字符
|
|
||||||
const flying_arr = [
|
|
||||||
'✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
' ✈ ',
|
|
||||||
];
|
|
||||||
// 飞行的状态dom
|
|
||||||
const flying_status = wh_trv_alarm_node.querySelector('#wh-trv-status');
|
|
||||||
// 飞机的小动画dom
|
|
||||||
const flying_ani = flying_status.nextElementSibling;
|
|
||||||
// 飞机的计数
|
|
||||||
let flying_index = 0;
|
|
||||||
const id = window.setInterval(() => {
|
|
||||||
const remaining_time = (land_timestamp - Date.now()) / 1000 | 0;
|
|
||||||
remaining_node.innerText = `${ remaining_time / 3600 | 0 }时${ remaining_time % 3600 / 60 | 0 }分${ remaining_time % 60 }秒`;
|
|
||||||
|
|
||||||
if (remaining_time < wh_trv_alarm.alert_time) {
|
|
||||||
// flying_status.innerHTML = `即将落地...`;
|
|
||||||
if (wh_trv_alarm.enable) {
|
|
||||||
// 播放提示音
|
|
||||||
audio_play_flag = true;
|
|
||||||
if (audio_play_id === null && !user_stop_alert) audio_play_id = window.setInterval(audio_play_handle, 750);
|
|
||||||
stop_node.parentElement.classList.remove('wh-trv-alarm-stop-hide');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// flying_status.innerHTML = `飞行中...`;
|
|
||||||
if (wh_trv_alarm.enable) {
|
|
||||||
clearInterval(audio_play_id);
|
|
||||||
audio_play_id = null;
|
|
||||||
stop_node.parentElement.classList.add('wh-trv-alarm-stop-hide');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
flying_ani.innerHTML = `${ flying_arr[flying_index] }`;
|
|
||||||
flying_index = (flying_index + 1) % flying_arr.length;
|
|
||||||
}, 1000);
|
|
||||||
Log.info({
|
|
||||||
dest_cn,
|
|
||||||
remaining_arr,
|
|
||||||
wh_trv_alarm,
|
|
||||||
wh_trv_alarm_node,
|
|
||||||
error_node,
|
|
||||||
remaining_node,
|
|
||||||
set_node,
|
|
||||||
cd_time,
|
|
||||||
count_down_notify,
|
|
||||||
stop_node,
|
|
||||||
enable_node,
|
|
||||||
remaining_sec,
|
|
||||||
land_timestamp,
|
|
||||||
audio,
|
|
||||||
audio_play_flag,
|
|
||||||
user_stop_alert,
|
|
||||||
audio_play_id,
|
|
||||||
flying_status,
|
|
||||||
flying_index,
|
|
||||||
id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 落地转跳 落地前事件
|
|
||||||
if (WuhuConfig.get('landedRedirect') && document.querySelector('#tcLogo[title]') === null) {
|
|
||||||
window.addEventListener('beforeunload', () => {
|
|
||||||
let obj = { url: WuhuConfig.get('landedRedirect'), timestamp: Date.now() };
|
|
||||||
sessionStorage['wh-landed-redirect'] = JSON.stringify(obj);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 不在飞行中 海外落地页面
|
|
||||||
else {
|
|
||||||
// 一键回城
|
|
||||||
ActionButtonUtils.getInstance().add('直接回城', travelBack);
|
|
||||||
// 海外警告
|
|
||||||
if (WuhuConfig.get('abroadWarning')) {
|
|
||||||
let c = 1;
|
|
||||||
setInterval(() => new Alert(`警告:您已海外落地${ c++ * 30 }秒`, {
|
|
||||||
timeout: 30,
|
|
||||||
sysNotify: true
|
|
||||||
}), 30000);
|
|
||||||
}
|
|
||||||
// 解毒提醒
|
|
||||||
if (bodyAttrs['data-country'] === 'switzerland') {
|
|
||||||
let page_title = document.querySelector('h4#skip-to-content');
|
|
||||||
let msg = document.createElement('div');
|
|
||||||
msg.innerHTML = `<div class="info-msg border-round">
|
|
||||||
<i class="info-icon"></i>
|
|
||||||
<div class="delimiter">
|
|
||||||
<div class="msg right-round" tabindex="0" role="alert">
|
|
||||||
<p><a href="/index.php?page=rehab">❤️ 点击前往解毒</a></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>`;
|
|
||||||
msg.classList.add('info-msg-cont', 'green', 'border-round', 'm-bottom10');
|
|
||||||
page_title.before(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// URL判断 + 人在城内
|
|
||||||
else if (href.includes('index.php') && bodyAttrs['data-abroad'] === 'false') {
|
|
||||||
// 落地转跳
|
|
||||||
if (sessionStorage['wh-landed-redirect']) {
|
|
||||||
let { url, timestamp } = JSON.parse(sessionStorage['wh-landed-redirect']);
|
|
||||||
if (Date.now() - timestamp < 30000) {
|
|
||||||
sessionStorage.removeItem('wh-landed-redirect');
|
|
||||||
location.href = url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 起飞页面
|
|
||||||
if (href.contains(/travelagency\.php/)) {
|
|
||||||
// 起飞提醒
|
|
||||||
if (WuhuConfig.get('energyAlert')) {
|
|
||||||
const $$ = $('.content-wrapper');
|
|
||||||
const OB = new MutationObserver(() => {
|
|
||||||
OB.disconnect();
|
|
||||||
titleTrans();
|
|
||||||
contentTitleLinksTrans();
|
|
||||||
trans();
|
|
||||||
OB.observe($$.get(0), {
|
|
||||||
characterData: true,
|
|
||||||
attributes: true,
|
|
||||||
subtree: true,
|
|
||||||
childList: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const trans = () => {
|
|
||||||
// 当前能量e
|
|
||||||
const energyBarStr = $('#barEnergy p[class^="bar-value__"]').text().trim();
|
|
||||||
const [curE, maxE] = energyBarStr.split('/').length === 2
|
|
||||||
? [parseInt(energyBarStr.split('/')[0]), parseInt(energyBarStr.split('/')[1])]
|
|
||||||
: [NaN, NaN];
|
|
||||||
const incTime = maxE === 150 ? 10 : 15;
|
|
||||||
const fullEnergyTime = !(isNaN(curE) || isNaN(maxE)) ? (maxE - 5 - curE) / 5 * incTime
|
|
||||||
+ (incTime - new Date().getMinutes() % incTime) : NaN;
|
|
||||||
// 起飞前提示
|
|
||||||
$('.travel-confirm .travel-question .q-wrap span:nth-of-type(2)').each((i, e) => {
|
|
||||||
if (isNaN(fullEnergyTime)) return;
|
|
||||||
const spl = e.innerText.trim().split(' ');
|
|
||||||
const [hours, minutes] = spl.length === 5
|
|
||||||
? [parseInt(spl[0]), parseInt(spl[3])]
|
|
||||||
: [0, parseInt(spl[0])];
|
|
||||||
if (fullEnergyTime < (hours * 60 + minutes) * 2) {
|
|
||||||
if (!$(e).parent().hasClass('wh-translated')) {
|
|
||||||
$(e).parent()
|
|
||||||
.prepend(`<div style="color: red">警告:该次飞行往返时间大于体力回复时间,将会爆体!</div>`)
|
|
||||||
.addClass('wh-translated');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
trans();
|
|
||||||
OB.observe($$.get(0), {
|
|
||||||
characterData: true,
|
|
||||||
attributes: true,
|
|
||||||
subtree: true,
|
|
||||||
childList: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 一键起飞
|
|
||||||
if (sessionStorage['wh-quick-fly']) {
|
|
||||||
doQuickFly();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function travelBack(): Promise<null> {
|
|
||||||
if (typeof window['getAction'] !== 'function') return;
|
|
||||||
let backHomeAction = function (): Promise<string> {
|
|
||||||
return new Promise(resolve => {
|
|
||||||
window.getAction({
|
|
||||||
type: "post",
|
|
||||||
action: 'travelagency.php',
|
|
||||||
data: {
|
|
||||||
step: 'backHomeAction'
|
|
||||||
},
|
|
||||||
success: function (msg) {
|
|
||||||
resolve(msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
let res = await backHomeAction();
|
|
||||||
new Alert(res);
|
|
||||||
if (!res.includes('error')) {
|
|
||||||
new Alert('成功,即将刷新');
|
|
||||||
setTimeout(() => location.reload(), 3000);
|
|
||||||
} else {
|
|
||||||
new Alert('出错了');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
import Alert from "../../class/utils/Alert";
|
|
||||||
|
|
||||||
// 更新词库
|
|
||||||
export default function updateTransDict() {
|
|
||||||
new Alert('计划中');
|
|
||||||
}
|
|
||||||
@ -1,65 +0,0 @@
|
|||||||
import UserScriptEngine from "../../../enum/UserScriptEngine";
|
|
||||||
import getScriptEngine from "../getScriptEngine";
|
|
||||||
import Log from "../../../class/Log";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function COFetch(url: URL | string, method: 'get' | 'post' = 'get', body: any = null): Promise<string> {
|
|
||||||
return new Promise<string>((resolve, reject) => {
|
|
||||||
const engine = getScriptEngine();
|
|
||||||
switch (engine) {
|
|
||||||
case UserScriptEngine.RAW: {
|
|
||||||
console.error(`[wh] 跨域请求错误:${ UserScriptEngine.RAW }环境下无法进行跨域请求`);
|
|
||||||
reject(`错误:${ UserScriptEngine.RAW }环境下无法进行跨域请求`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case UserScriptEngine.PDA: {
|
|
||||||
const { PDA_httpGet, PDA_httpPost } = window;
|
|
||||||
// get
|
|
||||||
if (method === 'get') {
|
|
||||||
if (typeof PDA_httpGet !== 'function') {
|
|
||||||
Log.error('COFetch网络错误:PDA版本不支持');
|
|
||||||
reject('COFetch网络错误:PDA版本不支持');
|
|
||||||
}
|
|
||||||
PDA_httpGet(url)
|
|
||||||
.then(res => resolve(res.responseText))
|
|
||||||
.catch(e => {
|
|
||||||
Log.error('COFetch网络错误', e);
|
|
||||||
reject(`COFetch网络错误 ${ e }`);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// post
|
|
||||||
else {
|
|
||||||
if (typeof PDA_httpPost !== 'function') {
|
|
||||||
Log.error('COFetch网络错误:PDA版本不支持');
|
|
||||||
reject('COFetch网络错误:PDA版本不支持');
|
|
||||||
}
|
|
||||||
PDA_httpPost(url, { 'content-type': 'application/json' }, body)
|
|
||||||
.then(res => resolve(res.responseText))
|
|
||||||
.catch(e => {
|
|
||||||
Log.error('COFetch网络错误', e);
|
|
||||||
reject(`COFetch网络错误 ${ e }`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case UserScriptEngine.GM: {
|
|
||||||
let { GM_xmlhttpRequest } = window;
|
|
||||||
if (typeof GM_xmlhttpRequest !== 'function') {
|
|
||||||
Log.error('COFetch网络错误:用户脚本扩展API错误');
|
|
||||||
reject('错误:用户脚本扩展API错误');
|
|
||||||
}
|
|
||||||
GM_xmlhttpRequest({
|
|
||||||
method: method,
|
|
||||||
url: url,
|
|
||||||
data: method === 'get' ? null : body,
|
|
||||||
headers: method === 'get' ? null : { 'content-type': 'application/json' },
|
|
||||||
onload: res => resolve(res.response),
|
|
||||||
onerror: res => reject(`连接错误 ${ JSON.stringify(res) }`),
|
|
||||||
ontimeout: res => reject(`连接超时 ${ JSON.stringify(res) }`),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
import Log from "../../../class/Log";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function addActionBtn(txt: string, func: (ev: Event) => void, mainBtnNode: Element): void {
|
|
||||||
addActionBtn.proxy(txt, func, mainBtnNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
addActionBtn.proxy = (txt: string, func: (ev: Event) => void, mainBtnNode: Element) => {
|
|
||||||
if (mainBtnNode.querySelector('#wh-trans-icon-btn').nextSibling !== null) return;
|
|
||||||
let btn = document.createElement('button');
|
|
||||||
btn.style.padding = '8px 13px 8px 0';
|
|
||||||
btn.style.verticalAlign = 'bottom';
|
|
||||||
btn.style.color = '#4CAF50';
|
|
||||||
btn.innerHTML = txt;
|
|
||||||
btn.addEventListener('click', func);
|
|
||||||
mainBtnNode.querySelector('button').after(btn);
|
|
||||||
addActionBtn.proxy = () => {
|
|
||||||
Log.error('错误:附加按钮已存在')
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
import log from "./log";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function addStyle(css: string) {
|
|
||||||
let wh_gStyle = document.querySelector('style#wh-trans-gStyle');
|
|
||||||
if (wh_gStyle) {
|
|
||||||
wh_gStyle.innerHTML += css;
|
|
||||||
} else {
|
|
||||||
wh_gStyle = document.createElement("style");
|
|
||||||
wh_gStyle.id = 'wh-trans-gStyle';
|
|
||||||
wh_gStyle.innerHTML = css;
|
|
||||||
document.head.append(wh_gStyle);
|
|
||||||
}
|
|
||||||
log.info('CSS规则已添加', wh_gStyle);
|
|
||||||
}
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
import elementReady from "../elementReady";
|
|
||||||
import log from "./log";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default async function getSidebarData() {
|
|
||||||
let ret = {};
|
|
||||||
let sidebar_id = null;
|
|
||||||
|
|
||||||
let sessionKeys = Object.keys(sessionStorage);
|
|
||||||
if (sessionKeys.length < 2) {
|
|
||||||
// dom获取
|
|
||||||
let sidebar_menu_list = document.querySelectorAll('#sidebar a span[class*="linkName___"]');
|
|
||||||
log.info({ sidebar_menu_list })
|
|
||||||
if (sidebar_menu_list.length === 0) {
|
|
||||||
// TODO 当前根据侧边栏等待 sessionData
|
|
||||||
await elementReady('#sidebar a span[class*="linkName___"]');
|
|
||||||
sidebar_menu_list = document.querySelectorAll('#sidebar a span[class*="linkName___"]');
|
|
||||||
}
|
|
||||||
sidebar_menu_list.forEach(node => ret[node.innerHTML.trim().toLowerCase().replaceAll(' ', '_')] = true);
|
|
||||||
} else {
|
|
||||||
// session storage获取
|
|
||||||
for (let key of sessionKeys) {
|
|
||||||
if (key.startsWith('sidebarData')) {
|
|
||||||
sidebar_id = JSON.parse(sessionStorage.getItem(key));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (sidebar_id !== null) {
|
|
||||||
for (let area of Object.keys(sidebar_id['areas'])) {
|
|
||||||
ret[area] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.info({ ret, sidebar_id, sessionKeys })
|
|
||||||
if (Object.keys(ret).length === 0) {
|
|
||||||
log.error('无法获取数据,建议刷新重试');
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
import getWhSettingObj from "../getWhSettingObj";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
function debug() {
|
|
||||||
try {
|
|
||||||
return getWhSettingObj()['isDev'] || false;
|
|
||||||
} catch (e) {
|
|
||||||
console.error(`[wh] dev状态错误 ${ e }`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
const log = {
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
error: (...o) => (debug()) && (console.error('[WH]', ...o)),
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
info: (...o) => (debug()) && (console.log('[WH]', ...o)),
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
debug,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default log
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
import WuhuBase from "../../../class/WuhuBase";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 使用new Popup()
|
|
||||||
*/
|
|
||||||
export default function popupMsg(innerHTML, title = '芜湖助手') {
|
|
||||||
let glob = WuhuBase.glob;
|
|
||||||
if (glob.popup_node) glob.popup_node.close();
|
|
||||||
const chatRoot = document.querySelector('#chatRoot');
|
|
||||||
chatRoot.classList.add('wh-hide');
|
|
||||||
const popup = document.createElement('div');
|
|
||||||
popup.id = 'wh-popup';
|
|
||||||
popup.innerHTML = `<div id="wh-popup-container">
|
|
||||||
<div id="wh-popup-title"><p>${ title }</p></div>
|
|
||||||
<div id="wh-popup-cont">${ innerHTML }</div>
|
|
||||||
</div>`;
|
|
||||||
document.body.append(popup);
|
|
||||||
const rt: MyHTMLElement = popup.querySelector('#wh-popup-cont');
|
|
||||||
rt.close = function () {
|
|
||||||
popup.remove();
|
|
||||||
chatRoot.classList.remove('wh-hide');
|
|
||||||
}
|
|
||||||
popup.addEventListener('click', e => {
|
|
||||||
e.stopImmediatePropagation();
|
|
||||||
if (e.target === popup) rt.close();
|
|
||||||
});
|
|
||||||
glob.popup_node = rt;
|
|
||||||
return rt;
|
|
||||||
}
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
import audioPlay from "./audioPlay";
|
|
||||||
import MathUtils from "../../class/utils/MathUtils";
|
|
||||||
import Alert from "../../class/utils/Alert";
|
|
||||||
import InfoUtils from "../../class/utils/InfoUtils";
|
|
||||||
import WuhuConfig from "../../class/WuhuConfig";
|
|
||||||
import Log from "../../class/Log";
|
|
||||||
|
|
||||||
// 啤酒
|
|
||||||
export default function BuyBeer() {
|
|
||||||
// 正在通知
|
|
||||||
let is_notified = false;
|
|
||||||
let time: number = WuhuConfig.get('_15AlarmTime') || 30;
|
|
||||||
let loop: BeerMonitorLoop = {};
|
|
||||||
// 循环id
|
|
||||||
let started = null;
|
|
||||||
loop.start = () => {
|
|
||||||
if (started) {
|
|
||||||
Log.info('啤酒助手已在运行');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
started = setInterval(async () => {
|
|
||||||
// 海外取消提醒
|
|
||||||
let { isTravelling, isAbroad } = await InfoUtils.getInstance().getUserState();
|
|
||||||
if (isTravelling || isAbroad) {
|
|
||||||
loop.stop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let dt = new Date();
|
|
||||||
// 已选当天不提醒
|
|
||||||
const now = [dt.getUTCFullYear(), dt.getUTCMonth(), dt.getUTCDate()];
|
|
||||||
const ignore_date = WuhuConfig.get('_15_alarm_ignore') || '{}';
|
|
||||||
if (JSON.stringify(now) === JSON.stringify(ignore_date)) return;
|
|
||||||
// 正常提醒
|
|
||||||
let m = 14 - (dt.getMinutes() % 15);
|
|
||||||
let s = 60 - dt.getSeconds();
|
|
||||||
if (m === 0 && s < time) {
|
|
||||||
// 如从通知点开,则本次通知跳过
|
|
||||||
if (location.href.includes('#clickfromnotify')) {
|
|
||||||
is_notified = true;
|
|
||||||
location.hash = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 本次已通知
|
|
||||||
if (is_notified) return;
|
|
||||||
is_notified = true;
|
|
||||||
// 发送通知
|
|
||||||
const notify = new Alert(notify_html, {
|
|
||||||
timeout: 30,
|
|
||||||
sysNotify: true,
|
|
||||||
});
|
|
||||||
notify.getElement().querySelector('.wh-notify-msg button').addEventListener('click', () => loop.skip_today);
|
|
||||||
notify.getElement().addEventListener('click', ev => {
|
|
||||||
if ((ev.target as HTMLElement).tagName.toLowerCase() === 'a') {
|
|
||||||
// notify.sys_notify.close();
|
|
||||||
notify.close();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.setTimeout(audioPlay, 800);
|
|
||||||
window.setTimeout(audioPlay, 800 * 2);
|
|
||||||
window.setTimeout(audioPlay, 800 * 3);
|
|
||||||
} else {
|
|
||||||
is_notified = false;
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
};
|
|
||||||
loop.stop = () => {
|
|
||||||
if (started) {
|
|
||||||
clearInterval(started);
|
|
||||||
started = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
loop.set_time = (t) => time = t;
|
|
||||||
loop.status = () => started ? '已启动' : '未启动';
|
|
||||||
loop.is_running = () => !!started;
|
|
||||||
|
|
||||||
let mathUtils: MathUtils = MathUtils.getInstance();
|
|
||||||
let notify_html = `<span style="background-color:green;color:white;border-radius:3px;font-size:14px;line-height:21px;padding:2px 4px;">啤酒小助手</span><br/>提醒您:还有不到 50 秒 NPC 的商品就要刷新了,啤酒血包要抢的可以准备咯。<button id="wh-rd-btn-${ mathUtils.getRandomInt(0, 100) }">【今日不再提醒】</button><br/><a href="/shops.php?step=bitsnbobs#clickfromnotify" target="_blank">【啤酒店】</a> <a href="/shops.php?step=pharmacy#clickfromnotify" target="_blank">【血包店】</a>`
|
|
||||||
loop.skip_today = () => {
|
|
||||||
const date = new Date();
|
|
||||||
WuhuConfig.set('_15_alarm_ignore', [date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()], false);
|
|
||||||
// 通知
|
|
||||||
const notify = new Alert(`明早8点前将不再提醒 <button id="wh-rd-btn-${ mathUtils.getRandomInt(0, 100) }">取消</button>`);
|
|
||||||
// 通知中的取消按钮
|
|
||||||
notify.getElement().querySelector('.wh-notify-msg button').addEventListener('click', () => WuhuConfig.set('_15_alarm_ignore', undefined));
|
|
||||||
};
|
|
||||||
return loop;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BeerMonitorLoop {
|
|
||||||
start?: Function;
|
|
||||||
stop?: Function;
|
|
||||||
set_time?: Function;
|
|
||||||
status?: Function;
|
|
||||||
is_running?: Function;
|
|
||||||
skip_today?: Function;
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
export default function (obj1, obj2) {
|
|
||||||
return JSON.stringify(obj1) === JSON.stringify(obj2)
|
|
||||||
}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/**
|
|
||||||
* 解析 Markdown 内容
|
|
||||||
* @param {String} from
|
|
||||||
* @param {Number} max_line 最大行数,默认500
|
|
||||||
* @returns {HTMLDivElement}
|
|
||||||
*/
|
|
||||||
export default function mdParse(from: string, max_line?: number): HTMLElement {
|
|
||||||
max_line = max_line || 500;
|
|
||||||
const base = document.createElement('div');
|
|
||||||
let lines = from.split('\n');
|
|
||||||
if (lines.length > max_line) {
|
|
||||||
lines = lines.slice(0, max_line);
|
|
||||||
lines.push("...");
|
|
||||||
}
|
|
||||||
|
|
||||||
let prev = '';
|
|
||||||
let child_cont;
|
|
||||||
lines.forEach(line => {
|
|
||||||
if (line.trim() === '') return;
|
|
||||||
let node;
|
|
||||||
let spl = line.split(' ');
|
|
||||||
let md_flag = spl[0];
|
|
||||||
|
|
||||||
switch (md_flag) {
|
|
||||||
// 标题
|
|
||||||
case '#':
|
|
||||||
case '##':
|
|
||||||
case '###':
|
|
||||||
if (prev === 'li') {
|
|
||||||
child_cont = null;
|
|
||||||
}
|
|
||||||
prev = 'h' + (md_flag.length + 1);
|
|
||||||
node = document.createElement(prev);
|
|
||||||
node.innerText = line.slice(md_flag.length + 1);
|
|
||||||
base.append(node);
|
|
||||||
return;
|
|
||||||
// 列表
|
|
||||||
case '-':
|
|
||||||
if (prev !== 'li') {
|
|
||||||
child_cont = document.createElement('ul');
|
|
||||||
if (!base.contains(child_cont)) base.append(child_cont);
|
|
||||||
}
|
|
||||||
prev = 'li';
|
|
||||||
node = document.createElement(prev);
|
|
||||||
node.innerText = line.slice(2);
|
|
||||||
child_cont.append(node);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
prev = 'p';
|
|
||||||
node = document.createElement(prev);
|
|
||||||
node.innerText = line.trim();
|
|
||||||
base.append(node);
|
|
||||||
})
|
|
||||||
return base;
|
|
||||||
}
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
import addStyle from "./@deprecated/addStyle";
|
|
||||||
import WuhuBase from "../../class/WuhuBase";
|
|
||||||
import MathUtils from "../../class/utils/MathUtils";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通知方法
|
|
||||||
* @param {string} msg - 通知内容
|
|
||||||
* @param {Object} [options] - 通知选项
|
|
||||||
* @param {number} [options.timeout] - 通知超时时间
|
|
||||||
* @param {function} [options.callback] - 通知回调
|
|
||||||
* @param {boolean} [options.sysNotify] - 是否开启系统通知
|
|
||||||
* @param {string} [options.sysNotifyTag] - 系统通知标记
|
|
||||||
* @param {function} [options.sysNotifyClick] - 系统通知点击事件
|
|
||||||
* @return {HTMLElement}
|
|
||||||
*/
|
|
||||||
export default function WHNotify(msg: string, options: WHNotifyOpt = {}): MyHTMLElement {
|
|
||||||
let { isWindowActive, notifies } = WuhuBase.glob;
|
|
||||||
let mathUtils: MathUtils = MathUtils.getInstance();
|
|
||||||
|
|
||||||
let {
|
|
||||||
timeout = 3,
|
|
||||||
callback = function () {
|
|
||||||
},
|
|
||||||
sysNotify = false,
|
|
||||||
sysNotifyTag = '芜湖助手',
|
|
||||||
sysNotifyClick = () => window.focus()
|
|
||||||
} = options;
|
|
||||||
|
|
||||||
if (!isWindowActive.get() || (self !== top)) return null;
|
|
||||||
const date = new Date();
|
|
||||||
// 通知的唯一id
|
|
||||||
const uid = `${ date.getHours() }${ date.getSeconds() }${ date.getMilliseconds() }${ mathUtils.getRandomInt(1000, 9999) }`;
|
|
||||||
// 通知容器id
|
|
||||||
// 通知的容器
|
|
||||||
let notify_contain: MyHTMLElement = document.querySelector(`#wh-notify`);
|
|
||||||
// 添加通知到容器
|
|
||||||
const add_notify = () => {
|
|
||||||
// 每条通知
|
|
||||||
const new_node: MyHTMLElement = document.createElement('div');
|
|
||||||
new_node.id = `wh-notify-${ uid }`;
|
|
||||||
new_node.classList.add('wh-notify-item');
|
|
||||||
new_node.innerHTML = `<div class="wh-notify-bar"></div>
|
|
||||||
<div class="wh-notify-cont">
|
|
||||||
<div class="wh-notify-close"></div>
|
|
||||||
<div class="wh-notify-msg"><p>${ msg }</p></div>
|
|
||||||
</div>`;
|
|
||||||
notify_contain.append(new_node);
|
|
||||||
notify_contain['msgInnerText'] = new_node.querySelector('.wh-notify-msg').innerText;
|
|
||||||
// 进度条node
|
|
||||||
const progressBar: HTMLElement = new_node.querySelector('.wh-notify-bar');
|
|
||||||
// 是否hover
|
|
||||||
let mouse_enter = false;
|
|
||||||
new_node.addEventListener('mouseenter', () => mouse_enter = true, true);
|
|
||||||
new_node.addEventListener('mouseleave', () => mouse_enter = false);
|
|
||||||
// 通知进度条
|
|
||||||
let progressCount = 101;
|
|
||||||
// 删除通知
|
|
||||||
new_node.close = () => {
|
|
||||||
clearInterval(intervalID);
|
|
||||||
new_node.remove();
|
|
||||||
callback();
|
|
||||||
};
|
|
||||||
// 计时器
|
|
||||||
let intervalID = window.setInterval(() => {
|
|
||||||
if (mouse_enter) {
|
|
||||||
progressCount = 101;
|
|
||||||
progressBar.style.width = '100%';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
progressCount--;
|
|
||||||
progressBar.style.width = `${ progressCount }%`;
|
|
||||||
if (progressCount === 0) new_node.remove();
|
|
||||||
}, timeout * 1000 / 100);
|
|
||||||
new_node.querySelector('.wh-notify-close').addEventListener('click', new_node.close);
|
|
||||||
return new_node;
|
|
||||||
};
|
|
||||||
// 不存在容器 创建
|
|
||||||
if (!notify_contain) {
|
|
||||||
notify_contain = document.createElement('div');
|
|
||||||
notify_contain.id = 'wh-notify';
|
|
||||||
addStyle(`
|
|
||||||
#wh-notify {
|
|
||||||
display: inline-block;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: calc(50% - 180px);
|
|
||||||
width: 360px;
|
|
||||||
z-index: 9999990;
|
|
||||||
color:#333;
|
|
||||||
}
|
|
||||||
#wh-notify a{
|
|
||||||
color:red;
|
|
||||||
text-decoration:none;
|
|
||||||
}
|
|
||||||
#wh-notify .wh-notify-item {
|
|
||||||
/*height: 50px;*/
|
|
||||||
background: rgb(239 249 255 / 90%);
|
|
||||||
border-radius: 2px;
|
|
||||||
margin: 0.5em 0 0 0;
|
|
||||||
box-shadow: 0 0 5px 0px #959595;
|
|
||||||
}
|
|
||||||
#wh-notify .wh-notify-item:hover {
|
|
||||||
background: rgb(239 249 255 / 98%);
|
|
||||||
}
|
|
||||||
#wh-notify .wh-notify-item .wh-notify-bar {
|
|
||||||
height:2px;
|
|
||||||
background:#2196f3;
|
|
||||||
}
|
|
||||||
#wh-notify .wh-notify-item .wh-notify-close {
|
|
||||||
float:right;
|
|
||||||
padding:0;
|
|
||||||
width:16px;height:16px;
|
|
||||||
background:url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%201024%201024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M923%20571H130.7c-27.6%200-50-22.4-50-50s22.4-50%2050-50H923c27.6%200%2050%2022.4%2050%2050s-22.4%2050-50%2050z%22%20fill%3D%22%232196f3%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E') no-repeat center;
|
|
||||||
background-size:100%;
|
|
||||||
margin: 6px 6px 0 0;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
#wh-notify .wh-notify-item .wh-notify-msg {
|
|
||||||
padding:12px;
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
document.body.append(notify_contain);
|
|
||||||
}
|
|
||||||
const notify_obj = add_notify();
|
|
||||||
// 浏览器通知
|
|
||||||
if (window.Notification && Notification.permission === 'granted' && sysNotify) {
|
|
||||||
const date_local_string = `[${ date.getHours() }:${ date.getMinutes() }:${ date.getSeconds() }]\r`;
|
|
||||||
notify_obj.sys_notify = new Notification('芜湖助手', {
|
|
||||||
body: date_local_string + notify_contain.msgInnerText,
|
|
||||||
requireInteraction: true,
|
|
||||||
renotify: true,
|
|
||||||
tag: sysNotifyTag + mathUtils.getRandomInt(0, 99),
|
|
||||||
});
|
|
||||||
notify_obj.sys_notify.addEventListener('close', () => sysNotifyClick());
|
|
||||||
notify_obj.sys_notify.onshow = () => setTimeout(() => notify_obj.sys_notify.close(), timeout * 1000);
|
|
||||||
notify_obj.sys_notify.id = notifies.count++;
|
|
||||||
notifies[notify_obj.sys_notify.id] = notify_obj.sys_notify;
|
|
||||||
notify_obj.sys_notify.addEventListener('close', () => notifies[notify_obj.sys_notify.id] = null);
|
|
||||||
}
|
|
||||||
return notify_obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WHNotifyOpt {
|
|
||||||
timeout?: number;
|
|
||||||
callback?: Function;
|
|
||||||
sysNotify?: boolean;
|
|
||||||
sysNotifyTag?: string;
|
|
||||||
sysNotifyClick?: Function;
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function ajaxFetch(opt) {
|
|
||||||
let { url, referrer, method, body = null } = opt;
|
|
||||||
let req_params: AjaxFetchOpt = {
|
|
||||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
|
||||||
referrer,
|
|
||||||
method,
|
|
||||||
};
|
|
||||||
if (method === 'POST') {
|
|
||||||
req_params.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
|
|
||||||
req_params.body = body;
|
|
||||||
}
|
|
||||||
return fetch(url, req_params);
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AjaxFetchOpt {
|
|
||||||
headers: { 'X-Requested-With'?: string, 'Content-Type'?: string };
|
|
||||||
referrer: string;
|
|
||||||
method: string;
|
|
||||||
body?: any;
|
|
||||||
}
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
import CommonUtils from "../../class/utils/CommonUtils";
|
|
||||||
import WuhuBase from "../../class/WuhuBase";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 循环获取json对象
|
|
||||||
* @param dest
|
|
||||||
* @param time
|
|
||||||
*/
|
|
||||||
function autoFetchJSON(dest, time = 30) {
|
|
||||||
let obj;
|
|
||||||
const res = CommonUtils.COFetch(dest);
|
|
||||||
setInterval(async () => {
|
|
||||||
if (!WuhuBase.glob.isWindowActive.get()) return;
|
|
||||||
const res = await CommonUtils.COFetch(dest);
|
|
||||||
obj = JSON.parse(res);
|
|
||||||
}, time * 1000);
|
|
||||||
return {
|
|
||||||
get: async function () {
|
|
||||||
if (!obj) {
|
|
||||||
const str = await res
|
|
||||||
return obj = JSON.parse(str);
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
import UserScriptEngine from "../../enum/UserScriptEngine";
|
|
||||||
import WuhuBase from "../../class/WuhuBase";
|
|
||||||
import CommonUtils from "../../class/utils/CommonUtils";
|
|
||||||
import InfoUtils from "../../class/utils/InfoUtils";
|
|
||||||
import Popup from "../../class/utils/Popup";
|
|
||||||
import * as FILTER from "../../json/ForStockItemFilter.json";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default async function forStock() {
|
|
||||||
if (InfoUtils.getInstance().getScriptEngine() === UserScriptEngine.RAW) {
|
|
||||||
const insert = `<img alt="stock.png" src="https://jjins.github.io/t2i/stock.png?{{}}" style="max-width:100%;display:block;margin:0 auto;" />`;
|
|
||||||
new Popup(insert, '飞花库存');
|
|
||||||
} else {
|
|
||||||
const popup = new Popup(`请稍后${ CommonUtils.loading_gif_html() }`, '飞花库存');
|
|
||||||
let table = `<table><tr><th colspan="2">目的地 - 更新时间</th><th colspan="3">库存</th></tr>`;
|
|
||||||
const dest = FILTER;
|
|
||||||
const now = new Date();
|
|
||||||
const res = await WuhuBase.glob.fStock.get();
|
|
||||||
if (!res['stocks']) return;
|
|
||||||
dest.forEach(el => {
|
|
||||||
const update = (now.getTime() - new Date(res.stocks[el.name]['update'] * 1000).getTime()) / 1000 | 0
|
|
||||||
table += `<tr><td>${ el.show }</td><td>${ update / 60 | 0 }分${ update % 60 | 0 }秒前</td>`;
|
|
||||||
let count = 0;
|
|
||||||
res.stocks[el.name]['stocks'].forEach(stock => {
|
|
||||||
if (el.stocks[stock.name]) {
|
|
||||||
table += `<td${ stock['quantity'] === 0 ? ' style="background-color:#f44336;color:white;border-color:#000;"' : '' }>${ el.stocks[stock.name] } (${ stock['quantity'] })</td>`;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
while (count < 3) {
|
|
||||||
count++;
|
|
||||||
table += '<td></td>';
|
|
||||||
}
|
|
||||||
table += '</tr>';
|
|
||||||
});
|
|
||||||
table += '</table>';
|
|
||||||
popup.getElement().innerHTML = table;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
import UserScriptEngine from "../../enum/UserScriptEngine";
|
|
||||||
import WuhuBase from "../../class/WuhuBase";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function getScriptEngine() {
|
|
||||||
let glob = WuhuBase.glob;
|
|
||||||
return glob.unsafeWindow ? UserScriptEngine.GM : glob.isPDA
|
|
||||||
? UserScriptEngine.PDA : UserScriptEngine.RAW;
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function getUserState(): {} | any {
|
|
||||||
let obj = {};
|
|
||||||
let hdd = sessionStorage['headerData'];
|
|
||||||
if (hdd) obj = JSON.parse(hdd)['user']['state'];
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function getWhSettingObj(): WHSettings {
|
|
||||||
return JSON.parse(localStorage.getItem('wh_trans_settings')) || {}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WHSettings {
|
|
||||||
// TODO 补全
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import getWhSettingObj from "./getWhSettingObj";
|
|
||||||
import Alert from "../../class/utils/Alert";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default function setWhSetting(key: string, value: any, notify: boolean = true) {
|
|
||||||
const obj = getWhSettingObj()
|
|
||||||
obj[key] = value
|
|
||||||
localStorage.setItem('wh_trans_settings', JSON.stringify(obj))
|
|
||||||
|
|
||||||
// 通知
|
|
||||||
if (notify) new Alert('已保存设置')
|
|
||||||
}
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
<div class="acc-title">
|
|
||||||
<span class="item-desc">
|
|
||||||
<span tabindex="0" aria-labelledby="180-name 180-price 180-stock" class="item Alcohol" itemid="180" loaded="0">
|
|
||||||
<img class="torn-item item-plate" data-size="large" src="/images/items/180/large.png" alt="Bottle of Beer"
|
|
||||||
style="opacity: 0;" id="item-1bea9f66-a6c4-475c-accb-41dcb67af64f-old" data-converted="1" aria-hidden="true">
|
|
||||||
<span class="item-hover">
|
|
||||||
<button class="view-h wai-btn" aria-label="Show info: Bottle of Beer" value="100" i-data="i_723_228_51_52"></button>
|
|
||||||
<button class="buy-h wai-btn" aria-label="Buy: Bottle of Beer" value="100" i-data="i_774_228_51_52"></button>
|
|
||||||
</span>
|
|
||||||
<canvas id="item-1bea9f66-a6c4-475c-accb-41dcb67af64f" role="img" aria-label="Bottle of Beer" style="opacity: 1;"
|
|
||||||
class="torn-item item-plate item-converted" item-mode="light" width="100" height="50"></canvas></span>
|
|
||||||
<span class="desc">
|
|
||||||
<span id="180-name" class="name t-overflow bold">啤酒</span>
|
|
||||||
<span id="180-price" class="price t-gray-6" data-sell="$5">$10</span>
|
|
||||||
<span id="180-stock" class="stock t-gray-6 t-overflow">酒 (<span class="instock">1100</span>存货)</span>
|
|
||||||
</span>
|
|
||||||
<span class="buy-act-wrap">
|
|
||||||
<label for="180" class="wai">Amount
|
|
||||||
of Bottle of Beer</label>
|
|
||||||
<input id="180" type="text" value="100" maxlength="3" name="buyAmount[]" autocomplete="new-amount">
|
|
||||||
<span class="buy-act bold">
|
|
||||||
<button class="wai-support t-blue h">买</button>
|
|
||||||
<div class="tt-max-buy-overlay"></div>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<div class="confirm-wrap">
|
|
||||||
<span class="confirm">
|
|
||||||
<span>
|
|
||||||
点击确定购买
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<span class="count">100</span>
|
|
||||||
瓶啤酒
|
|
||||||
$<span class="total">1,000</span>
|
|
||||||
</span>
|
|
||||||
<span class="confirm-act m-top5">
|
|
||||||
<a href="#" class="wai-support yes m-right10 bold t-blue h" data-id="180" i-data="i_819_263_23_16">
|
|
||||||
确定
|
|
||||||
</a>
|
|
||||||
<span class="no bold">
|
|
||||||
<a href="#" class="wai-support t-blue h" i-data="i_852_263_18_16">
|
|
||||||
不
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="success-wrap">
|
|
||||||
<span class="success">
|
|
||||||
<span class="t-red bold">
|
|
||||||
<span class="ajax-preloader"></span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<button aria-label="Close" class="close-icon p0 wai-btn" value="100" i-data="i_954_228_10_11"></button>
|
|
||||||
</div>
|
|
||||||
<div class="msg-wrap">
|
|
||||||
<span class="t-green bold">
|
|
||||||
<span class="ajax-preloader"></span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="view-item-info">
|
|
||||||
<div class="item-cont">
|
|
||||||
<div class="item-wrap">
|
|
||||||
<span class="ajax-preloader m-top10 m-bottom10"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
<div id="wh-loot-container" class="m-bottom10">
|
|
||||||
<audio src="https://www.torn.com/js/chat/sounds/Chirp_3.mp3" style="display:none"></audio>
|
|
||||||
<div class="title-black"><span>附近物品</span></div>
|
|
||||||
<div id="wh-loot-container-main" class="cont-gray">
|
|
||||||
<b>物品</b><span id="wh-loot-item-count"></span>
|
|
||||||
<div id="wh-loot-container-items"></div>
|
|
||||||
<b>箱子</b><span id="wh-loot-chest-count"></span>
|
|
||||||
<div id="wh-loot-container-chests"></div>
|
|
||||||
</div>
|
|
||||||
<div id="wh-loot-container-ex" class="cont-gray wh-hide">
|
|
||||||
<div><label><input type="checkbox" id="wh-loot-setting-blink" {{}} /> 闪烁提示</label></div>
|
|
||||||
<div><label><input type="checkbox" id="wh-loot-setting-sound" {{}} /> 声音提示 <del>(iOS)</del></label></div>
|
|
||||||
<div><label><input type="checkbox" id="wh-loot-setting-chest" {{}} /> 不记录需要钥匙的宝箱</label></div>
|
|
||||||
<div id="wh-hist">
|
|
||||||
<div id="wh-hist-clear">
|
|
||||||
<p><button>清空数据</button>- 长时间不清空会出现奇怪的问题</p>
|
|
||||||
</div>
|
|
||||||
<table><thead><tr><th colspan="5">历史记录</th></tr><tr><th>坐标</th><th>地图</th><th>类型</th><th>发现</th><th>获取</th></tr></thead><tbody></tbody></table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="wh-loot-btn" class="cont-gray"><button>设置</button></div>
|
|
||||||
</div>
|
|
||||||
<style>
|
|
||||||
#wh-loot-container-main{padding: 0.5em;}
|
|
||||||
#wh-loot-container-main div{overflow-x: auto;overflow-y: hidden;white-space: nowrap;min-height: 4em;}
|
|
||||||
#wh-loot-container-main div span{display: inline-block;background-color: #2e8b57;color: white;margin: 0 1em 0 0;border-radius: 4px;padding: 0.5em;}
|
|
||||||
#wh-loot-container-main div span img{height: 1em; width: 1em;}
|
|
||||||
#wh-loot-container-ex{padding: 0.5em;}
|
|
||||||
#wh-loot-container-ex.wh-hide{display: none;}
|
|
||||||
#wh-loot-container-ex #wh-hist{overflow-x: auto;}
|
|
||||||
#wh-loot-container-ex table {margin-top: 0.5em;}
|
|
||||||
#wh-loot-container-ex tbody {background-color: antiquewhite;}
|
|
||||||
#wh-loot-container-ex table, #wh-loot-container-ex th, #wh-loot-container-ex td {
|
|
||||||
padding: 5px;
|
|
||||||
border: 1px solid black;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
#wh-loot-container-ex th:nth-child(1) {min-width: 5em;}
|
|
||||||
#wh-loot-container-ex th:nth-child(2) {min-width: 8em;}
|
|
||||||
#wh-loot-container-ex th:nth-child(3) {min-width: 4em;}
|
|
||||||
#wh-loot-container-ex th:nth-child(4) {min-width: 9em;}
|
|
||||||
#wh-loot-container-ex th:nth-child(5) {min-width: 3em;}
|
|
||||||
#wh-loot-container-ex thead {
|
|
||||||
background-color: #2e8b57;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
@keyframes lootFoundAlert {
|
|
||||||
0% {background: #f2f2f2}
|
|
||||||
50% {background: #2e8b57}
|
|
||||||
100% {background: #f2f2f2}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
import Starter from "./class/provider/Starter";
|
|
||||||
import Application from "./class/Application";
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
Starter.run(Application)
|
|
||||||
})();
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"css": ".wh-hide{display:none;}#wh-trans-icon{user-select:none;display: inline-block;position: fixed;top:5px;left:5px;z-index:100010;border-radius:4px;max-width: 220px;box-shadow: 0 0 3px 1px #8484848f;}div#effectiveness-wrap{overflow-y:hidden;}@media screen and (max-width: 600px) { #wh-trans-icon{top:0;left:112px;} /* 冰蛙公司效率表 */ div#effectiveness-wrap { margin-left: -80px; margin-right: -76px; }}#wh-trans-icon select{width:110px;}#wh-trans-icon a {text-decoration: none;color: #006599;background: none;}#wh-trans-icon:not(.wh-icon-expanded):hover {background: #f8f8f8;}#wh-trans-icon button{margin:0;padding:0;border:0;cursor:pointer;}#wh-inittimer{margin-top:6px;color:#b0b0b0;}#wh-gSettings div{margin: 4px 0;}#wh-trans-icon .wh-container{margin:0;padding:0 16px 16px;border:0;}#wh-trans-icon-btn{height:16px;width:16px;background: url('data:image/svg+xml;utf8,<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\"><path d=\"M160 144a32 32 0 0 0-32 32V864a32 32 0 0 0 32 32h688a32 32 0 0 0 32-32V176a32 32 0 0 0-32-32H160z m0-64h688a96 96 0 0 1 96 96V864a96 96 0 0 1-96 96H160a96 96 0 0 1-96-96V176a96 96 0 0 1 96-96z\"/><path d=\"M482.176 262.272h59.616v94.4h196v239.072h-196v184.416h-59.616v-184.416H286.72v-239.04h195.456V262.24z m-137.504 277.152h137.504v-126.4H344.64v126.4z m197.12 0h138.048v-126.4H541.76v126.4z\"/></svg>') no-repeat center;padding:16px !important;}#wh-trans-icon .wh-container{display:none;}#wh-trans-icon.wh-icon-expanded .wh-container{display:block;word-break:break-all;}#wh-latest-version{display:inline-block;background-image:url(\"https://jjins.github.io/t2i/version.png?${ performance.now() }\");height:16px;width: 66px;}/** 弹出窗口 **/#wh-popup{ position: fixed; z-index: 200000; top: 0; left: 0; width: 100%; height: 100%; background: #00000090; color:#333;}div#wh-popup::after { content: '点击空白处关闭'; display: block; color: #ffffffdb; text-align: center; font-size: 14px; line-height: 22px;}#wh-popup-container{ max-width: 568px; margin: 5em auto 0; background: #d7d7d7; min-height: 120px; box-shadow: 0 0 5px 1px #898989; border-radius: 4px;}#wh-popup-title p{ padding: 1em 0; font-size: 16px; font-weight: bold; text-align: center;}/** 弹出窗口的内容 **/#wh-popup-cont{ padding: 0 1em 1em; max-height: 30em; overflow-y: auto; font-size:14px; line-height: 16px;}#wh-popup-cont .gSetting > div{ display: inline-block; width: 47%; margin: 2px 0;}#wh-popup-cont .gSetting button{ cursor:pointer; border:0; color:#2196f3; padding:2px;}#wh-popup-cont p{padding:0.25em 0;}#wh-popup-cont a{color:red;text-decoration:none;}#wh-popup-cont li{margin:4px 0;}#wh-popup-cont h4{margin:0;padding: 0.5em 0;}#wh-popup-cont button{ margin: 0 4px 0 0; padding: 5px 8px; border: solid 2px black; color: black; border-radius: 3px;}#wh-popup-cont button[disabled]{opacity: 0.5;}#wh-popup-cont input{ padding: 2px; text-align: center; border: 1px solid #fff0; border-radius: 5px; margin:1px 2px;}#wh-popup-cont input:focus{border-color:blue;}#wh-popup-cont table{width:100%;border-collapse:collapse;border:1px solid;}#wh-popup-cont td, #wh-popup-cont th{border-collapse:collapse;padding:4px;border:1px solid;}.wh-display-none{display:none !important;}#wh-gym-info-cont{ background-color: #363636; color: white; padding: 8px; font-size: 15px; border-radius: 4px; text-shadow: 0 0 2px black; background-image: linear-gradient(90deg,transparent 50%,rgba(0,0,0,.07) 0); background-size: 4px; line-height: 20px;}#wh-gym-info-cont button{cursor:pointer;}#wh-notify { display: inline-block; position: fixed; top: 0; left: calc(50% - 180px); width: 360px; z-index: 9999990; color:#333;}#wh-notify a{color:red;text-decoration:none;}#wh-notify .wh-notify-item { /*height: 50px;*/ background: rgb(239 249 255 / 90%); border-radius: 2px; margin: 0.5em 0 0 0; box-shadow: 0 0 5px 0px #959595;}#wh-notify .wh-notify-item:hover { background: rgb(239 249 255 / 98%);}#wh-notify .wh-notify-item .wh-notify-bar { height:2px; background:#2196f3;}#wh-notify .wh-notify-item .wh-notify-close { float:right; padding:0;width:16px;height:16px;background:url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%201024%201024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M923%20571H130.7c-27.6%200-50-22.4-50-50s22.4-50%2050-50H923c27.6%200%2050%2022.4%2050%2050s-22.4%2050-50%2050z%22%20fill%3D%22%232196f3%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E') no-repeat center;background-size:100%;margin: 6px 6px 0 0;cursor: pointer;}#wh-notify .wh-notify-item .wh-notify-msg { padding:12px;}"
|
|
||||||
}
|
|
||||||
7
src/shims-vue.d.ts
vendored
Normal file
7
src/shims-vue.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
declare module '*.vue' {
|
||||||
|
import type { DefineComponent } from 'vue'
|
||||||
|
const component: DefineComponent<{}, {}, any>
|
||||||
|
export default component
|
||||||
|
}
|
||||||
|
/* eslint-enable */
|
||||||
82
src/static/css/attack_helper.module.css
Normal file
82
src/static/css/attack_helper.module.css
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
.wh-move-btn #defender div[class^="modal___"] {
|
||||||
|
display: block;
|
||||||
|
width: 0 !important;
|
||||||
|
left: -169px !important;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #defender div[class^="dialog___"] {
|
||||||
|
border: 0;
|
||||||
|
width: 159px;
|
||||||
|
height: 96px;
|
||||||
|
max-width: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #defender div[class^="colored___"] {
|
||||||
|
display: block;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #defender div[class^="title___"] {
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 此处限制宽度,否则人物模型图片会溢出遮挡武器栏 */
|
||||||
|
.wh-move-btn #defender div[class^="modelWrap___"] {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #defender button {
|
||||||
|
width: 100%;
|
||||||
|
margin: 17px 0;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 解决按钮图标负边距被上层元素限制遮挡问题 */
|
||||||
|
.wh-move-btn #defender div[class^="playerWindow___"] {
|
||||||
|
overflow: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 手机端 */
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
.wh-move-btn #attacker div[class^="playerWindow___"] {
|
||||||
|
overflow: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #attacker div[class^="modelWrap___"] {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #attacker div[class^="modal___"] {
|
||||||
|
display: block;
|
||||||
|
width: 0;
|
||||||
|
top: CSSVAR;
|
||||||
|
left: -80px;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #attacker div[class^="dialog___"] {
|
||||||
|
border: 0;
|
||||||
|
width: 80px;
|
||||||
|
/* torn的规则限制90% */
|
||||||
|
max-width: unset;
|
||||||
|
height: CSSVAR;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #attacker div[class^="colored___"] {
|
||||||
|
display: block;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #attacker div[class^="title___"] {
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-move-btn #attacker button {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
height: 63px;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
57
src/static/css/city_finder.module.css
Normal file
57
src/static/css/city_finder.module.css
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
.wh-city-finds .leaflet-marker-pane img[src*="torn.com/images/items/"] {
|
||||||
|
display: block !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 40px !important;
|
||||||
|
height: 40px !important;
|
||||||
|
left: -20px !important;
|
||||||
|
top: -20px !important;
|
||||||
|
padding: 10px 0;
|
||||||
|
border: none;
|
||||||
|
border-radius: 100%;
|
||||||
|
background-color: #d2d2d28c;
|
||||||
|
box-shadow: 0 0 10px 5px #000;
|
||||||
|
z-index: 999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-city-finds .leaflet-marker-pane.leaflet-marker-icon.user-item-pinpoint.leaflet-clickable {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#wh-city-finder-header{*/
|
||||||
|
/* background-color: #3f51b5;*/
|
||||||
|
/* color: white;*/
|
||||||
|
/* padding: 8px;*/
|
||||||
|
/* font-size: 15px;*/
|
||||||
|
/* border-radius: 4px 4px 0 0;*/
|
||||||
|
/* text-shadow: 0 0 2px black;*/
|
||||||
|
/* background-image: linear-gradient(90deg,transparent 50%,rgba(0,0,0,.07) 0);*/
|
||||||
|
/* background-size: 4px;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
|
/*#wh-city-finder{*/
|
||||||
|
/* box-shadow: 0 0 3px 0px #696969;*/
|
||||||
|
/* border-radius: 4px;*/
|
||||||
|
/*}*/
|
||||||
|
/*#wh-city-finder-cont{*/
|
||||||
|
/* background: #616161;*/
|
||||||
|
/* padding: 8px;*/
|
||||||
|
/* color: #c7c7c7;*/
|
||||||
|
/* border-radius: 0 0 4px 4px;*/
|
||||||
|
/* font-size: 13px;*/
|
||||||
|
/*}*/
|
||||||
|
/*#wh-city-finder-cont span{*/
|
||||||
|
/* margin:2px 4px 2px 0;*/
|
||||||
|
/* padding:2px;*/
|
||||||
|
/* border-radius:2px;*/
|
||||||
|
/* background:green;*/
|
||||||
|
/* color:white;*/
|
||||||
|
/* display:inline-block;*/
|
||||||
|
/*}*/
|
||||||
|
.wh-city-finder-item {
|
||||||
|
margin: 2px 4px 2px 0;
|
||||||
|
padding: 2px;
|
||||||
|
border-radius: 2px;
|
||||||
|
background: green;
|
||||||
|
color: white;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
292
src/static/css/common.module.css
Normal file
292
src/static/css/common.module.css
Normal file
@ -0,0 +1,292 @@
|
|||||||
|
.wh-hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon {
|
||||||
|
user-select: none;
|
||||||
|
display: inline-block;
|
||||||
|
position: fixed;
|
||||||
|
top: 5px;
|
||||||
|
left: 5px;
|
||||||
|
z-index: 100010;
|
||||||
|
border-radius: 4px;
|
||||||
|
max-width: 220px;
|
||||||
|
box-shadow: 0 0 3px 1px #8484848f;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#effectiveness-wrap {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
#wh-trans-icon {
|
||||||
|
top: 0;
|
||||||
|
left: 112px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 冰蛙公司效率表 */
|
||||||
|
div#effectiveness-wrap {
|
||||||
|
margin-left: -76px;
|
||||||
|
margin-right: -76px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon select {
|
||||||
|
width: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #006599;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon:not(.wh-icon-expanded):hover {
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon button {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-inittimer {
|
||||||
|
margin-top: 6px;
|
||||||
|
color: #b0b0b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-gSettings div {
|
||||||
|
margin: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon .wh-container {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 16px 16px;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon-btn {
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M160 144a32 32 0 0 0-32 32V864a32 32 0 0 0 32 32h688a32 32 0 0 0 32-32V176a32 32 0 0 0-32-32H160z m0-64h688a96 96 0 0 1 96 96V864a96 96 0 0 1-96 96H160a96 96 0 0 1-96-96V176a96 96 0 0 1 96-96z"/><path d="M482.176 262.272h59.616v94.4h196v239.072h-196v184.416h-59.616v-184.416H286.72v-239.04h195.456V262.24z m-137.504 277.152h137.504v-126.4H344.64v126.4z m197.12 0h138.048v-126.4H541.76v126.4z"/></svg>') no-repeat center;
|
||||||
|
padding: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon .wh-container {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trans-icon.wh-icon-expanded .wh-container {
|
||||||
|
display: block;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-icon-expanded {
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-cash-monitor {
|
||||||
|
margin: 4px 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-icon-expanded #wh-cash-monitor {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-latest-version {
|
||||||
|
display: inline-block;
|
||||||
|
background-image: url("https://jjins.github.io/t2i/version.png?{{}}");
|
||||||
|
height: 16px;
|
||||||
|
width: 66px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 弹出窗口 **/
|
||||||
|
#wh-popup {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 200000;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #00000090;
|
||||||
|
/*color: #333;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
div#wh-popup::after {
|
||||||
|
content: '点击空白处关闭';
|
||||||
|
display: block;
|
||||||
|
color: #ffffffdb;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-container {
|
||||||
|
max-width: 568px;
|
||||||
|
margin: 5em auto 0;
|
||||||
|
/*box-shadow: 0 0 5px 1px #898989;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-title p {
|
||||||
|
/*padding: 1em 0;*/
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 弹出窗口的内容 **/
|
||||||
|
#wh-popup-cont {
|
||||||
|
padding: 1em;
|
||||||
|
max-height: 30em;
|
||||||
|
overflow-y: auto;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 16px;
|
||||||
|
min-height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont .gSetting > div {
|
||||||
|
display: inline-block;
|
||||||
|
width: 47%;
|
||||||
|
margin: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#wh-popup-cont .gSetting button {*/
|
||||||
|
/* cursor: pointer;*/
|
||||||
|
/* border: 0;*/
|
||||||
|
/* color: #2196f3;*/
|
||||||
|
/* padding: 2px;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
|
#wh-popup-cont p {
|
||||||
|
padding: 0.25em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont a {
|
||||||
|
color: red;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont li {
|
||||||
|
margin: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont h4 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont button:not(.torn-btn) {
|
||||||
|
margin: 0 4px 0 0;
|
||||||
|
padding: 5px 8px;
|
||||||
|
border: solid 2px black;
|
||||||
|
color: black;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont button[disabled] {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont input {
|
||||||
|
padding: 2px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid #fff0;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin: 1px 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont input:focus {
|
||||||
|
border-color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont td, #wh-popup-cont th {
|
||||||
|
border-collapse: collapse;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-popup-cont textarea {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 4em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-display-none {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-gym-stack #gymroot {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-notify {
|
||||||
|
display: inline-block;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: calc(50% - 180px);
|
||||||
|
width: 360px;
|
||||||
|
z-index: 9999990;
|
||||||
|
color: #333;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-notify a, #wh-notify button { pointer-events: all; }
|
||||||
|
|
||||||
|
#wh-notify a {
|
||||||
|
color: red;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-notify .wh-notify-item { /*height: 50px;*/
|
||||||
|
background: rgb(239 249 255 / 90%);
|
||||||
|
border-radius: 2px;
|
||||||
|
margin: 0.5em 0 0 0;
|
||||||
|
box-shadow: 0 0 5px 0px #959595;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-notify .wh-notify-item:hover {
|
||||||
|
background: rgb(239 249 255 / 98%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-notify .wh-notify-item .wh-notify-bar {
|
||||||
|
height: 2px;
|
||||||
|
background: #2196f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-notify .wh-notify-item .wh-notify-close {
|
||||||
|
float: right;
|
||||||
|
padding: 0;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background: url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%201024%201024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M923%20571H130.7c-27.6%200-50-22.4-50-50s22.4-50%2050-50H923c27.6%200%2050%2022.4%2050%2050s-22.4%2050-50%2050z%22%20fill%3D%22%232196f3%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E') no-repeat center;
|
||||||
|
background-size: 100%;
|
||||||
|
margin: 6px 6px 0 0;
|
||||||
|
cursor: pointer;
|
||||||
|
pointer-events: all;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-notify .wh-notify-item .wh-notify-msg {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.non-selection {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-4 {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*.el-overlay {*/
|
||||||
|
/* backdrop-filter: blur(20px);*/
|
||||||
|
/*}*/
|
||||||
9
src/static/css/depo.module.css
Normal file
9
src/static/css/depo.module.css
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.wh-depo-helper div#funds div.deposit,
|
||||||
|
.wh-depo-helper div#armoury-donate div.cash {
|
||||||
|
position: fixed !important;
|
||||||
|
top: 150px;
|
||||||
|
right: 12px;
|
||||||
|
box-shadow: 0 0 8px 1px #00000091;
|
||||||
|
background: #f2f2f2;
|
||||||
|
z-index: 999999;
|
||||||
|
}
|
||||||
57
src/static/css/quick_fly.module.css
Normal file
57
src/static/css/quick_fly.module.css
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#wh-quick-fly-opt {
|
||||||
|
position: fixed;
|
||||||
|
left: 64px;
|
||||||
|
top: 64px;
|
||||||
|
background: #008000db;
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 0 5px 1px #ffffff29;
|
||||||
|
color: white;
|
||||||
|
font-size: 15px;
|
||||||
|
width: 220px;
|
||||||
|
z-index: 199999;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-quick-fly-opt p {
|
||||||
|
margin: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-quick-fly-opt a {
|
||||||
|
cursor: pointer;
|
||||||
|
border: 1px solid;
|
||||||
|
padding: 4px;
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-quick-fly-opt label {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-quick-fly-opt select {
|
||||||
|
width: 100%;
|
||||||
|
padding: 6px;
|
||||||
|
margin: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-quick-fly-opt button {
|
||||||
|
font-size: 16px;
|
||||||
|
color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
float: right;
|
||||||
|
background: #00BCD4;
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-quick-fly-opt.wh-quick-fly-opt-hide * {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-quick-fly-opt.wh-quick-fly-opt-hide input {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
info {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
23
src/static/css/quick_link.module.css
Normal file
23
src/static/css/quick_link.module.css
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
.wh-link-collection-cont a {
|
||||||
|
display: inline-block;
|
||||||
|
border: solid 1px #b3b3b3;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: 0 5px 2px 0;
|
||||||
|
padding: 4px 8px;
|
||||||
|
text-align: center;
|
||||||
|
background: #efefef;
|
||||||
|
background: linear-gradient(#f1f1f1, #e3e3e3);
|
||||||
|
color: black !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-link-collection-cont span {
|
||||||
|
display: block;
|
||||||
|
/*padding: 0 4px 8px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-link-collection-cont .wh-link-collection-img {
|
||||||
|
display: block;
|
||||||
|
width: 60px;
|
||||||
|
height: 30px;
|
||||||
|
background-size: 100% auto !important;
|
||||||
|
}
|
||||||
67
src/static/css/travel_alarm.module.css
Normal file
67
src/static/css/travel_alarm.module.css
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#wh-trv-alarm {
|
||||||
|
position: absolute;
|
||||||
|
width: 248px;
|
||||||
|
background: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: #0000001f 0 0 10px 4px;
|
||||||
|
border: solid 1px #aaa;
|
||||||
|
z-index: 100001;
|
||||||
|
margin: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-alarm button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-error {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: none;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-error p {
|
||||||
|
background: #ffd0d0;
|
||||||
|
color: red;
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: 1em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-alarm-title {
|
||||||
|
height: 30px;
|
||||||
|
border-bottom: solid #aaa 1px;
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5#wh-trv-alarm-header {
|
||||||
|
height: 100%;
|
||||||
|
line-height: 30px;
|
||||||
|
padding: 0 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-alarm-bottom {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-alarm-remaining {
|
||||||
|
float: right;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-alarm-cont {
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-trv-alarm-cont input[type="number"] {
|
||||||
|
width: 42px;
|
||||||
|
border-bottom: solid 1px #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wh-trv-alarm-stop-hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
3
src/static/css/xunzhaomuzhuang.module.css
Normal file
3
src/static/css/xunzhaomuzhuang.module.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
body.wh-hide-title .content-title, body.wh-hide-title .info-msg-cont {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<div>
|
<div>
|
||||||
<button style="color:white;">👉添加啤酒商品</button>
|
<button class="torn-btn">👉添加啤酒商品</button>
|
||||||
<p>如果当前商店没有啤酒这个商品可以提前显示以省去刷新步骤,增加抢酒成功率。</p>
|
<p>如果当前商店没有啤酒这个商品可以提前显示以省去刷新步骤,增加抢酒成功率。</p>
|
||||||
<p id="wh-msg"></p>
|
<p id="wh-msg"></p>
|
||||||
</div>
|
</div>
|
||||||
5
src/static/html/buyBeer/notify.html
Normal file
5
src/static/html/buyBeer/notify.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<span style="background-color:green;color:white;border-radius:3px;font-size:14px;line-height:21px;padding:2px 4px;">啤酒小助手</span>
|
||||||
|
<br/>提醒您:还有不到 50 秒 NPC 的商品就要刷新了,啤酒血包要抢的可以准备咯。
|
||||||
|
<button id="wh-rd-btn-{{}}">【今日不再提醒】</button><br/>
|
||||||
|
<a href="/shops.php?step=bitsnbobs#clickfromnotify" target="_blank">【啤酒店】</a>
|
||||||
|
<a href="/shops.php?step=pharmacy#clickfromnotify" target="_blank">【血包店】</a>
|
||||||
71
src/static/html/buyBeer/shop_beer_static_item.html
Normal file
71
src/static/html/buyBeer/shop_beer_static_item.html
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<div class="acc-title">
|
||||||
|
<span class="item-desc tt-buy">
|
||||||
|
<span class="item Alcohol" itemid="180" loaded="0">
|
||||||
|
<span class="item-plate">
|
||||||
|
<img alt="Bottle of Beer" class="torn-item large"
|
||||||
|
src="/images/items/180/large.png"
|
||||||
|
srcset="/images/items/180/large.png 1x, /images/items/180/large@2x.png 2x, /images/items/180/large@3x.png 3x, /images/items/180/large@4x.png 4x">
|
||||||
|
</span>
|
||||||
|
<span class="item-hover">
|
||||||
|
<button aria-labelledby="Show info: 180-name 180-price 180-stock" class="view-info wai-btn"
|
||||||
|
value="100"></button>
|
||||||
|
<button aria-label="Buy: Bottle of Beer" class="buy-info wai-btn" value="100"></button>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span class="desc">
|
||||||
|
<input name="shoparea" type="hidden" value="100">
|
||||||
|
<span id="180-name" class="name t-overflow bold">Bottle of Beer</span>
|
||||||
|
<span id="180-price" class="price t-gray-6 tt-modified" data-sell="$5">$10<span
|
||||||
|
class="tt-profit positive"><i class="fas fa-caret-up"></i>$1,636</span></span>
|
||||||
|
<span id="180-stock" class="stock t-gray-6 t-overflow">Alcohol (<span class="instock">5,000</span> in
|
||||||
|
stock)</span>
|
||||||
|
</span>
|
||||||
|
<span class="buy-act-wrap">
|
||||||
|
<button aria-label="Close" class="close-icon p0 wai-btn" value="100"></button>
|
||||||
|
<label class="wai" for="180">Amount
|
||||||
|
of Bottle of Beer</label>
|
||||||
|
<input id="180" autocomplete="new-amount" maxlength="3" name="buyAmount[]" type="text" value="100">
|
||||||
|
<span class="buy-act bold">
|
||||||
|
<button class="wai-support t-blue h" value="100">Buy<br><span class="tt-max-buy">fill
|
||||||
|
max</span></button>
|
||||||
|
<div class="tt-max-buy-overlay"></div>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<div class="torn-divider divider-right"></div>
|
||||||
|
<div class="confirm-wrap" tabindex="0">
|
||||||
|
<span class="confirm">
|
||||||
|
<span>
|
||||||
|
Are you sure you would like to buy
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span class="count"></span>
|
||||||
|
x Bottle of Beer for
|
||||||
|
$<span class="total"></span>
|
||||||
|
</span>
|
||||||
|
<span class="confirm-act m-top5">
|
||||||
|
<a class="wai-support yes m-right10 bold t-blue h" data-id="180" href="#">
|
||||||
|
Yes
|
||||||
|
</a>
|
||||||
|
<span class="no bold">
|
||||||
|
<a class="wai-support t-blue h" href="#">
|
||||||
|
No
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="success-wrap">
|
||||||
|
<span class="success">
|
||||||
|
<span class="t-green bold">
|
||||||
|
<span class="ajax-preloader"></span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<button aria-label="Close" class="close-icon p0 wai-btn" value="100"></button>
|
||||||
|
</div>
|
||||||
|
<div class="msg-wrap">
|
||||||
|
<span class="t-green bold">
|
||||||
|
<span class="ajax-preloader"></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<p>即将打开危险功能,使用这些功能可能会造成账号封禁。请自行考虑是否使用。</p>
|
<p>即将打开危险功能,使用这些功能可能会造成账号封禁。请自行考虑是否使用。</p>
|
||||||
<p><label><input type="checkbox" {{}}/> 知道了,开启</label></p>
|
<p><label><input type="checkbox" {{}}/> 知道了,开启</label></p>
|
||||||
<div>
|
<div>
|
||||||
<button disabled>保存</button>
|
<button class="torn-btn" disabled>保存</button>
|
||||||
</div>
|
</div>
|
||||||
54
src/static/html/dialog_msg_box.html
Normal file
54
src/static/html/dialog_msg_box.html
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<style>
|
||||||
|
html {
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#chatRoot {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-dialog {
|
||||||
|
position: absolute;
|
||||||
|
/*width: 100%;*/
|
||||||
|
/*height: 100%;*/
|
||||||
|
background: #00000066;
|
||||||
|
flex-direction: column;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 290001;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-dialog .top-round {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-dialog div.wh-content {
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-dialog .border-round {
|
||||||
|
margin: auto;
|
||||||
|
max-width: 400px;
|
||||||
|
position: fixed;
|
||||||
|
top: 100px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wh-dialog .pin-bottom {
|
||||||
|
text-align: center;
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="border-round">
|
||||||
|
<div class="title-black top-round">{{}}</div>
|
||||||
|
<div class="cont-gray bottom-round">
|
||||||
|
<div class="wh-content">{{}}</div>
|
||||||
|
<div class="non-selection pin-bottom">
|
||||||
|
<button class="torn-btn">确定</button>
|
||||||
|
<button class="torn-btn">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
5
src/static/html/notify.html
Normal file
5
src/static/html/notify.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<div class="wh-notify-bar"></div>
|
||||||
|
<div class="wh-notify-cont">
|
||||||
|
<div class="wh-notify-close"></div>
|
||||||
|
<div class="wh-notify-msg"><p>{{}}</p></div>
|
||||||
|
</div>
|
||||||
7
src/static/html/popup.html
Normal file
7
src/static/html/popup.html
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<style>html {
|
||||||
|
overflow: hidden !important;
|
||||||
|
}</style>
|
||||||
|
<div class="border-round" id="wh-popup-container">
|
||||||
|
<div class="title-black top-round" id="wh-popup-title"><p>{{}}</p></div>
|
||||||
|
<div class="scroll-area scrollbar-transparent cont-gray bottom-round" id="wh-popup-cont">{{}}</div>
|
||||||
|
</div>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<option>瑞士 (解毒)</option>
|
<option>瑞士 (解毒)</option>
|
||||||
<option>立本</option>
|
<option>立本</option>
|
||||||
<option>祖国</option>
|
<option>祖国</option>
|
||||||
<option>迪拜</option>
|
<option>阿联酋 (UAE)</option>
|
||||||
<option>南非</option>
|
<option>南非</option>
|
||||||
</select></label>
|
</select></label>
|
||||||
<label>飞机:<select>
|
<label>飞机:<select>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<div class="m-top10">
|
<div class="m-top10">
|
||||||
<h4 id="skip-to-content" class="left">RW 雷达</h4>
|
<h4 class="left" id="skip-to-content">RW 雷达</h4>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<hr class="page-head-delimiter">
|
<hr class="page-head-delimiter">
|
||||||
</div>
|
</div>
|
||||||
@ -8,9 +8,16 @@
|
|||||||
<a href="/profiles.php?XID=2687093" target="_blank">woohoo</a>
|
<a href="/profiles.php?XID=2687093" target="_blank">woohoo</a>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>123</th><th>456</th></tr>
|
<tr>
|
||||||
|
<th>123</th>
|
||||||
|
<th>456</th>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>789</td><td>012</td></tr>
|
<tr>
|
||||||
</tbody></table>
|
<td>789</td>
|
||||||
|
<td>012</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
18
src/static/html/travel_alarm.html
Normal file
18
src/static/html/travel_alarm.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<div id="wh-trv-error"><p><b>❌ 没有权限</b><br/>点击网页内任意位置以激活闹钟</p></div>
|
||||||
|
<div id="wh-trv-alarm-title">
|
||||||
|
<h5 id="wh-trv-alarm-header">飞行闹钟</h5>
|
||||||
|
</div>
|
||||||
|
<div id="wh-trv-alarm-bottom">
|
||||||
|
<div id="wh-trv-alarm-cont">
|
||||||
|
<p id="wh-trv-alarm-remaining"></p>
|
||||||
|
<p><span id="wh-trv-status">正在{{}} </span><span>✈</span></p>
|
||||||
|
<div><input class="checkbox-css" id="WHTravelAlarmToggle" type="checkbox" {{}}/><label
|
||||||
|
class="non-selection marker-css" for="WHTravelAlarmToggle">开启闹钟</label></div>
|
||||||
|
<div><label>落地前响铃时长(秒): <input type="number" value="{{}}"/></label>
|
||||||
|
<button>确定</button>
|
||||||
|
</div>
|
||||||
|
<div class="wh-trv-alarm-stop-hide">
|
||||||
|
<button>停止闹钟</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
16
src/static/html/view_logs_handler.html
Normal file
16
src/static/html/view_logs_handler.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<style>
|
||||||
|
#WHLogsCont {
|
||||||
|
width: 100%;
|
||||||
|
height: 340px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#WHLogsCont p {
|
||||||
|
overflow-x: auto;
|
||||||
|
white-space: nowrap;
|
||||||
|
word-break: keep-all;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<p>{{}}信息 {{}}警告 {{}}错误
|
||||||
|
<button class="torn-btn">导出日志</button>
|
||||||
|
</p>
|
||||||
|
<div id="WHLogsCont">加载中</div>
|
||||||
@ -1,5 +1,6 @@
|
|||||||
<div id="wh-xmas-cont">
|
<div id="wh-xmas-cont">
|
||||||
<div class="title-black"><span>水晶球解密地图攻略</span><span><button style="color: white">[隐藏]</button></span></div>
|
<div class="title-black"><span>水晶球解密地图攻略</span><span><button style="color: white">[隐藏]</button></span>
|
||||||
|
</div>
|
||||||
<div class="cont-gray select-wrap dropdown-new dropdown-default">
|
<div class="cont-gray select-wrap dropdown-new dropdown-default">
|
||||||
<select>
|
<select>
|
||||||
<option value="None">未选择</option>
|
<option value="None">未选择</option>
|
||||||
@ -24,10 +25,11 @@
|
|||||||
<hr class="page-head-delimiter m-top10 m-bottom10 r1854">
|
<hr class="page-head-delimiter m-top10 m-bottom10 r1854">
|
||||||
</div>
|
</div>
|
||||||
<style>
|
<style>
|
||||||
#wh-xmas-cont .cont-gray{
|
#wh-xmas-cont .cont-gray {
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
}
|
}
|
||||||
#wh-xmas-cont p,#wh-xmas-cont select,#wh-xmas-cont li{
|
|
||||||
|
#wh-xmas-cont p, #wh-xmas-cont select, #wh-xmas-cont li {
|
||||||
margin: 0 0 3px;
|
margin: 0 0 3px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -9,7 +9,8 @@
|
|||||||
<li>来到第二层,直接向东走上楼梯[11,-19]</li>
|
<li>来到第二层,直接向东走上楼梯[11,-19]</li>
|
||||||
<li>来到了这个地牢的第03层</li>
|
<li>来到了这个地牢的第03层</li>
|
||||||
<li>向东再向南走到墙边,然后向东走,与绿色<span style="color: #32CD32">史莱姆</span>战斗</li>
|
<li>向东再向南走到墙边,然后向东走,与绿色<span style="color: #32CD32">史莱姆</span>战斗</li>
|
||||||
<li>继续向东走,经过被打败的史莱姆,然后向南和向西绕过墙,向北走一格,向西打败另一个<span style="color: #32CD32">史莱姆</span></li>
|
<li>继续向东走,经过被打败的史莱姆,然后向南和向西绕过墙,向北走一格,向西打败另一个<span
|
||||||
|
style="color: #32CD32">史莱姆</span></li>
|
||||||
<li>向西南方向走下楼梯[53,-49]</li>
|
<li>向西南方向走下楼梯[53,-49]</li>
|
||||||
<li>来到了第 04 层</li>
|
<li>来到了第 04 层</li>
|
||||||
<li>走到墙边,撞右边两个镣铐之间的墙,然后向北直接走到墙里[15,-65]</li>
|
<li>走到墙边,撞右边两个镣铐之间的墙,然后向北直接走到墙里[15,-65]</li>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user