private string GetName(ushort buildingId, ItemClass.Zone zone, ItemClass.SubService ss) { Randomizer randomizer = new Randomizer(Singleton <SimulationManager> .instance.m_metaData.m_gameInstanceIdentifier.GetHashCode() - buildingId); if (buildingId % 6 != 0) { Markov markov = null; if (!this.buildingNames.TryGetValue(ss.ToString(), out markov)) { this.buildingNames.TryGetValue(zone.ToString(), out markov); } if (markov != null) { return(markov.GetText(ref randomizer, 6, 16, true, true)); } } return(this.buildingName.text); }
private string GetDescription(string bName, ushort buildingId, ItemClass.Zone zone, ItemClass.SubService ss) { Randomizer randomizer = new Randomizer(Singleton <SimulationManager> .instance.m_metaData.m_gameInstanceIdentifier.GetHashCode() - buildingId); var year = 2015 - buildingId % 200; Markov markov = null; if (!this.buildingDescriptions.TryGetValue(ss.ToString(), out markov)) { this.buildingDescriptions.TryGetValue(zone.ToString(), out markov); } if (markov != null) { var text = markov.GetText(ref randomizer, 100, 200, true); var cityName = Singleton <SimulationManager> .instance.m_metaData.m_CityName.Trim(); text = text.Replace("COMPANY", bName).Replace("DATE", year.ToString()).Replace("SITY", cityName); return(text); } return(""); }
private void AddCheckboxZone(int idx, UIHelperExtension uiHelperExt, ItemClass.Zone zone) { UITextureAtlas thumbAtlas = FindObjectOfType <ZoningPanel>().GetComponentInChildren <UIScrollablePanel>().atlas; UICheckBox checkLR = uiHelperExt.AddCheckboxNoLabel($"ConfigZ{idx}{zone}"); var checkedObj = (UISprite)checkLR.checkedBoxObject; UISprite uncheckedObj = checkLR.Find <UISprite>("Unchecked"); checkedObj.spriteName = $"Zoning{zone}"; uncheckedObj.spriteName = $"Zoning{zone}Disabled"; checkedObj.atlas = thumbAtlas; uncheckedObj.atlas = thumbAtlas; checkLR.size = new Vector2(47, 32); checkedObj.size = new Vector2(47, 32); uncheckedObj.size = new Vector2(47, 32); checkedObj.relativePosition = default; uncheckedObj.relativePosition = default; checkLR.tooltip = Locale.Get("ZONEDBUILDING_TITLE", zone.ToString()); checkLR.isChecked = CustomZoneData.Instance[idx].HasZone(zone); checkLR.eventCheckChanged += (x, y) => { if (!m_loading) { if (y) { CustomZoneData.Instance[idx].AddToZone(zone); } else { CustomZoneData.Instance[idx].RemoveFromZone(zone); } } }; CustomZoneData.EventOneChanged += (x) => { if (x == idx) { try { m_loading = true; checkLR.isChecked = CustomZoneData.Instance[idx].HasZone(zone); } finally { m_loading = false; } } }; CustomZoneData.EventAllChanged += () => { try { m_loading = true; checkLR.isChecked = CustomZoneData.Instance[idx].HasZone(zone); } finally { m_loading = false; } }; }