mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Quest submenu: users w/o new quest data are now shown new quest tab directly, cannot access duels or challenge tabs.
This commit is contained in:
@@ -413,31 +413,30 @@ public class ViewQuest extends JScrollPane {
|
|||||||
//========= TAB SHOW METHODS
|
//========= TAB SHOW METHODS
|
||||||
/** Display handler for duel tab click. */
|
/** Display handler for duel tab click. */
|
||||||
public void showDuelsTab() {
|
public void showDuelsTab() {
|
||||||
|
if (AllZone.getQuestData() == null) {
|
||||||
|
showQuestsTab();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
control.updateTabber(tabDuels);
|
||||||
|
hideAllPanels();
|
||||||
|
pnlTitle.setVisible(true);
|
||||||
|
|
||||||
|
setCurrentDeckStatus();
|
||||||
|
updateDuels();
|
||||||
|
updateStats();
|
||||||
|
lblTitle.setText("Duels: " + control.getRankString());
|
||||||
|
|
||||||
|
// Select first event.
|
||||||
|
if (control.getCurrentDeck() != null) {
|
||||||
|
pnlStart.setVisible(true);
|
||||||
|
selectedOpponent = (SelectablePanel) pnlDuels.getComponent(0);
|
||||||
|
selectedOpponent.setSelected(true);
|
||||||
|
}
|
||||||
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
control.updateTabber(tabDuels);
|
|
||||||
hideAllPanels();
|
|
||||||
pnlTitle.setVisible(true);
|
|
||||||
|
|
||||||
if (AllZone.getQuestData() == null) {
|
|
||||||
lblTitle.setText("Start a new Quest in the \"Quests\" tab.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setCurrentDeckStatus();
|
|
||||||
updateDuels();
|
|
||||||
updateStats();
|
|
||||||
lblTitle.setText("Duels: " + control.getRankString());
|
|
||||||
|
|
||||||
if (control.getCurrentDeck() != null) {
|
|
||||||
pnlStart.setVisible(true);
|
|
||||||
|
|
||||||
// Select first event.
|
|
||||||
selectedOpponent = (SelectablePanel) pnlDuels.getComponent(0);
|
|
||||||
selectedOpponent.setSelected(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
pnlStats.setVisible(true);
|
pnlStats.setVisible(true);
|
||||||
pnlDuels.setVisible(true);
|
pnlDuels.setVisible(true);
|
||||||
}
|
}
|
||||||
@@ -446,15 +445,15 @@ public class ViewQuest extends JScrollPane {
|
|||||||
|
|
||||||
/** Display handler for duel tab click. */
|
/** Display handler for duel tab click. */
|
||||||
public void showChallengesTab() {
|
public void showChallengesTab() {
|
||||||
|
if (AllZone.getQuestData() == null) {
|
||||||
|
showQuestsTab();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
control.updateTabber(tabChallenges);
|
control.updateTabber(tabChallenges);
|
||||||
hideAllPanels();
|
hideAllPanels();
|
||||||
pnlTitle.setVisible(true);
|
pnlTitle.setVisible(true);
|
||||||
|
|
||||||
if (AllZone.getQuestData() == null) {
|
|
||||||
lblTitle.setText("Start a new Quest in the \"Quests\" tab.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setCurrentDeckStatus();
|
setCurrentDeckStatus();
|
||||||
updateChallenges();
|
updateChallenges();
|
||||||
updateStats();
|
updateStats();
|
||||||
@@ -478,18 +477,16 @@ public class ViewQuest extends JScrollPane {
|
|||||||
|
|
||||||
/** Display handler for decks tab click. */
|
/** Display handler for decks tab click. */
|
||||||
public void showDecksTab() {
|
public void showDecksTab() {
|
||||||
|
if (AllZone.getQuestData() == null) {
|
||||||
|
showQuestsTab();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
control.updateTabber(tabDecks);
|
control.updateTabber(tabDecks);
|
||||||
this.hideAllPanels();
|
this.hideAllPanels();
|
||||||
pnlTitle.setVisible(true);
|
pnlTitle.setVisible(true);
|
||||||
|
lblTitle.setText("Quest Deck Manager");
|
||||||
if (AllZone.getQuestData() == null) {
|
pnlDecks.setVisible(true);
|
||||||
lblTitle.setText("Start a new Quest in the \"Quests\" tab.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
lblTitle.setText("Quest Deck Manager");
|
|
||||||
pnlDecks.setVisible(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Display handler for quests tab click. */
|
/** Display handler for quests tab click. */
|
||||||
|
|||||||
Reference in New Issue
Block a user