完善技能树和百科全书

This commit is contained in:
AncTe committed 2022-12-31 18:24:21 +08:00
1 parent e24fb961b8
commit 6292bf2df7
6 files changed
+37 -10

No files matched your search

+9 -1
View File
@@ -29,7 +29,15 @@ function popValue() {
// 绘制
if (one.frame >= 60) core.setAlpha(ctx, 3 - one.frame / 30);
else core.setAlpha(ctx, 1);
core.fillBoldText(ctx, one.value, one.px, one.py);
core.fillBoldText(
ctx,
one.value,
one.px,
one.py,
'#f22',
'#000',
'24px normal'
);
if (one.frame >= 90) count++;
});
if (count > 0) pop.splice(0, count);
+14 -3
View File
@@ -2,13 +2,14 @@
<Colomn @close="exit" :width="80" :height="80" :left="30" :right="70"
><template #left
><div id="desc-list">
<span
<div
v-for="(data, k) in desc"
class="selectable desc-item"
:selected="selected === k"
@click="selected = k"
>{{ data.text }}</span
@click="click(k)"
>
<span v-if="show(data.condition)">{{ data.text }}</span>
</div>
</div></template
>
<template #right><span v-html="content"></span></template
@@ -32,6 +33,15 @@ function exit() {
const content = computed(() => {
return splitText(desc[selected.value].desc);
});
function click(key: DescKey) {
if (!eval(desc[key].condition)) return;
selected.value = key;
}
function show(condition: string) {
return eval(condition);
}
</script>
<style lang="less" scoped>
@@ -46,5 +56,6 @@ const content = computed(() => {
.desc-item {
padding: 1% 3% 1% 3%;
width: 100%;
}
</style>
+5 -2
View File
@@ -168,17 +168,19 @@ function draw() {
const d = dict.value;
const w = canvas.width;
const per = w / 11;
ctx.clearRect(0, 0, canvas.width, canvas.height);
skills.value.forEach(v => {
const [x, y] = v.loc.map(v => v * 2 - 1);
// 技能连线
v.front.forEach(([skill]) => {
v.front.forEach(([skill], i) => {
const s = skills.value[d[skill]];
ctx.beginPath();
ctx.moveTo(x * per + per / 2, y * per + per / 2);
ctx.lineTo(
...(s.loc.map(v => (v * 2 - 1) * per + per / 2) as LocArr)
);
if (core.getSkillLevel(s.index) === 0) ctx.strokeStyle = '#aaa';
if (core.getSkillLevel(s.index) < v.front[i][1])
ctx.strokeStyle = '#aaa';
else ctx.strokeStyle = '#0f8';
ctx.lineWidth = devicePixelRatio;
ctx.stroke();
@@ -249,6 +251,7 @@ function selectChapter(delta: number) {
font-size: 2.8vh;
display: flex;
flex-direction: column;
user-select: none;
}
#skill-title {