mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Moves "Current_Deck" from Quest Preferences to Quest Data.
Without this, the selected deck name was global for all quests - switching to another quest retained the deck name from the previous quest and if the new quest had a deck with the identical name, selected that one, otherwise selected nothing. (in one weird case, this resulted in quest data that crashed caused bugs when loading forge - as quest was saved with a selected deck from another quest data.) Preferred behavior is to select the deck that was last selected in THAT QUEST when switching to another quest.
This commit is contained in:
@@ -62,7 +62,7 @@ public class SEditorIO {
|
||||
VAllDecks.SINGLETON_INSTANCE.getLstDecks().setSelectedString(deckStr);
|
||||
// Set current quest deck to selected
|
||||
if (Singletons.getControl().getCurrentScreen() == FScreen.DECK_EDITOR_QUEST) {
|
||||
FModel.getQuestPreferences().setPref(QPref.CURRENT_DECK, name);
|
||||
FModel.getQuest().setCurrentDeck(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ public enum CSubmenuQuestDecks implements ICDoc {
|
||||
public void run() {
|
||||
final DeckProxy deck = VSubmenuQuestDecks.SINGLETON_INSTANCE.getLstDecks().getSelectedItem();
|
||||
if (deck != null) {
|
||||
FModel.getQuestPreferences().setPref(QPref.CURRENT_DECK, deck.toString());
|
||||
FModel.getQuest().setCurrentDeck(deck.toString());
|
||||
}
|
||||
else {
|
||||
FModel.getQuestPreferences().setPref(QPref.CURRENT_DECK, QPref.CURRENT_DECK.getDefault());
|
||||
FModel.getQuest().setCurrentDeck(QPref.CURRENT_DECK.getDefault());
|
||||
}
|
||||
FModel.getQuestPreferences().save();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public enum CSubmenuQuestDecks implements ICDoc {
|
||||
view.getLstDecks().setup(ItemManagerConfig.QUEST_DECKS);
|
||||
|
||||
// Look through list for preferred deck from prefs
|
||||
final DeckProxy deck = hasQuest ? view.getLstDecks().stringToItem(FModel.getQuestPreferences().getPref(QPref.CURRENT_DECK)) : null;
|
||||
final DeckProxy deck = hasQuest ? view.getLstDecks().stringToItem(FModel.getQuest().getCurrentDeck()) : null;
|
||||
if (deck != null) {
|
||||
view.getLstDecks().setSelectedItem(deck);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user