private string FindPartMod(Part part) { if (configs == null) { configs = GameDatabase.Instance.GetConfigs("PART"); } UrlDir.UrlConfig config = Array.Find <UrlDir.UrlConfig>(configs, (c => (part.name == c.name.Replace('_', '.').Replace(' ', '.')))); if (config == null) { config = Array.Find <UrlDir.UrlConfig>(configs, (c => (part.name == c.name))); if (config == null) { return(""); } } var id = new UrlDir.UrlIdentifier(config.url); if (id[0].Equals("SquadExpansion")) { if (id[1].Equals("Serenity")) { return("BreakingGround"); } return(id[1]); } if (id[0].Equals("UmbraSpaceIndustries") || id[0].Equals("WildBlueIndustries")) { return(id[0] + "/" + id[1]); } return(id[0]); }
public string GetPartMod(AvailablePart part) { if (PartModIndex.ContainsKey(part)) { return(PartModIndex[part]); } UrlDir.UrlConfig[] configs = GameDatabase.Instance.GetConfigs("PART"); string mod = ""; UrlDir.UrlConfig config = Array.Find <UrlDir.UrlConfig>(configs, (c => part.name == c.name.Replace('_', '.'))); if (config != null) { var id = new UrlDir.UrlIdentifier(config.url); mod = id[0]; } PartModIndex[part] = mod; return(mod); }
static public string FindPartMod(AvailablePart part) { if (configs == null) { configs = GameDatabase.Instance.GetConfigs("PART"); } Log.Info("ModFilterWindow.FindPartMod, part.name: " + part.name); UrlDir.UrlConfig config = Array.Find <UrlDir.UrlConfig>(configs, (c => (part.name == c.name.Replace('_', '.').Replace(' ', '.')))); if (config == null) { config = Array.Find <UrlDir.UrlConfig>(configs, (c => (part.name == c.name))); if (config == null) { return(""); } } var id = new UrlDir.UrlIdentifier(config.url); return(id[0]); }
static public string FindPartMod(AvailablePart part) { if (configs == null) { configs = GameDatabase.Instance.GetConfigs("PART"); } // Replaces underscores and spaces with a dot UrlDir.UrlConfig config = Array.Find <UrlDir.UrlConfig>(configs, (c => (part.name == c.name.Replace('_', '.').Replace(' ', '.')))); if (config == null) { config = Array.Find <UrlDir.UrlConfig>(configs, (c => (part.name == c.name))); if (config == null) { return(""); } } var id = new UrlDir.UrlIdentifier(config.url); return(id[0]); }
public string GetPartMod(AvailablePart part) { if (PartModIndex.ContainsKey(part)) { return PartModIndex[part]; } UrlDir.UrlConfig[] configs = GameDatabase.Instance.GetConfigs("PART"); string mod = ""; UrlDir.UrlConfig config = Array.Find<UrlDir.UrlConfig>(configs, (c => part.name == c.name.Replace('_', '.'))); if (config != null) { var id = new UrlDir.UrlIdentifier(config.url); mod = id[0]; } PartModIndex[part] = mod; return mod; }