mirror of
https://github.com/kihashi/stardew_community_checklist.git
synced 2025-10-19 08:03:17 +00:00
Merge pull request #29 from kihashi/feature/#28-room-completion
Feature/#28 room completion
This commit is contained in:
commit
f24bcafe47
22
index.html
22
index.html
@ -141,9 +141,25 @@
|
||||
</nav>
|
||||
</div>
|
||||
<div class="column">
|
||||
<h3 class="title">{{ static.bundles[active_bundle].name }}</h3>
|
||||
<progress class="progress is-info" value="{{ user_data[active_bundle].length }}"
|
||||
max="{{ static.bundles[active_bundle].items_required }}"></progress>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<h3 class="title">{{ static.bundles[active_bundle].name }}</h3>
|
||||
<h5 class="subtitle">{{ static.bundles[active_bundle].reward }}</h5>
|
||||
<progress class="progress is-info"
|
||||
value="{{ user_data[active_bundle].length }}"
|
||||
max="{{ static.bundles[active_bundle].items_required }}"></progress>
|
||||
</div>
|
||||
<div class="column">
|
||||
<h3 class="title">{{ static.rooms[static.bundles[active_bundle].room].name }}</h3>
|
||||
<h5 class="subtitle">{{ static.rooms[static.bundles[active_bundle].room].reward }}</h5>
|
||||
<progress class="progress is-info"
|
||||
value="{{ getRoomItemsChecked(static.bundles[active_bundle].room) }}"
|
||||
max="{{ getRoomItemsRequired(static.bundles[active_bundle].room) }}"
|
||||
>
|
||||
|
||||
</progress>
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns is-multiline">
|
||||
<div class="column is-3 is-flex" v-for="item in static.items | inBundle active_bundle">
|
||||
<div class="card is-fullwidth is-flex eq-line">
|
||||
|
||||
16
main.js
16
main.js
@ -116,6 +116,22 @@ var v = new Vue({
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},
|
||||
getRoomItemsRequired: function(roomId) {
|
||||
return this.static.bundles.reduce(function(previousValue, nextValue){
|
||||
if(nextValue.room === roomId){
|
||||
return previousValue + nextValue.items_required;
|
||||
}
|
||||
else{
|
||||
return previousValue;
|
||||
}
|
||||
}, 0)
|
||||
},
|
||||
getRoomItemsChecked: function(roomId){
|
||||
return this.static.bundles
|
||||
.filter(function(b){ return b.room === roomId; })
|
||||
.map(function(b){ return b.id; })
|
||||
.reduce(function(p, c){ return p + v.user_data[c].length; }, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user