public override void Update() { base.Update(); if (ImprovedPublicTransportMod.Settings.HideVehicleEditor != this._hide) { this._hide = ImprovedPublicTransportMod.Settings.HideVehicleEditor; this.isVisible = !this._hide; } if (ImprovedPublicTransportMod.Settings.VehicleEditorPosition != this._position) { this._position = ImprovedPublicTransportMod.Settings.VehicleEditorPosition; if (this.isVisible) { this.UpdatePosition(); } } if (!this._initialized) { this._publicTransportInfoViewPanel = GameObject.Find("(Library) PublicTransportInfoViewPanel").GetComponent <PublicTransportInfoViewPanel>(); if (!((UnityEngine.Object) this._publicTransportInfoViewPanel != (UnityEngine.Object)null)) { return; } this._publicTransportInfoViewPanel.component.eventVisibilityChanged += new PropertyChangedEventHandler <bool>(this.ParentVisibilityChanged); this._publicTransportInfoViewPanel.component.eventPositionChanged += new PropertyChangedEventHandler <Vector2>(this.ParentPositionChanged); this.CreatePanel(); this._settingsPanel = this.AddUIComponent <SettingsPanel>(); VehicleEditor.Instance = this; this._initialized = true; } else if (this._initialized && this.isVisible && this._firstShow) { this.FirstShowInit(TransportInfo.TransportType.Bus, (VehicleInfo)null); } else { if (!this._initialized || !this.isVisible) { return; } this._rightSidePanel.Find <UILabel>("MaintenanceCostLabel").text = (Utils.ToSingle(this._rightSidePanel.Find <UITextField>("MaintenanceCost").text) * 0.01f).ToString(ColossalFramework.Globalization.Locale.Get("MONEY_FORMAT"), (IFormatProvider)LocaleManager.cultureInfo); this._rightSidePanel.Find <UILabel>("TicketPriceLabel").text = (Utils.ToSingle(this._rightSidePanel.Find <UITextField>("TicketPrice").text) * 0.01f).ToString(ColossalFramework.Globalization.Locale.Get("MONEY_FORMAT"), (IFormatProvider)LocaleManager.cultureInfo); this._rightSidePanel.Find <UILabel>("MaxSpeedLabel").text = (Utils.ToInt32(this._rightSidePanel.Find <UITextField>("MaxSpeed").text) * 5).ToString() + " " + ImprovedPublicTransportMod.Settings.SpeedString; } }
public static void AfterAwake(PublicTransportInfoViewPanel __instance) => Toolbox = new TLMLineCreationToolbox(__instance);
public static void AfterAwake(PublicTransportInfoViewPanel __instance) => Toolbox = __instance.gameObject.AddComponent <TLMLineCreationToolbox>();