mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added confirmation step at begin button for quest (#9199)
* Added confirmation step at begin button for quest * Fixed the 3 errors caused by questConfirm method in travis-ci
This commit is contained in:
committed by
Sabe Jones
parent
b3870e5f34
commit
b323abd225
@@ -15,7 +15,7 @@
|
||||
questDialogContent(:item="questData")
|
||||
div.text-center.actions(v-if='canEditQuest')
|
||||
div
|
||||
button.btn.btn-secondary(v-once, @click="questForceStart()") {{ $t('begin') }}
|
||||
button.btn.btn-secondary(v-once, @click="questConfirm()") {{ $t('begin') }}
|
||||
// @TODO don't allow the party leader to start the quest until the leader has accepted or rejected the invitation (users get confused and think "begin" means "join quest")
|
||||
div
|
||||
.cancel(v-once, @click="questCancel()") {{ $t('cancel') }}
|
||||
@@ -195,6 +195,14 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async questConfirm () {
|
||||
let count = 0;
|
||||
for (let uuid in this.group.quest.members) {
|
||||
if (this.group.quest.members[uuid]) count += 1;
|
||||
}
|
||||
if (!confirm(this.$t('questConfirm', { questmembers: count, totalmembers: this.group.memberCount}))) return;
|
||||
this.questForceStart();
|
||||
},
|
||||
async questForceStart () {
|
||||
let quest = await this.$store.dispatch('quests:sendAction', {groupId: this.group._id, action: 'quests/force-start'});
|
||||
this.group.quest = quest;
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
"mustLvlQuest": "You must be level <%= level %> to buy this quest!",
|
||||
"mustInviteFriend": "To earn this quest, invite a friend to your Party. Invite someone now?",
|
||||
"unlockByQuesting": "To unlock this quest, complete <%= title %>.",
|
||||
"questConfirm": "Are you sure? Only <%= questmembers %> of your <%= totalmembers %> party members have joined this quest! Quests start automatically when all players have joined or rejected the invitation.",
|
||||
"sureCancel": "Are you sure you want to cancel this quest? All invitation acceptances will be lost. The quest owner will retain possession of the quest scroll.",
|
||||
"sureAbort": "Are you sure you want to abort this mission? It will abort it for everyone in your party and all progress will be lost. The quest scroll will be returned to the quest owner.",
|
||||
"doubleSureAbort": "Are you double sure? Make sure they won't hate you forever!",
|
||||
|
||||
Reference in New Issue
Block a user