temporary

This commit is contained in:
Bart van der Braak 2020-02-03 18:26:49 +01:00
parent afcff941f2
commit 4430bbb147
2 changed files with 112 additions and 55 deletions

42
api/masters_simple.json Normal file
View file

@ -0,0 +1,42 @@
{
"0": {
"id": 0,
"name": "Turael",
"image": "Turael.png"
},
"1": {
"id": 1,
"name": "Krystilia",
"image": "Krystilia.png"
},
"2": {
"id": 2,
"name": "Mazchna",
"image": "Mazchna.png"
},
"3": {
"id": 3,
"name": "Vannaka",
"image": "Vannaka.png"
},
"4": {
"id": 4,
"name": "Chaeldar",
"image": "Chaeldar.png"
},
"5": {
"id": 5,
"name": "Konar quo Maten",
"image": "Konar quo Maten.png"
},
"6": {
"id": 6,
"name": "Nieve",
"image": "Nieve.png"
},
"7": {
"id": 7,
"name": "Duradel",
"image": "Duradel.png"
}
}

View file

@ -1,11 +1,11 @@
<template> <template>
<section> <section>
<div class="pt-3 pb-2 my-2"> <div class="pt-3 pb-2 my-2">
<h1 class="h3 text-uppercase mb-2">Account Settings</h1> <h1 class="h3 text-uppercase mb-2" @click="testConfig">Account Settings</h1>
<hr> <hr>
<h4>Stats</h4> <h4>Stats</h4>
<b-row class="text-center align-content-center"> <b-row class="text-center align-content-center">
<b-col sm="6" md="4" v-for="statUnlock in statUnlocks" v-bind:key="statUnlock.id"> <b-col sm="6" md="4" v-for="statUnlock in configData.statUnlocks" v-bind:key="statUnlock.id">
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"> <span class="input-group-text">
@ -29,17 +29,16 @@
<h4>Slayer Point Unlocks</h4> <h4>Slayer Point Unlocks</h4>
<b-form-checkbox <b-form-checkbox
class="mb-1" class="mb-1"
v-for="pointUnlock in pointUnlocks" v-for="pointUnlock in configData.pointUnlocks"
v-bind:key="pointUnlock.id" v-bind:key="pointUnlock.id"
v-model="pointUnlock.unlock" v-model="pointUnlock.unlock"
:name="pointUnlock.name" :name="pointUnlock.name"
value="true" value="true"
unchecked-value="false" unchecked-value="false"
> >
<span class="mr-2">{{ pointUnlock.name }}</span> <span class="mr-2" v-b-tooltip.hover.right :title="''">{{ pointUnlock.name }}
<small class="text-monospace text-muted">{{ monsterPreText(pointUnlock) }}</small> <small class="text-monospace text-muted">{{ monsterPreText(pointUnlock) }}</small>
</span>
</b-form-checkbox> </b-form-checkbox>
</b-col> </b-col>
<b-col> <b-col>
@ -47,7 +46,7 @@
<b-form-select <b-form-select
class="mt-1" class="mt-1"
size="sm" size="sm"
v-for="block in blockList" v-for="block in configData.blockList"
v-bind:key="block.id" v-bind:key="block.id"
v-model="block.monster_ids" v-model="block.monster_ids"
:options="monsterData"> :options="monsterData">
@ -61,7 +60,7 @@
<hr> <hr>
<h4>Quests Unlocks</h4> <h4>Quests Unlocks</h4>
<b-row> <b-row>
<b-col sm="6" md="4" v-for="questUnlock in questUnlocks" v-bind:key="questUnlock.id"> <b-col md="6" xl="4" v-for="questUnlock in configData.questUnlocks" v-bind:key="questUnlock.id">
<b-form-checkbox <b-form-checkbox
class="mb-1" class="mb-1"
v-model="questUnlock.unlock" v-model="questUnlock.unlock"
@ -92,15 +91,16 @@ export default {
data() { data() {
return { return {
monsterData: monster_json, monsterData: monster_json,
configData: {
pointUnlocks: [ pointUnlocks: [
{id: 0, name: 'Seeing red', monster_ids: [83, 3], unlock: false}, {id: 0, name: 'Seeing red', monster_ids: [83, 3], unlock: false, masters: [5,6,7]},
{id: 1, name: 'I hope you mith me', monster_ids: [72], unlock: false}, {id: 1, name: 'I hope you mith me', monster_ids: [72], unlock: false, masters: [5,6,7]},
{id: 2, name: 'Watch the birdie', monster_ids: [4], unlock: false}, {id: 2, name: 'Watch the birdie', monster_ids: [4], unlock: false, masters: [4,5,6,7]},
{id: 3, name: 'Hot stuff', monster_ids: [102], unlock: false}, {id: 3, name: 'Hot stuff', monster_ids: [102], unlock: false, masters: [4,6,7]},
{id: 4, name: 'Reptile got ripped', monster_ids: [66], unlock: false}, {id: 4, name: 'Reptile got ripped', monster_ids: [66], unlock: false, masters: [4,5,6,7]},
{id: 5, name: 'Like a boss', monster_ids: [15], unlock: false}, {id: 5, name: 'Like a boss', monster_ids: [15], unlock: false, masters: [5,6,7]},
{id: 6, name: 'Stop the Wyvern', monster_ids: [42], unlock: false, block: true}, {id: 6, name: 'Stop the Wyvern', monster_ids: [42], unlock: false, block: true},
{id: 7, name: 'Basilocked', monster_ids: [7], unlock: false, block: true}, {id: 7, name: 'Basilocked', monster_ids: [7], unlock: false, masters: [5,6,7]},
], ],
blockList: [ blockList: [
{id: 0, name: 'Block task (50 quest points)', monster_ids: null, block: true}, {id: 0, name: 'Block task (50 quest points)', monster_ids: null, block: true},
@ -141,6 +141,7 @@ export default {
{id: 2, name: 'Defence level', value: {min: 1, current: 99, max: 99}, image: 'Defence_icon.png', unlock: false}, {id: 2, name: 'Defence level', value: {min: 1, current: 99, max: 99}, image: 'Defence_icon.png', unlock: false},
] ]
} }
}
}, },
methods: { methods: {
monsterPreText(entry) { monsterPreText(entry) {
@ -154,12 +155,26 @@ export default {
}, },
monsterListString(entry) { monsterListString(entry) {
let monsterList = []; let monsterList = [];
entry.monster_ids.forEach( id => { entry['monster_ids'].forEach( id => {
monsterList.push(this.monsterData[id].text) monsterList.push(this.monsterData[id].text)
}); });
return monsterList.join(', ').replace(/,(?!.*,)/gmi, ' and'); return monsterList.join(', ').replace(/,(?!.*,)/gmi, ' and');
}, },
masterListString(entry) {
let monsterList = [];
entry['add_to_sm'].forEach( id => {
monsterList.push(this.mastersData[id].name)
});
return 'Assigned by' + monsterList.join(', ').replace(/,(?!.*,)/gmi, ' and');
},
testConfig() {
console.log(JSON.stringify(this.configData.blockList, null, 2))
},
},
beforeDestroy: function() {
this.$emit('config', this.configData)
} }
} }
</script> </script>