Beispiel #1
0
    public void DumpVillagerArray()
    {
        UI_Popup.CurrentInstance.CreatePopupMessage(0.001f, "Fetching all villager data, this may take a long time...", () =>
        {
            var villagerBytes      = CurrentConnection.ReadBytes(CurrentVillagerAddress, VillagersSize);
            var villagerHouseBytes = CurrentConnection.ReadBytes(CurrentVillagerHouseAddress, VillagerHousesSize);
            var combined           = villagerBytes.Concat(villagerHouseBytes).ToArray();

            string names = string.Empty;
            // get names
            for (int i = 0; i < 10; ++i)
            {
                var species = (VillagerSpecies)villagerBytes[i * Villager2.SIZE];
                if (species != VillagerSpecies.non)
                {
                    var variant = villagerBytes[(i * Villager2.SIZE) + 1];
                    var intern  = VillagerUtil.GetInternalVillagerName(species, variant);
                    names      += $"_{GameInfo.Strings.GetVillager(intern)}";
                }
                else
                {
                    names += $"_EMPTY";
                }
            }

            UI_NFSOACNHHandler.LastInstanceOfNFSO.SaveFile($"{names}.bin", combined);
        });
    }
Beispiel #2
0
 private string GetCurrentVillagerInternalName() => VillagerUtil.GetInternalVillagerName((VillagerSpecies)NUD_Species.Value, (int)NUD_Variant.Value);
Beispiel #3
0
        /// <summary>
        /// Gets the Villager's 128x128 sprite based on the input parameters.
        /// </summary>
        /// <param name="species">Species of Villager</param>
        /// <param name="variant">Variant of Villager</param>
        public static Image?GetVillagerSprite(VillagerSpecies species, int variant)
        {
            var asset = VillagerUtil.GetInternalVillagerName(species, variant);

            return(GetVillagerSprite(asset));
        }