mirror of
https://github.com/misenhower/splatoon2.ink.git
synced 2026-07-13 07:01:33 -05:00
Add support for potential new Salmon Run special weapons
Nintendo changed the way "random" weapons appear for Salmon Run. Previously, these were just listed as "null" values, but now they have a new "coop_special_weapon" key with an image and name. This change adds support for downloading images and localized names for these weapons just in case any special weapons appear here in the future.
This commit is contained in:
parent
d914bb2f61
commit
2f94dfe23e
|
|
@ -8,15 +8,30 @@
|
|||
{{ stageName }}
|
||||
</div>
|
||||
|
||||
<div class="column" :class="{ 'is-5': mini }" style="display: flex; align-items: center;" v-if="weapons">
|
||||
<div class="column" :class="{ 'is-5': mini }" style="display: flex; align-items: center;" v-if="schedule.weapons">
|
||||
<div style="width: 100%">
|
||||
<div class="has-text-centered" v-if="!mini">{{ $t('coop.supplied_weapons') }}</div>
|
||||
|
||||
<div class="columns is-mobile is-slimmer">
|
||||
<div class="column" v-for="weapon in weapons">
|
||||
<div class="column" v-for="weapon in schedule.weapons">
|
||||
<div class="image is-square weapon">
|
||||
<img :src="weapon.image | localSplatNetImageUrl" :title="$t(`splatnet.weapons.${weapon.id}.name`, weapon.name)" v-if="weapon" />
|
||||
<img src="~@/img/salmon-run-random-weapon.png" :title="$t('coop.random_weapon')" style="padding: 8px" v-else />
|
||||
<template v-if="weapon.weapon">
|
||||
<img
|
||||
:src="weapon.weapon.image | localSplatNetImageUrl"
|
||||
:title="$t(`splatnet.weapons.${weapon.weapon.id}.name`, weapon.weapon.name)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-else-if="weapon.coop_special_weapon">
|
||||
<img
|
||||
:src="weapon.coop_special_weapon.image | localSplatNetImageUrl"
|
||||
:title="$t(`splatnet.coop_special_weapons.${weapon.coop_special_weapon.image}.name`, weapon.coop_special_weapon.name)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<img src="~@/img/salmon-run-random-weapon.png" :title="$t('coop.random_weapon')" style="padding: 8px" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -36,10 +51,6 @@ export default {
|
|||
let stage = this.schedule.stage;
|
||||
return this.$t(`splatnet.coop_stages.${stage.image}.name`, stage.name);
|
||||
},
|
||||
weapons() {
|
||||
if (this.schedule.weapons)
|
||||
return this.schedule.weapons.map(w => w ? w.weapon : null);
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class CoopSchedulesUpdater extends Updater {
|
|||
imagePaths: [
|
||||
'$..stage.image',
|
||||
'$..weapons[*].weapon.image',
|
||||
'$..coop_special_weapon.image'
|
||||
],
|
||||
localization: [
|
||||
{
|
||||
|
|
@ -18,6 +19,12 @@ class CoopSchedulesUpdater extends Updater {
|
|||
id: 'image', // Unfortunately these don't have an ID, so we'll just match them by image URL
|
||||
values: 'name',
|
||||
},
|
||||
{
|
||||
name: 'coop_special_weapons',
|
||||
entities: '$..coop_special_weapon',
|
||||
id: 'image', // These don't have a name either
|
||||
values: 'name',
|
||||
},
|
||||
{
|
||||
name: 'weapons',
|
||||
entities: '$..weapons[?(@.id)].weapon',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user