Exemple #1
0
    public void ConfirmRename()
    {
        SC_SavedDataManager.savedData.decks.Remove(SelectedDeck.name);

        SelectedDeck.name = renameInput.text;

        SelectedDeck.deckName.text = SelectedDeck.name;

        SC_SavedDataManager.SaveDeck(SelectedDeck.name, SelectedDeck.Deck);

        renamePanel.SetActive(false);
    }
Exemple #2
0
    public void Clone(int iteration)
    {
        if (loadedDecks.ContainsKey(SelectedDeck.name + " " + iteration))
        {
            Clone(iteration + 1);
        }
        else
        {
            SetSelectedDeck(CreateDeck(SelectedDeck.name + " " + iteration, SelectedDeck.Deck));

            SC_SavedDataManager.SaveDeck(SelectedDeck.name, SelectedDeck.Deck);
        }
    }
Exemple #3
0
    public void Save()
    {
        string deck = CardsListToCode(new List <SC_BaseCard> (deckCards.Keys));

        if (DecksManager.loadedDecks.ContainsKey(deckSavingName.text))
        {
            if (DecksManager.SelectedDeck.name == deckSavingName.text)
            {
                DecksManager.loadedDecks[deckSavingName.text].Setup(deckSavingName.text, deck);

                DecksManager.gameObject.SetActive(true);
            }
            else
            {
                DecksManager.SetupConfirmPanel("replace the deck with this existing name", () => {
                    DecksManager.SetSelectedDeck(DecksManager.loadedDecks[deckSavingName.text]);

                    Save();
                });

                ShowSavePanel(false);

                return;
            }
        }
        else
        {
            DecksManager.SetSelectedDeck(DecksManager.CreateDeck(deckSavingName.text, deck));
        }

        Back();

        SC_SavedDataManager.SaveDeck(deckSavingName.text, deck);

        ShowSavePanel(false);
    }