protected override void OnAwake(PlayerActor player) { CraftPoint currentCraftPoint = player.CurrentCraftPoint; if (Object.op_Equality((Object)currentCraftPoint, (Object)null) || !Singleton <MapUIContainer> .IsInstance()) { player.PlayerController.ChangeState("Normal"); } else { MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None); player.SetScheduledInteractionState(false); player.ReleaseInteraction(); CraftUI craftUi = (CraftUI)null; RecyclingUI recyclingUi = (RecyclingUI)null; switch (currentCraftPoint.Kind) { case CraftPoint.CraftKind.Medicine: craftUi = MapUIContainer.MedicineCraftUI; break; case CraftPoint.CraftKind.Pet: craftUi = MapUIContainer.PetCraftUI; break; case CraftPoint.CraftKind.Recycling: recyclingUi = MapUIContainer.RecyclingUI; break; default: this.OnClosed(player); break; } if (Object.op_Inequality((Object)craftUi, (Object)null)) { craftUi.OnClosedEvent = (Action)(() => this.OnClosed(player)); craftUi.IsActiveControl = true; } else if (Object.op_Inequality((Object)recyclingUi, (Object)null)) { recyclingUi.OnClosedEvent = (Action)(() => this.OnClosed(player)); recyclingUi.IsActiveControl = true; } else { this.OnClosed(player); } } }
private void SetRecyclingData() { this.RecyclingData = (RecyclingData)null; int num = -1; this.CraftPointID = num; this._craftPointID = num; CraftPoint currentCraftPoint = Manager.Map.GetPlayer()?.CurrentCraftPoint; if (!Object.op_Inequality((Object)currentCraftPoint, (Object)null)) { return; } int key = this._craftPointID = currentCraftPoint.RegisterID; WorldData worldData = !Singleton <Game> .IsInstance() ? (WorldData)null : Singleton <Game> .Instance.WorldData; AIProject.SaveData.Environment environment = worldData == null ? (AIProject.SaveData.Environment)null : worldData.Environment; Dictionary <int, RecyclingData> dictionary = environment == null ? (Dictionary <int, RecyclingData>)null : environment.RecyclingDataTable; if (dictionary == null) { return; } RecyclingData recyclingData1 = (RecyclingData)null; if (dictionary.TryGetValue(key, out recyclingData1) && recyclingData1 != null) { this.RecyclingData = recyclingData1; } else { RecyclingData recyclingData2 = new RecyclingData(); dictionary[key] = recyclingData2; this.RecyclingData = recyclingData2; } }