This commit is contained in:
Liwanyi 2022-10-17 18:09:20 +08:00
parent bb770d8e2e
commit d893c8ac32
8 changed files with 63 additions and 111 deletions

View File

@ -5,14 +5,15 @@
# CHANGE # CHANGE
## 0.6.0 pre ## 0.6.0
2022年10月日 2022年10月17
### 修改 ### 修改
- 解毒提醒UI调整 - 解毒提醒UI调整
- 传单助手UI调整 - 传单助手UI调整
- 光速拔刀UI错误修复
### 添加 ### 添加

3
global.d.ts vendored
View File

@ -14,7 +14,6 @@ declare interface Window {
$?: JQueryStatic; $?: JQueryStatic;
jQuery?: JQueryStatic; jQuery?: JQueryStatic;
WHPARAMS?: any; WHPARAMS?: any;
ReactDOM?: any;
hasWHQuickFlyOpt?: boolean; hasWHQuickFlyOpt?: boolean;
// 插件运行标识 // 插件运行标识
WHTRANS?: number; WHTRANS?: number;
@ -28,6 +27,8 @@ declare interface Window {
eval(exc: string): void; eval(exc: string): void;
/* TORN自带 */ /* TORN自带 */
ReactDOM?: any;
addRFC(url: URL | string): string; addRFC(url: URL | string): string;
// initMiniProf(selector: string): void; // initMiniProf(selector: string): void;

File diff suppressed because one or more lines are too long

View File

@ -18,6 +18,9 @@ export default class Application {
// 插件图标和设置菜单 // 插件图标和设置菜单
ZhongIcon.getInstance(); ZhongIcon.getInstance();
// TODO 临时关闭光速跑路
WuhuConfig.set('quickFinishAtt', 3);
// 所有页面通用 // 所有页面通用
Common.getInstance().resolve(); Common.getInstance().resolve();

View File

@ -65,6 +65,7 @@ export default class Global extends WuhuBase implements IGlobal {
window.getAction = this.unsafeWindow.getAction; window.getAction = this.unsafeWindow.getAction;
window.initializeTooltip = this.unsafeWindow.initializeTooltip; window.initializeTooltip = this.unsafeWindow.initializeTooltip;
window.renderMiniProfile = this.unsafeWindow.renderMiniProfile; window.renderMiniProfile = this.unsafeWindow.renderMiniProfile;
window.ReactDOM = this.unsafeWindow.ReactDOM;
} }
for (let i = 0; i < document.body.attributes.length; i++) { for (let i = 0; i < document.body.attributes.length; i++) {

View File

@ -4,7 +4,7 @@ import Provider from "./provider/Provider";
export default class WuhuBase extends Provider { export default class WuhuBase extends Provider {
static glob: IGlobal = null; static glob: IGlobal = null;
className = 'WuhuBase'; protected readonly className: string = 'WuhuBase';
static getLocal(): IWHSettings { static getLocal(): IWHSettings {
return JSON.parse(localStorage.getItem('wh_trans_settings')) || {}; return JSON.parse(localStorage.getItem('wh_trans_settings')) || {};

View File

@ -6,6 +6,7 @@ import Log from "../../class/Log";
import Alert from "../../class/utils/Alert"; import Alert from "../../class/utils/Alert";
import MathUtils from "../../class/utils/MathUtils"; import MathUtils from "../../class/utils/MathUtils";
import ActionButtonUtils from "../../class/utils/ActionButtonUtils"; import ActionButtonUtils from "../../class/utils/ActionButtonUtils";
import ATTACK_HELPER_CSS from "../../static/css/attack_helper.css";
export default async function attackHelper(): Promise<null> { export default async function attackHelper(): Promise<null> {
let { href, device } = WuhuBase.glob; let { href, device } = WuhuBase.glob;
@ -21,7 +22,7 @@ export default async function attackHelper(): Promise<null> {
// 自刷新 // 自刷新
let audio_played_flag; let audio_played_flag;
// @ts-ignore // @ts-ignore TODO
if (attReload !== 6 && stop_reload !== true) { if (attReload !== 6 && stop_reload !== true) {
const selector_device_map = { const selector_device_map = {
'pc': '#defender div[class^="modal___"]', 'pc': '#defender div[class^="modal___"]',
@ -75,7 +76,7 @@ export default async function attackHelper(): Promise<null> {
case Device.PC: { case Device.PC: {
Log.info(`开始调整按钮位置`); Log.info(`开始调整按钮位置`);
// 隐藏modal层 // 隐藏modal层
modal.style.display = 'none'; // modal.style.display = 'none';
// 根据选择的武器调整css // 根据选择的武器调整css
let css_top = '0'; let css_top = '0';
switch (WuhuConfig.get('quickAttIndex')) { switch (WuhuConfig.get('quickAttIndex')) {
@ -97,13 +98,8 @@ export default async function attackHelper(): Promise<null> {
break; break;
} }
} }
const css_rule = ` const css_rule = `.wh-move-btn #defender div[class^="modal___"]{top: ${ css_top };}`;
.wh-move-btn #defender div[class^="modal___"]{display: block;width: 0 !important;top: ${ css_top };left: -169px !important;} CommonUtils.addStyle(ATTACK_HELPER_CSS);
.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); CommonUtils.addStyle(css_rule);
document.body.classList.add('wh-move-btn'); document.body.classList.add('wh-move-btn');
// 绑定点击事件 联动【光速跑路】 // 绑定点击事件 联动【光速跑路】
@ -220,8 +216,8 @@ export default async function attackHelper(): Promise<null> {
} }
} }
// 光速跑路 // 光速跑路 TODO 暂时关闭
if (quickFinishAtt !== 3) { if (quickFinishAtt !== 3 && false) {
const user_btn_select = ['leave', 'mug', 'hosp'][WuhuConfig.get('quickFinishAtt')]; const user_btn_select = ['leave', 'mug', 'hosp'][WuhuConfig.get('quickFinishAtt')];
const wrap = document.querySelector('#react-root'); const wrap = document.querySelector('#react-root');
Log.info('光速跑路选项选中:', user_btn_select); Log.info('光速跑路选项选中:', user_btn_select);

View File

@ -0,0 +1,40 @@
.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___"] {
display: none;
}
.wh-move-btn #defender button {
width: 100%;
margin: 17px 0;
height: 60px;
}
.wh-move-btn #defender div[class^="playerWindow___"] {
overflow: unset;
}
.wh-move-btn #defender img {
display: none;
}