added new confirmation message for begin quest alert dialog

This commit is contained in:
Lula Villalobos 2017-10-27 14:29:07 -07:00 committed by Phillip Thelen
parent 25be61fbdc
commit 4756369b3b
2 changed files with 5 additions and 1 deletions

View file

@ -300,6 +300,8 @@
<string name="quest_cancel_message">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.</string>
<string name="quest.invitation">Quest Invitation</string>
<string name="quest_begin_message">Are you sure you want to begin the quest? Once it is active, no additional party members can join the quest.</string>
<!--TODO quest_begin_message_2 for every translation-->
<string name="quest_begin_message_2">Are you sure? Only %1$d of your %2$d party members have joined this quest! Quests start automatically when all players have joined or rejected the invitation.</string>
<string name="quest.invitation.text">You have been invited to participate in a quest!</string>
<string name="ago_1day">1 day ago</string>
<string name="ago_days" >%d days ago</string>

View file

@ -81,6 +81,7 @@ public class QuestDetailFragment extends BaseMainFragment {
public String questKey;
private Group party;
private Quest quest;
private String begin_quest_message;
@Nullable
@ -205,6 +206,7 @@ public class QuestDetailFragment extends BaseMainFragment {
} else {
participantHeader.setText(R.string.invitations);
participantHeaderCount.setText(participantCount + "/" + quest.participants.size());
begin_quest_message = getString(R.string.quest_begin_message_2, participantCount, quest.participants.size());
}
}
@ -230,7 +232,7 @@ public class QuestDetailFragment extends BaseMainFragment {
@OnClick(R.id.quest_begin_button)
public void onQuestBegin() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
.setMessage(R.string.quest_begin_message)
.setMessage(begin_quest_message)
.setPositiveButton(R.string.yes, (dialog, which) -> socialRepository.forceStartQuest(party)
.subscribe(quest -> {}, RxErrorHandler.handleEmptyError()))
.setNegativeButton(R.string.no, (dialog, which) -> {});