private void LoadItems() { if (pageState == RuinsPageState.LoadedHeader) { pageState = RuinsPageState.LoadingBlueprints; SnapshotManager manager = new SnapshotManager(); manager.Progress = delegate(int progress, int total) { blueprintsLoadedCount = progress; blueprintsToLoadCount = total; }; manager.Completion = delegate(bool success) { Debug.Log(Debug.POI, "Completed loading, creating sites."); pageState = RuinsPageState.ProcessingBlueprints; new Thread(() => { CreateSites(); pageState = RuinsPageState.Completed; }).Start(); }; Debug.Log(Debug.POI, "Loading blueprints one by one..."); manager.AggressiveLoadSnaphotsFromList(blueprintIds, gamePath: SnapshotStoreManager.CurrentGamePath(), loadIfExists: false); } }
private void StartLoadingList() { pageState = RuinsPageState.LoadingHeader; Debug.Log("Loading list for seed: {0}", Find.World.info.seedString); service.LoadAllMapsForSeed(Find.World.info.seedString, Find.World.info.initialMapSize.x, (int)(Find.World.PlanetCoverage * 100), delegate(bool success, List <PlanetTileInfo> mapTiles) { if (success) { this.mapTiles = mapTiles; blueprintIds = new List <string>(); foreach (PlanetTileInfo t in mapTiles) { blueprintIds.Add(t.mapId); } blueprintsTotalCount = blueprintIds.Count; pageState = RuinsPageState.LoadedHeader; Debug.Log("Loaded list of snapshot names, {0} elements", blueprintsTotalCount); LoadItems(); } else { pageState = RuinsPageState.Idle; } }); }