public void MapUpdated(object sender, MapUpdateWatcher.MapUpdateInfo info) { if (DubsSkylights && sender.GetType() == Building_Skylight) { Thing thing = sender as Thing; var tiles = thing.OccupiedRect().ExpandedBy(1).Cells; ReactSkylights(info, tiles); } if (TransparentRoofs && sender is RoofGrid && info.roofDef != null && TransparentRoofsList.Contains(info.roofDef)) { ReactTransparentRoof(info); } }
private void ReactTransparentRoof(MapUpdateWatcher.MapUpdateInfo info) { if (TransparentRoofsList.Contains(info.roofDef)) { if (info.removed) { ExcludeTile(info.center, true); WindowUtility.ResetWindowsAround(map, info.center); } else { IncludeTile(info.center); } } }
public void ExcludeTile(IntVec3 tile, bool bypass = false) { if (!WindowCells.Contains(tile)) { return; } if (DubsSkylights && skyLightGrid[map.cellIndices.CellToIndex(tile)]) { return; } if (TransparentRoofs && !bypass && TransparentRoofsList.Contains(map.roofGrid.RoofAt(tile))) { return; } WindowCells.Remove(tile); map.glowGrid.MarkGlowGridDirty(tile); }