private void SavePawnPartial(PartialManager <PawnKindItem> .PartialUgc data) { Task.Run( async() => { await Data.SaveJsonAsync( new PartialData <PawnKindItem> { Data = _pawnWorker.Data.Where(i => !i.IsHidden).Select(i => i.Data).ToList(), PartialType = PartialType.Pawns, Description = data.Description }, Path.Combine(Paths.PartialPath, data.Name) ); } ); }
private void SaveEventPartial(PartialManager <EventPartial> .PartialUgc data) { Task.Run( async() => { await Data.SaveJsonAsync( new PartialData <EventPartial> { Data = _eventWorker.Data.Where(i => !i.IsHidden).Select(i => i.Data).Select(EventPartial.FromIncident).ToList(), PartialType = PartialType.Events, Description = data.Description }, Path.Combine(Paths.PartialPath, data.Name) ); } ); }
private void SavePartial() { if (_tabWorker.SelectedTab == _itemTab) { Find.WindowStack.Add(PartialManager <ItemPartial> .CreateSaveInstance(SaveItemPartial)); } else if (_tabWorker.SelectedTab == _eventTab) { Find.WindowStack.Add(PartialManager <EventPartial> .CreateSaveInstance(SaveEventPartial)); } else if (_tabWorker.SelectedTab == _traitTab) { Find.WindowStack.Add(PartialManager <TraitItem> .CreateSaveInstance(SaveTraitPartial)); } else if (_tabWorker.SelectedTab == _pawnTab) { Find.WindowStack.Add(PartialManager <PawnKindItem> .CreateSaveInstance(SavePawnPartial)); } }
private void LoadPartial() { if (_tabWorker.SelectedTab == _itemTab) { Find.WindowStack.Add(PartialManager <ItemPartial> .CreateLoadInstance(LoadPartialItemData)); } else if (_tabWorker.SelectedTab == _eventTab) { Find.WindowStack.Add(PartialManager <EventPartial> .CreateLoadInstance(LoadPartialEventData)); } else if (_tabWorker.SelectedTab == _pawnTab) { Find.WindowStack.Add(PartialManager <PawnKindItem> .CreateLoadInstance(LoadPartialPawnData)); } else if (_tabWorker.SelectedTab == _traitTab) { Find.WindowStack.Add(PartialManager <TraitItem> .CreateLoadInstance(LoadPartialTraitData)); } }
private void SaveItemPartial(PartialManager <ItemPartial> .PartialUgc data) { Task.Run( async() => { await Data.SaveJsonAsync( new PartialData <ItemPartial> { Data = _itemWorker.Data.Where(i => !i.IsHidden) .Select(i => i.Data) .Select(i => new ItemPartial { DefName = i.DefName, Cost = i.Cost, Enabled = i.Enabled, Name = i.Name, ItemData = i.ItemData }) .ToList(), PartialType = PartialType.Items, Description = data.Description }, Path.Combine(Paths.PartialPath, data.Name) ); } ); }