boformer / BuildingThemes

Mod for Cities:Skylines
http://steamcommunity.com/sharedfiles/filedetails/?id=466158459
MIT License
13 stars 11 forks source link

Allow extension of vanilla themes #23

Closed boformer closed 9 years ago

boformer commented 9 years ago

Fixes #18

bloodypenguin commented 9 years ago

You should change Serialize/Deserialize methods too like we discussed (don't save built in buildings if they belong to built in theme and save them otherwise)

boformer commented 9 years ago

Testing with this configuration:

<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Themes>
    <Theme name="European"> 
      <Buildings>
        <Building name="455335791.ERHL1A_Data" />
        <Building name="455719510.ERHL1B_Data" />
        <Building name="456227170.ERHL1C_Data" />
        <Building name="457264872.ERHL1Cnr1_Data" />
        <Building name="458977545.ERHL1Cnr Pub_Data" />
      </Buildings>
    </Theme>
    <Theme name="Edinburgh"> 
      <Buildings>
        <Building name="455335791.ERHL1A_Data" />
        <Building name="455719510.ERHL1B_Data" />
        <Building name="456227170.ERHL1C_Data" />
        <Building name="457264872.ERHL1Cnr1_Data" />
        <Building name="458977545.ERHL1Cnr Pub_Data" />
      </Buildings>
    </Theme>
  </Themes>
</Configuration>

Custom assets used: http://steamcommunity.com/workshop/filedetails/?id=455727807

boformer commented 9 years ago

It works.

boformer commented 9 years ago

@earalov I changed the Serialize method.

boformer commented 9 years ago

I am gone for 2 hours (cooking dinner). If you want, push the changes you want to make to this branch and merge it.

bloodypenguin commented 9 years ago

I changed the Serialize method.

I see. Extended parts of built-in themes should be saved too.

boformer commented 9 years ago

That makes the isBuiltIn flag for themes kind of pointless. Can I just remove it?

We can either save all themes to the config file, or only those with at least one custom building.

bloodypenguin commented 9 years ago

No it's not pointless. I'm going to commit to this branch in several minutes and I will show why.

boformer commented 9 years ago

Great, i forgot to merge this :/