Skip to content

Instantly share code, notes, and snippets.

@boformer
Last active August 29, 2015 14:23
Show Gist options
  • Save boformer/0be4dda77590cb322d95 to your computer and use it in GitHub Desktop.
Save boformer/0be4dda77590cb322d95 to your computer and use it in GitHub Desktop.
Building Theme mod
using BuildingThemes;
using ICities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ColossalFramework;
namespace UKTerracedBuildingTheme
{
public class Theme : LoadingExtensionBase, IUserMod
{
private static readonly string themeName = "UK Terraced Housing";
public static readonly string[] buildings = {
"452688457.Terraced House 1_Data",
"452693614.Terraced House 2_Data",
"452694147.Terraced House 3_Data",
"452698364.Terraced House 4_Data",
"452699199.Terraced House 5_Data",
"452811044.Terraced House 6_Data",
"452932057.Terraced House 7_Data",
"453553786.Terraced House 8_Data",
"454103592.Terraced House - Corner 1_Data",
"454569456.Terraced House - Corner 2_Data",
"455711566.UK Corner Pub - The Vic_Data",
"455845254.UK Corner Pub - The Tappers_Data",
"456271993.UK Corner Pub - The Crown_Data",
"456534883.Terraced Shop - Londis_Data",
"456877661.Terraced Shop - Tesco Express_Data",
"457089522.Terraced Shop - Sainsburys Local_Data",
"457722555.Terraced Shop - Post Office_Data",
"457806606.Terraced Shop - Subway_Data",
"458227957.Terraced Shop - Coral_Data",
"461456668.Terraced Shop - KFC_Data",
"462018064.Terraced Shop - Greggs_Data",
"462586718.Terraced Shop - Poundland_Data",
"462731956.Terraced Shop - Bargain Booze_Data",
"463995315.Terraced Shop - Premier Stores_Data",
"464726117.Terraced Shop - Olivers Fish Bar_Data",
"465122960.Terraced Shop - Lloyds Pharmacy_Data",
"466230548.Terraced House - Modern 1_Data",
"466915380.Terraced House - Modern 2_Data",
"467647016.Terraced House - Modern 3_Data",
"468470239.Terraced House - Modern 4_Data",
"469118567.Terraced House - Modern 5_Data"};
public string Name
{
get
{
return "Building Theme: " + themeName;
}
}
public string Description
{
get { return "Create building themes and apply them to cities and districts."; }
}
private bool initialized = false;
public override void OnLevelLoaded(LoadMode mode)
{
if (Singleton<BuildingThemesManager>.exists && !initialized)
{
Configuration.Theme theme = new Configuration.Theme(themeName);
theme.isBuiltIn = true;
theme.addAll(buildings, true);
initialized = true;
Singleton<BuildingThemesManager>.instance.AddTheme(theme, Name);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment