Esempio n. 1
0
    /// <summary>
    /// Updates a single slot ui object
    /// </summary>
    /// <param name="slot"></param>
    public void UpdateSlot(int slot)
    {
        SaveLoadManager saveManager = SaveLoadManager.instance;
        SaveSlotUI      ssui        = saveSlots[slot];
        GameData        data        = saveManager.LoadGameData(ssui.slot);

        // no data available for thatt slot
        if (data == null)
        {
            // show "empty"
            ssui.newSlot.SetActive(true);
            ssui.saveInfo.SetActive(false);
            return;
        }
        // data is available for that slot
        else
        {
            // show info
            ssui.newSlot.SetActive(false);
            ssui.saveInfo.SetActive(true);

            // set text
            ssui.nameText.text   = data.name;
            ssui.dayValue.text   = data.days + "";
            ssui.timeValue.text  = data.currentHour + ":" + data.currentMinute;
            ssui.goldValue.text  = data.playerGold + "g";
            ssui.levelValue.text = data.playerLevel + "";
            ssui.classValue.text = data.className;
        }
    }
Esempio n. 2
0
        void SaveGameSelectionScreen_OnNewGame(On.SaveGameSelectionScreen.orig_OnNewGame orig, SaveGameSelectionScreen self, SaveSlotUI slot)
        {
            //Right now I am not randomizing game slots that are brand new.
            Console.WriteLine($"This file slot is brand new. Resetting the mappings and putting game items back to normal.");
            randoStateManager.ResetRandomizerState();
            randoStateManager.ResetSeedForFileSlot(slot.slotIndex + 1);

            orig(self, slot);
        }