string Ref(string fullName) { ulong id; if (AssetLoader.IsWorkshopPackage(fullName, out id)) { return(string.Concat(steamid, id.ToString(), "\">", fullName, "</a>")); } else { return(fullName); } }
void Save(string heading, Dictionary <string, HashSet <Package.Asset> > lines) { H2(heading); List <string> keys = new List <string>(lines.Keys); keys.Sort(); foreach (var key in keys) { HashSet <Package.Asset> set = lines[key]; string refkey = Ref(key); if (set == null) { Para(refkey); } else { string s = string.Concat(refkey, "</div><div>Required in:"); ulong id; bool fromWorkshop = false; foreach (Package.Asset asset in set) { s = string.Concat(s, " ", Ref(asset)); fromWorkshop = fromWorkshop || AssetLoader.IsWorkshopPackage(asset.package, out id); } if (fromWorkshop && !AssetLoader.IsWorkshopPackage(key, out id)) { if (AssetLoader.IsPrivatePackage(key)) { s = string.Concat(s, " <b>Workshop asset requires private content, seems like asset bug?</b>"); } else { s = string.Concat(s, " <b>Workshop asset requires DLC/Deluxe/Pre-order content?</b>"); } } Para(s); } } }
void SaveNotFound() { if (notFound.Count == 0 && notFoundIndirect.Count == 0) { Italics("No missing assets."); return; } if (notFound.Count > 0) { Italics("Note: the following assets are used in your city but could not be found. You should get the assets if possible. These cases can break savegames."); Save(notFound); } if (notFoundIndirect.Count > 0) { if (notFound.Count > 0) { w.WriteLine("<br>"); } Italics("Note: the following missing assets are used in buildings and parks. These cases should <b>not</b> break savegames."); List <string> keys = new List <string>(notFoundIndirect.Keys); keys.Sort(); foreach (var key in keys) { HashSet <string> set = notFoundIndirect[key]; string refkey = Ref(key); if (set == null) { Para(refkey); } else { string s = string.Concat(refkey, "</div><div>Required in:"); ulong id; bool fromWorkshop = false; foreach (string fullName in set) { s = string.Concat(s, " ", Ref(fullName)); fromWorkshop = fromWorkshop || AssetLoader.IsWorkshopPackage(fullName, out id); } if (fromWorkshop && !AssetLoader.IsWorkshopPackage(key, out id)) { if (AssetLoader.IsPrivatePackage(key)) { s = string.Concat(s, " <b>Workshop asset requires private content, seems like asset bug?</b>"); } else if (key.EndsWith("_Data")) { s = string.Concat(s, " <b>Probably a Workshop prop or tree but no link is available</b>"); } else { s = string.Concat(s, " <b>Workshop asset requires DLC or Deluxe content?</b>"); } } Para(s); } } } }