From 67ae4d87734cdf80cdb489d0efebf5b6fa2d3e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E7=93=9C=C2=B0?= Date: Sat, 15 Mar 2025 23:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BD=E6=95=B0=E5=8A=A0=E7=82=B9?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/dataFiles/dcalc_0.db | Bin 1445888 -> 1445888 bytes frontend/src/api/info/type.ts | 1 + .../src/pages/Character/Equipment/Weapon.vue | 1 + .../pages/Character/Skill/SkillTree/index.tsx | 97 +++++++++++++----- 4 files changed, 73 insertions(+), 26 deletions(-) diff --git a/backend/dataFiles/dcalc_0.db b/backend/dataFiles/dcalc_0.db index 860b589411e24590eb8a0321a2b713d9e7441dd3..9874bced5bd9995562e2c2b18b218171c7e38fa9 100644 GIT binary patch delta 157 zcmWN@yAHu%7zW_{&RSY+KQUkyiPaTohem=$LM-p>3XCM)SRICM?IL0_{);Pc11`ei z5_qO(n=Q84;@CFnsWUR^4um0cM4l)RMWRHMi3(9A9Kt1PM4j*mpJ)&P5fafA;^_Jo zM*46iuzN@5IbGhv(0*z%FuL(2wkuD%MkmR?PhZYMZFv&wG?t!zFHxkkvABnKBKDm$ G`>!9CNixF# delta 152 zcmWN@Jq`gu7zW_X`rlc*m`@bwBqC}ju)B=}jbszedkp1DywUn8rXktJ8K!Xp7jOxM zBk)vDUSxTZo%$+059TV}gHVJ=l!!7>A*w`;s1pssCo~ZdO(G;BqD8cc4q+Y;-`=#0 z+`*TPXYX2!`vfvoc9}@*wxJA_?S=n7Be~4%E|S=;Vj0`-)fl^8h(5j(aqpx%dHn!# C9x#~z diff --git a/frontend/src/api/info/type.ts b/frontend/src/api/info/type.ts index 484f87a7..9495f2a0 100644 --- a/frontend/src/api/info/type.ts +++ b/frontend/src/api/info/type.ts @@ -50,6 +50,7 @@ export interface ISkill { position: number type: string maxLearnLv: number + maxLv: number } export interface ISuit { diff --git a/frontend/src/pages/Character/Equipment/Weapon.vue b/frontend/src/pages/Character/Equipment/Weapon.vue index 95a80b05..23d9946c 100644 --- a/frontend/src/pages/Character/Equipment/Weapon.vue +++ b/frontend/src/pages/Character/Equipment/Weapon.vue @@ -44,5 +44,6 @@ const chooseWeapon = (weapon: IEquipment | undefined) => { if (weapon) { configStore.config.equips['武器'].id = weapon.id } + console.log(configStore.config) } diff --git a/frontend/src/pages/Character/Skill/SkillTree/index.tsx b/frontend/src/pages/Character/Skill/SkillTree/index.tsx index c40a7bb3..33eb2c1c 100644 --- a/frontend/src/pages/Character/Skill/SkillTree/index.tsx +++ b/frontend/src/pages/Character/Skill/SkillTree/index.tsx @@ -1,6 +1,6 @@ import { getImageURL } from '@/utils/images' import type { ISkill } from '@/api/info/type' -import {useVModel} from '@vueuse/core' +import { useVModel } from '@vueuse/core' import './style.scss' export default defineComponent({ @@ -37,22 +37,79 @@ export default defineComponent({ const columns = [...new Array(9).keys()] + const activeSkill = ref(-1) + + const chooseSkill = (skill: ISkill) => { + if (activeSkill.value == skill.id) activeSkill.value = -1 + else activeSkill.value = skill.id + } + + const actionSkillLv = (skill: ISkill, operation:string) => { + if(operation == 'add'){ + lvInfo.value[skill.id.toString()] = { lv: Math.min(lvInfo.value[skill.id.toString()]?.lv + 1,skill.maxLv) } + return; + } + if(operation == 'addMax'){ + lvInfo.value[skill.id.toString()] = { lv: skill.maxLearnLv } + return; + } + if(operation == 'sub'){ + lvInfo.value[skill.id.toString()] = { lv: Math.max(lvInfo.value[skill.id.toString()]?.lv - 1,0) } + return; + } + if(operation == 'subMax'){ + lvInfo.value[skill.id.toString()] = { lv: 0 } + return; + } + } + + const renderSkill = (skill: ISkill, index: number) => ( + <> +
+ {activeSkill.value == skill.id && renderSkillAction(skill)} +
chooseSkill(skill)} + key={index} + > + +
+ {lvInfo.value?.[skill.id.toString()]?.lv ?? 0} +
+
+
+ + ) + + const renderSkillAction = (skill: ISkill) => ( + <> + <> +
+
+
+ + + + +
+
+ + + ) + return () => ( <>
-
其
余
- {((getSkill(0, 15, -1) ?? []) as ISkill[])?.map((skill, index) => ( -
- -
- {lvInfo.value?.[skill.id.toString()]?.lv ?? 0} -
-
- ))} +
+ 其
余 +
+ {((getSkill(0, 15, -1) ?? []) as ISkill[])?.map((skill, index) => + renderSkill(skill, index), + )}
{lvList.map((lv, index) => (
@@ -63,19 +120,7 @@ export default defineComponent({ )} {columns.map((column, i) => { const skill = getSkill(lv, lvList[index + 1] ?? 150, column) as ISkill - return skill ? ( -
- -
- {lvInfo.value?.[skill.id.toString()]?.lv ?? 0} -
-
- ) : ( -
- ) + return skill ? renderSkill(skill, index) :
})}