The Quest world format, if present, overrides the user-defined format.

This commit is contained in:
RumbleBBU
2012-12-30 08:45:36 +00:00
parent ca01e771dc
commit 004684a473
2 changed files with 21 additions and 2 deletions

View File

@@ -167,7 +167,7 @@ public class SSubmenuQuestUtil {
// Show or hide the set unlocking button
view0.getBtnUnlock().setVisible(qCtrl.getUnlocksTokens() > 0);
view0.getBtnUnlock().setVisible(qCtrl.getUnlocksTokens() > 0 && qCtrl.getWorldFormat() == null);
// Challenge in wins
final int num = SSubmenuQuestUtil.nextChallengeInWins();

View File

@@ -135,7 +135,8 @@ public class QuestController {
* @return GameFormatQuest, the game format (if persistent).
*/
public GameFormatQuest getFormat() {
return this.questFormat;
return (getWorldFormat() == null ? this.questFormat : getWorldFormat());
}
/**
@@ -286,6 +287,24 @@ public class QuestController {
this.model.setWorldId(newWorld == null ? null : newWorld.getName());
}
/**
* Gets the QuestWorld Format, if any.
*
* @return QuestWorld Format or null.
*/
public GameFormatQuest getWorldFormat() {
if (this.model == null || this.model.getWorldId() == null) {
return null;
}
final QuestWorld curQw = Singletons.getModel().getWorlds().get(this.model.getWorldId());
if (curQw == null) {
return null;
}
return curQw.getFormat();
}
/**
* TODO: Write javadoc for this method.