//Toolbar button click handlers internal static void OnRMRosterToggle() { //Debug.Log("[RosterManager]: RosterManagerAddon.OnRMRosterToggle"); try { if (HighLogic.LoadedScene != GameScenes.SPACECENTER && HighLogic.LoadedScene != GameScenes.EDITOR && HighLogic.LoadedScene != GameScenes.TRACKSTATION && HighLogic.LoadedScene != GameScenes.FLIGHT) { return; } WindowRoster.ShowWindow = !WindowRoster.ShowWindow; if (RMSettings.EnableBlizzyToolbar) { _rmRosterBlizzy.TexturePath = WindowRoster.ShowWindow ? TextureFolder + "Icon_On_24" : TextureFolder + "Icon_Off_24"; } else { _rmRosterStock.SetTexture(GameDatabase.Instance.GetTexture(WindowRoster.ShowWindow ? TextureFolder + "Icon_On_128" : TextureFolder + "Icon_Off_128", false)); } if (!WindowRoster.ShowWindow) { return; } WindowRoster.DisplayMode = WindowRoster.DisplayModes.Index; WindowRoster.UpdateRosterList(); //AllCrew.Clear(); //if (RMLifeSpan.Instance != null) // AllCrew = RMLifeSpan.Instance.rmkerbals.ALLRMKerbals.ToList(); } catch (Exception ex) { RmUtils.LogMessage("Error in: RosterManagerAddon.OnRMRosterToggle. " + ex, "Error", true); } }
internal static void FireEventTriggers(Vessel vessel) { // Per suggestion by shaw (http://forum.kerbalspaceprogram.com/threads/62270?p=1033866&viewfull=1#post1033866) // and instructions for using CLS API by codepoet. RmUtils.LogMessage("FireEventTriggers: Active.", "info", RMSettings.VerboseLogging); WindowRoster.UpdateRosterList(); GameEvents.onVesselChange.Fire(vessel); }
public string SubmitChanges() { if (NameExists()) { return("That name is in use!"); } SyncKerbal(); if (!IsNew) { return(string.Empty); } // Add to roster. Kerbal.rosterStatus = ProtoCrewMember.RosterStatus.Available; HighLogic.CurrentGame.CrewRoster.AddCrewMember(Kerbal); WindowRoster.UpdateRosterList(); return(string.Empty); }