public void InitMod() { GeneratedScrollPanel panel = panelGameObject.GetComponent <GeneratedScrollPanel>(); ShowNetwork("Airplane Runway", "Runway", panel, 7000, 600, "Runway"); ShowNetwork("Airplane Taxiway", "Taxiway", panel, 4000, 200, "Taxiway"); OptionPanelBase optionPanel = (OptionPanelBase)typeof(GeneratedScrollPanel).GetMethod("CreateOptionPanel", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(panel, new object[] { "RoadsOptionPanel" }); optionPanel.HidePanel(); typeof(GeneratedScrollPanel).GetField("m_QuaysOptionPanel", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(panel, optionPanel); }
public static void GeneratedScrollPanelCreateOptionPanelPostfix <TypeMod, TypeButton>(string templateName, ref OptionPanelBase __result) where TypeMod : ICustomMod where TypeButton : UIButton { if (__result == null || templateName != "RoadsOptionPanel" || __result.component.Find <TypeButton>(typeof(TypeButton).Name) != null) { return; } SingletonMod <TypeMod> .Logger.Debug($"Create button"); __result.component.AddUIComponent <TypeButton>(); SingletonMod <TypeMod> .Logger.Debug($"Button created"); }
public static void GeneratedScrollPanelCreateOptionPanelPostfix(string templateName, ref OptionPanelBase __result) { if (__result == null || templateName != RoadsOptionPanel || __result.component.Find <NodeMarkupButton>(nameof(NodeMarkupButton)) != null) { return; } Mod.Logger.Debug($"Create button"); __result.component.AddUIComponent <NodeMarkupButton>(); Mod.Logger.Debug($"Button created"); }
public static void GeneratedScrollPanelCreateOptionPanelPostfix(string templateName, ref OptionPanelBase __result) => ModsCommon.Patcher.GeneratedScrollPanelCreateOptionPanelPostfix <Mod, NodeControllerButton>(templateName, ref __result);