Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MedalList): torappu implement #82

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/widgets/MedalList/Medal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { defineComponent, ref, type PropType } from "vue";

import { NCard, NConfigProvider, NImage, NTag, NTooltip } from "naive-ui";

import { getImagePath } from "../../utils/utils";

import type { Medal } from "./types";

export default defineComponent({
Expand Down Expand Up @@ -41,7 +39,6 @@ export default defineComponent({
};

return {
getImagePath,
isDecrypt: ref(false),
showTrimed: ref(false),
rarityGradient,
Expand Down Expand Up @@ -89,11 +86,7 @@ export default defineComponent({
>
<NImage
:width="rarityImgStyleSet[medalData.rarity][1]"
:src="`/images/${getImagePath(
`蚀刻章_${medalData.alias}${
showTrimed && medalData.isTrim ? '_镀层' : ''
}.png`,
)}`"
:src="`https://torappu.prts.wiki/assets/medal_icon/${showTrimed && medalData.isTrim ? medalData.trimId : medalData.id}.png`"
show-toolbar-tooltip
:previewed-img-props="{
style: {
Expand Down
9 changes: 1 addition & 8 deletions src/widgets/MedalList/MedalGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import {
NTooltip,
} from "naive-ui";

import { getImagePath } from "../../utils/utils";

import MedalComponent from "./Medal.vue";
import type { Medal, MedalGroup } from "./types";
function goToLink(link: string) {
Expand Down Expand Up @@ -54,7 +52,6 @@ export default defineComponent({

return {
eventLinkList,
getImagePath,
goToLink,
showTrimed: ref(false),
};
Expand Down Expand Up @@ -176,11 +173,7 @@ export default defineComponent({
</div>
<div class="flex max-w-full">
<NImage
:src="`/images/${getImagePath(
`蚀刻章套组_${groupData.alias}${
showTrimed && groupData.isTrim ? '_镀层' : ''
}.png`,
)}`"
:src="`https://torappu.prts.wiki/assets/medal_diy/${(showTrimed && groupData.isTrim ? 'trim/' : '') + groupData.id}.png`"
:img-props="{
style: {
width: '100%',
Expand Down
7 changes: 6 additions & 1 deletion src/widgets/MedalList/MedalList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,16 @@ export default defineComponent({
<NCard>
<template #header>
<img
:src="`/images/${getImagePath('图标_光荣之路.png')}`"
:src="`/images/${getImagePath('图标_光荣之路.svg')}`"
:class="`${theme ? 'brightness-100' : 'brightness-0'} transition-all`"
width="25"
/>&nbsp;&nbsp;光荣之路
</template>
<template #header-extra>
<div class="mx-1 cursor-pointer" @click="toggleDark()">
<span v-if="theme" class="text-2xl mdi mdi-brightness-6" />
<span v-else class="text-2xl mdi mdi-brightness-4" />
</div>
<div class="mx-1 cursor-pointer">
<NPopover trigger="click" raw>
<template #trigger>
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/MedalList/MedalShowcase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ export default defineComponent({
<NCard>
<template #header>
<img
:src="`/images/${getImagePath('图标_光荣之路.png')}`"
:src="`/images/${getImagePath('图标_光荣之路.svg')}`"
:class="`${theme ? 'brightness-100' : 'brightness-0'} transition-all`"
width="25"
class="mr-3"
/>
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/MedalList/types.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
export interface Medal {
name: string;
alias: string;
id: string;
rarity: number;
desc: string;
method: string;
decrypt?: string;
isHidden: boolean;
isTrim: boolean;
trimId?: string;
trimMethod?: string;
reward?: string;
}

export interface MedalGroup {
name: string;
id: string;
desc: string;
color: string;
bindEvent: Array<string>;
Expand Down
3 changes: 3 additions & 0 deletions src/widgets/MemoryList/Memory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export default defineComponent({
return `/images/${getImagePath(`图标_升级_精英化${elite || "0"}.png`)}`;
};
const getSrcMedal = (mmr: Memory) => {
/*
const search = mmr.medal.alias.replace(" ", "_");
return `/images/${getImagePath(`蚀刻章_${search}.png`)}`;
*/
return `https://torappu.prts.wiki/assets/medal_icon/${mmr.medal.id}`;
StarHeartHunt marked this conversation as resolved.
Show resolved Hide resolved
};
const srcfavor = `/images/${getImagePath("图标_信赖.png")}`;
const srcplay = `/images/${getImagePath("情报处理室_播放按钮.png")}`;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/MemoryList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface CharMemory {

export interface Medal {
medal: string;
alias: string;
id: string;
desc: string;
method: string;
}
2 changes: 1 addition & 1 deletion src/widgets/MemoryList/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function toMemories(
medalData.find(
(e) =>
e.method === `解锁干员${char}的干员密录《${item.storySetName}》`,
) ?? medalData.find((e) => e.alias === item.medal)!,
) ?? medalData.find((e) => e.id === item.medal)!,
info: [{ intro: item.storyIntro, link: item.storyTxt }],
});
}
Expand Down