Skip to content

Commit

Permalink
Merge pull request #57 from HoraceHuang-ui/horace_dev
Browse files Browse the repository at this point in the history
Horace dev
  • Loading branch information
HoraceHuang-ui authored Feb 22, 2024
2 parents 67146f6 + e51ddab commit e6350e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miXeD",
"version": "2.5.3",
"version": "2.5.4",
"main": "dist-electron/main/index.js",
"description": "All-in-one MiHOYO game launcher",
"author": "HoraceHYY <[email protected]>",
Expand Down
34 changes: 4 additions & 30 deletions src/pages/StarRailPage/Components/StarRailInfoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {computed, onMounted, ref} from 'vue'
import {useRouter} from 'vue-router'
import {translate} from '../../../i18n'
import StatIcon from '../../../components/StatIcon.vue'
import {RankInfo, RankLevelUpSkillInfo} from '../../../types/starrail/srRankMap'
import {RankInfo} from '../../../types/starrail/srRankMap'
import {AttributeInfo, CharacterInfo, FormattedApiInfo, RelicSetInfo} from '../../../types/starrail/srPlayerInfo'
import {useDialog} from '../../../utils/template-dialog'
import SRCharDetailsDialog from "./SRCharDetailsDialog.vue";
Expand Down Expand Up @@ -44,29 +44,6 @@ const showcaseIdx = ref(0)
const ascLevelMap = [20, 30, 40, 50, 60, 70, 80]
let rankMap: Record<string, RankInfo> = {}
const ranksReady = ref(false)
// const rankAdditions = ref([])
const rankAdditions = computed(() => {
if (!ranksReady.value || !playerInfoReady.value) {
return {}
}
let res: Record<string, number> = {}
playerInfo.value.characters.forEach((character: CharacterInfo) => {
const rank = character.rank
if (rank >= 3 && rank < 5) {
rankMap[character.id + "03"].level_up_skills.forEach((obj: RankLevelUpSkillInfo) => {
res[obj.id] = obj.num
})
} else if (rank >= 5) {
rankMap[character.id + "03"].level_up_skills.forEach((obj: RankLevelUpSkillInfo) => {
res[obj.id] = obj.num
})
rankMap[character.id + "05"].level_up_skills.forEach((obj: RankLevelUpSkillInfo) => {
res[obj.id] = obj.num
})
}
})
return res
})
onMounted(() => {
fetch(translate('sr_charRanksJsonUrl'))
Expand Down Expand Up @@ -558,19 +535,16 @@ const showCharDetails = (index: number) => {
</div>
<div v-else class="ml-2 mt-2 text-lg align-middle h-full font-sr-sans">
<div class="text-gray-200"
v-if="!rankAdditions[character.skills[idx - 1].id]">
v-if="character.skill_trees[idx - 1].max_level <= (idx == 1 ? 6 : 10)">
{{ character.skill_trees[idx - 1].level }} <span class="text-gray-400">/{{
character.skill_trees[idx - 1].max_level
}}</span>
</div>
<div v-else class=" text-cyan-400">
{{
character.skill_trees[idx - 1].level + rankAdditions[character.skills[idx -
1].id]
character.skill_trees[idx - 1].level + (idx == 1 ? 1 : 2)
}} <span class="text-gray-400">/{{
character.skill_trees[idx - 1].max_level +
rankAdditions[character.skills[idx -
1].id]
character.skill_trees[idx - 1].max_level
}}</span>
</div>
</div>
Expand Down

0 comments on commit e6350e4

Please sign in to comment.