Skip to content

Adding a New Filter

neitsa edited this page Jun 30, 2018 · 2 revisions

This page describes how to add a filter to PrepareLanding code.

  1. Add a backing field in PrepareLanding\src\GameData\UserData.cs
    • Add the field in UserData.AreAllFieldsInDefaultSate() which is used to check if the filter is used or not.
    • Add the field initialization in UserData.ResetAllFields() which is used to reset the filter in its default state.
  2. Add the filter code in \PrepareLanding\src\Filters\TileFilters.cs
    • Must inherit from TileFilter (in \PrepareLanding\src\Filters\TileFilter.cs).
  3. Add the filter instanciation in WorldTileFilter class constructor (see PrepareLanding\src\WorldTileFilter.cs).
    • See the _allfilters private variable.
  4. Add the GUI implementation of the filter in the right GUI tab
    • Either TabTerrain.cs or TabTemperature.cs.
  5. Add the field to preset (if needed), for both loading and saving:
    • See PrepareLanding\src\Presets\Preset.cs.
    • Both functions are: Preset.LoadPreset() and Preset.SavePreset.
Clone this wiki locally