完善部分ui

This commit is contained in:
AncTe committed 2022-12-29 13:39:40 +08:00
1 parent db5ff1b183
commit 190201b386
15 files changed
+70 -49

No files matched your search

+1 -1
View File
@@ -64,7 +64,7 @@
<div class="detail-info">
<span style="color: lawngreen"
>经验&nbsp;&nbsp;&nbsp;&nbsp;{{
core.formatBigNumber(enemy.money)
core.formatBigNumber(enemy.exp)
}}</span
>
</div>
+7 -1
View File
@@ -8,7 +8,7 @@
"变宽,然后拖动。电脑端点击状态栏也可以使边框变宽。",
"<br>",
"<br>",
"状态栏可以纵向滚动,如果你发现状态栏显示不全,可以尝试拉大状态栏,或者纵向拖动状态栏,就像网页上下拖动一样。",
"状态栏可以纵向滚动,如果你发现状态栏显示不全,可以尝试拉大状态栏,或者纵向拖动状态栏,就像网页上下滚动一样。",
"电脑端还可以使用滚轮上下滚动。",
"<br>",
"<br>",
@@ -36,5 +36,11 @@
"<br>",
"这个功能可以用于标记boss或者较强的挡路怪,当这些怪能够攻击时你可以直接收到信息,不需要再时刻费心注意怪物的伤害。"
]
},
"book": {
"text": "怪物手册",
"desc": [
""
]
}
}
+3 -1
View File
@@ -6,6 +6,7 @@ import animate from './plugin/animateController';
import utils from './plugin/utils';
import status from './plugin/ui/statusBar';
import mark from './plugin/mark';
import setting from './plugin/settings';
window.addEventListener('load', () => {
// 每个引入的插件都要在这里执行,否则不会被转发
@@ -16,7 +17,8 @@ window.addEventListener('load', () => {
animate(),
utils(),
status(),
mark()
mark(),
setting()
];
// 初始化所有插件,并转发到core上
+9 -2
View File
@@ -10,6 +10,13 @@ watch(transition, n => {
core.setLocalStorage('transition', n);
});
window.addEventListener('load', () => {
/**
* 重置设置信息,从localStorage读取即可
*/
function reset() {
transition.value = core.getLocalStorage('transition');
});
}
export default function init() {
return { resetSettings: reset };
}
+4 -8
View File
@@ -75,16 +75,12 @@ async function hideApp(index: number) {
app.style.transition = 'all 0.6s linear';
app.style.opacity = '0';
await sleep(600);
uiStack.value.splice(index, 1);
app.style.display = 'none';
if (!noClosePanel.value) core.closePanel();
noClosePanel.value = false;
} else {
app.style.transition = '';
app.style.opacity = '0';
uiStack.value.splice(index, 1);
app.style.display = 'none';
if (!noClosePanel.value) core.closePanel();
noClosePanel.value = false;
}
uiStack.value.splice(index, 1);
app.style.display = 'none';
if (!noClosePanel.value) core.closePanel();
noClosePanel.value = false;
}
+6 -1
View File
@@ -115,7 +115,12 @@ interface PluginDeclaration extends PluginUtils {
/**
* 检查被标记怪物的状态,是否需要更新
*/
checkMarkedEnemy();
checkMarkedEnemy(): void;
/**
* 重置设置信息
*/
resetSettings(): void;
}
interface PluginUtils {
+1 -3
View File
@@ -202,9 +202,8 @@ function keydown(e: KeyboardEvent) {
onMounted(async () => {
const div = document.getElementById('book') as HTMLDivElement;
div.style.opacity = '1';
if (core.plugin.transition.value) await sleep(600);
else await sleep(100);
else await sleep(50);
document.addEventListener('keyup', keyup);
document.addEventListener('keydown', keydown);
});
@@ -217,7 +216,6 @@ onUnmounted(async () => {
<style lang="less" scoped>
#book {
opacity: 0;
user-select: none;
width: 80%;
height: 100%;
+14 -2
View File
@@ -183,9 +183,10 @@ import { computed, onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import Scroll from '../components/scroll.vue';
import { getAddStatus, getEquips, getNowStatus } from '../plugin/ui/equipbox';
import BoxAnimate from '../components/boxAnimate.vue';
import { has, tip, type } from '../plugin/utils';
import { has, keycode, tip, type } from '../plugin/utils';
import { cancelGlobalDrag, isMobile, useDrag } from '../plugin/use';
import { hyper, sleep } from 'mutate-animate';
import { KeyCode } from '../plugin/keyCodes';
const equips = ref(getEquips());
const col = ref('all');
@@ -425,16 +426,27 @@ async function toTool() {
core.plugin.transition.value = before;
}
function keyup(e: KeyboardEvent) {
const c = keycode(e.keyCode);
if (c === KeyCode.KeyQ || c === KeyCode.KeyX || c === KeyCode.Escape) {
exit();
}
}
watch(toShow, n => {
bind();
});
onMounted(() => {
onMounted(async () => {
bind();
if (core.plugin.transition.value) await sleep(600);
else await sleep(50);
document.addEventListener('keyup', keyup);
});
onUnmounted(() => {
cancelGlobalDrag(dragEquip);
document.removeEventListener('keyup', keyup);
});
</script>
+4 -2
View File
@@ -75,10 +75,10 @@
keys[2]?.toString().padStart(2, '0')
}}</span>
</div>
<div class="status-item">
<div v-if="skillOpened" class="status-item">
<span id="skill-tree" class="button-text">技能树</span>
</div>
<div class="status-item">
<div v-if="skillOpened" class="status-item">
<span id="status-skill" class="button-text"
>查看技能</span
>
@@ -112,6 +112,7 @@ const lvName = ref<string>();
const skill = ref<string>('无');
const up = ref(0);
const spring = ref<number>();
const skillOpened = ref(core.getFlag('chapter', 0) > 0);
/**
* 要展示的勇士属性
*/
@@ -148,6 +149,7 @@ function update() {
if (core.hasFlag('spring')) {
spring.value = 50 - flags.springCount;
}
skillOpened.value = core.getFlag('chapter', 0) > 0;
}
</script>
+3 -2
View File
@@ -197,7 +197,7 @@ async function toEquip() {
function keyup(e: KeyboardEvent) {
const c = keycode(e.keyCode);
if (c === KeyCode.Escape || c === KeyCode.KeyX) {
if (c === KeyCode.Escape || c === KeyCode.KeyX || c === KeyCode.KeyT) {
exit();
}
if (c === KeyCode.Enter || c === KeyCode.KeyC) {
@@ -239,7 +239,8 @@ function keydown(e: KeyboardEvent) {
}
onMounted(async () => {
await sleep(600);
if (core.plugin.transition.value) await sleep(600);
else await sleep(50);
document.addEventListener('keyup', keyup);
document.addEventListener('keydown', keydown);
});