public override void OnCreated(ILoading loading) { base.OnCreated(loading); Cache.Reset(); if (!IsHooked()) { return; } if (OptionsWrapper <Options> .Options.ConvertModernStationsToMetroStations || OptionsWrapper <Options> .Options.ConvertOldStationsToMetroStations || OptionsWrapper <Options> .Options.ConvertTramStationsToMetroStations) { BuildingInfoHook.OnPreInitialization += info => { try { TrainStationToMetroStation.Convert(info); } catch (Exception e) { UnityEngine.Debug.LogError(e); } }; BuildingInfoHook.Deploy(); } }
public override void OnCreated(ILoading loading) { base.OnCreated(loading); Cache.Reset(); if (!IsHooked()) { return; } var isModActive = Util.IsModActive("Metro Overhaul"); if ((isModActive || Util.DLC(SteamHelper.kWinterDLCAppID)) && (OptionsWrapper <Options> .Options.ConvertPantographsToMetros || OptionsWrapper <Options> .Options.ConvertSBahnsToMetros || OptionsWrapper <Options> .Options.ConvertSubwayTrainsToMetros || OptionsWrapper <Options> .Options.ConvertTrainsToTrams)) { VehicleInfoHook.OnPreInitialization += info => { try { if (info.m_class.m_subService == ItemClass.SubService.PublicTransportTrain) { if (isModActive) { TrainToMetro.Convert(info); } if (Util.DLC(SteamHelper.kWinterDLCAppID)) { TrainToTram.Convert(info); } } } catch (Exception e) { UnityEngine.Debug.LogError(e); } }; VehicleInfoHook.Deploy(); } if (isModActive && (OptionsWrapper <Options> .Options.ConvertModernStationsToMetroStations || OptionsWrapper <Options> .Options.ConvertOldStationsToMetroStations || OptionsWrapper <Options> .Options.ConvertTramStationsToMetroStations)) { BuildingInfoHook.OnPreInitialization += info => { try { TrainStationToMetroStation.Convert(info); } catch (Exception e) { UnityEngine.Debug.LogError(e); } }; BuildingInfoHook.Deploy(); } }
public override void OnCreated(ILoading loading) { base.OnCreated(loading); if (!IsHooked() || loading.currentMode != AppMode.Game) { return; } BuildingInfoHook.OnPostInitialization += OnPostBuildingInit; BuildingInfoHook.Deploy(); }
public static void Deploy() { BuildingInfoHook.Deploy(); }