public void DebugDrawMouseover() { int num = Mathf.RoundToInt((float)(Time.realtimeSinceStartup * 2.0)) % 2; if (DebugViewSettings.drawRegions) { Color color = this.valid ? ((!this.DebugIsNew) ? Color.green : Color.yellow) : Color.red; GenDraw.DrawFieldEdges(this.Cells.ToList(), color); foreach (Region neighbor in this.Neighbors) { GenDraw.DrawFieldEdges(neighbor.Cells.ToList(), Color.grey); } } if (DebugViewSettings.drawRegionLinks) { foreach (RegionLink link in this.links) { if (num == 1) { foreach (IntVec3 cell in link.span.Cells) { CellRenderer.RenderCell(cell, DebugSolidColorMats.MaterialOf(Color.magenta)); } } } } if (DebugViewSettings.drawRegionThings) { foreach (Thing allThing in this.listerThings.AllThings) { CellRenderer.RenderSpot(allThing.TrueCenter(), (float)((float)(allThing.thingIDNumber % 256) / 256.0)); } } }
public virtual void DrawHighlight(LocalTargetInfo target) { verbProps.DrawRadiusRing(caster.Position); if (!target.IsValid) { return; } GenDraw.DrawTargetHighlight(target); bool needLOSToCenter; float num = HighlightFieldRadiusAroundTarget(out needLOSToCenter); if (num > 0.2f && TryFindShootLineFromTo(caster.Position, target, out ShootLine resultingLine)) { if (needLOSToCenter) { GenExplosion.RenderPredictedAreaOfEffect(resultingLine.Dest, num); } else { GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(resultingLine.Dest, num, useCenter: true) where x.InBounds(Find.CurrentMap) select x).ToList()); } } }
public void DebugDrawMouseover() { int num = Mathf.RoundToInt(Time.realtimeSinceStartup * 2f) % 2; if (DebugViewSettings.drawRegions) { GenDraw.DrawFieldEdges(color: (!valid) ? Color.red : ((!DebugIsNew) ? Color.green : Color.yellow), cells: Cells.ToList()); foreach (Region neighbor in Neighbors) { GenDraw.DrawFieldEdges(neighbor.Cells.ToList(), Color.grey); } } if (DebugViewSettings.drawRegionLinks) { foreach (RegionLink link in links) { if (num != 1) { continue; } foreach (IntVec3 cell in link.span.Cells) { CellRenderer.RenderCell(cell, DebugSolidColorMats.MaterialOf(Color.magenta)); } } } if (!DebugViewSettings.drawRegionThings) { return; } foreach (Thing allThing in listerThings.AllThings) { CellRenderer.RenderSpot(allThing.TrueCenter(), (float)(allThing.thingIDNumber % 256) / 256f); } }
public void DebugDraw() { if (DebugViewSettings.drawRegionTraversal && Find.TickManager.TicksGame < this.debug_lastTraverseTick + 60) { float a = 1f - (float)(Find.TickManager.TicksGame - this.debug_lastTraverseTick) / 60f; GenDraw.DrawFieldEdges(this.Cells.ToList <IntVec3>(), new Color(0f, 0f, 1f, a)); } }
public void DrawFieldEdges() { fields.Clear(); fields.AddRange(Cells); Color color = (!isPrisonCell) ? NonPrisonFieldColor : PrisonFieldColor; color.a = Pulser.PulseBrightness(1f, 0.6f); GenDraw.DrawFieldEdges(fields, color); fields.Clear(); }
public void DrawFieldEdges() { Room.fields.Clear(); Room.fields.AddRange(this.Cells); Color color = (!this.isPrisonCell) ? Room.NonPrisonFieldColor : Room.PrisonFieldColor; color.a = Pulser.PulseBrightness(1f, 0.6f); GenDraw.DrawFieldEdges(Room.fields, color); Room.fields.Clear(); }
public void DebugDrawMouseover() { int num = Mathf.RoundToInt(Time.realtimeSinceStartup * 2f) % 2; if (DebugViewSettings.drawRegions) { Color color; if (!this.valid) { color = Color.red; } else if (this.DebugIsNew) { color = Color.yellow; } else { color = Color.green; } GenDraw.DrawFieldEdges(this.Cells.ToList <IntVec3>(), color); foreach (Region current in this.Neighbors) { GenDraw.DrawFieldEdges(current.Cells.ToList <IntVec3>(), Color.grey); } } if (DebugViewSettings.drawRegionLinks) { foreach (RegionLink current2 in this.links) { if (num == 1) { foreach (IntVec3 current3 in current2.span.Cells) { CellRenderer.RenderCell(current3, DebugSolidColorMats.MaterialOf(Color.magenta)); } } } } if (DebugViewSettings.drawRegionThings) { foreach (Thing current4 in this.listerThings.AllThings) { CellRenderer.RenderSpot(current4.TrueCenter(), (float)(current4.thingIDNumber % 256) / 256f); } } }
protected void DrawHighlightFieldRadiusAroundTarget(LocalTargetInfo target) { bool needLOSToCenter; float num = HighlightFieldRadiusAroundTarget(out needLOSToCenter); if (!(num > 0.2f) || !TryFindShootLineFromTo(caster.Position, target, out var resultingLine)) { return; } if (needLOSToCenter) { GenExplosion.RenderPredictedAreaOfEffect(resultingLine.Dest, num); return; } GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(resultingLine.Dest, num, useCenter: true) where x.InBounds(Find.CurrentMap) select x).ToList()); }
public static void DrawRadiusRing(IntVec3 center, float radius) { if (radius > GenRadial.MaxRadialPatternRadius) { if (!GenDraw.maxRadiusMessaged) { Log.Error("Cannot draw radius ring of radius " + radius + ": not enough squares in the precalculated list."); GenDraw.maxRadiusMessaged = true; } return; } GenDraw.ringDrawCells.Clear(); int num = GenRadial.NumCellsInRadius(radius); for (int i = 0; i < num; i++) { GenDraw.ringDrawCells.Add(center + GenRadial.RadialPattern[i]); } GenDraw.DrawFieldEdges(GenDraw.ringDrawCells); }
public static void DrawFieldEdges(List <IntVec3> cells) { GenDraw.DrawFieldEdges(cells, Color.white); }
public static void RenderPredictedAreaOfEffect(IntVec3 loc, float radius) { GenDraw.DrawFieldEdges(DamageDefOf.Bomb.Worker.ExplosionCellsToHit(loc, Find.CurrentMap, radius).ToList <IntVec3>()); }