Пример #1
0
        private void additionalPlayerStatsButton_Click(object sender, EventArgs e)
        {
            var i       = Array.FindIndex(activeSaveFile.GetStatsMap().Keys, x => x.EntityHash == 1);
            var details = new ItemDetails();

            details.LoadStatsOnly(activeSaveFile.GetStatsMap().Values[i].Seed, activeSaveFile, "Player");
        }
Пример #2
0
        private void RemoveStat(Handle <GameStatModifierData> statsHandle)
        {
            var modifiersList = activeSaveFile.GetItemStatData(activeItem).StatModifiers.ToList();

            modifiersList.Remove(statsHandle);
            activeSaveFile.GetItemStatData(activeItem).StatModifiers = modifiersList.ToArray();

            activeSaveFile.GetStatsContainer().RemoveHandle((int)statsHandle.Id);

            foreach (GameSavedStatsData value in activeSaveFile.GetStatsMap().Values)
            {
                if (value.StatModifiers != null)
                {
                    foreach (Handle <GameStatModifierData> modifierData in value.StatModifiers)
                    {
                        if (modifierData.Id > statsHandle.Id)
                        {
                            modifierData.SetId(modifierData.Id - 1);
                        }
                    }
                }
            }
        }