mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
The Quest world format, if present, overrides the user-defined format.
This commit is contained in:
@@ -167,7 +167,7 @@ public class SSubmenuQuestUtil {
|
|||||||
|
|
||||||
// Show or hide the set unlocking button
|
// 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
|
// Challenge in wins
|
||||||
final int num = SSubmenuQuestUtil.nextChallengeInWins();
|
final int num = SSubmenuQuestUtil.nextChallengeInWins();
|
||||||
|
|||||||
@@ -135,7 +135,8 @@ public class QuestController {
|
|||||||
* @return GameFormatQuest, the game format (if persistent).
|
* @return GameFormatQuest, the game format (if persistent).
|
||||||
*/
|
*/
|
||||||
public GameFormatQuest getFormat() {
|
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());
|
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.
|
* TODO: Write javadoc for this method.
|
||||||
|
|||||||
Reference in New Issue
Block a user