public void DebugDrawRiver() { for (int i = 0; i < riverDebugData.Count; i += 2) { GenDraw.DrawLineBetween(riverDebugData[i], riverDebugData[i + 1], SimpleColor.Magenta); } }
public override void DrawExtraSelectionOverlays() { base.DrawExtraSelectionOverlays(); if (BoundWorkTable != null) { GenDraw.DrawLineBetween(this.TrueCenter(), BoundWorkTable.TrueCenter()); } }
public override void DrawExtraSelectionOverlays() { base.DrawExtraSelectionOverlays(); Blueprint_Install blueprint_Install = InstallBlueprintUtility.ExistingBlueprintFor(this); if (blueprint_Install != null) { GenDraw.DrawLineBetween(this.TrueCenter(), blueprint_Install.TrueCenter()); } }
public void DebugDraw() { float y = AltitudeLayer.MetaOverlays.AltitudeFor(); Vector3 vector = new Vector3((float)this.minX, y, (float)this.minZ); Vector3 vector2 = new Vector3((float)this.minX, y, (float)(this.maxZ + 1)); Vector3 vector3 = new Vector3((float)(this.maxX + 1), y, (float)(this.maxZ + 1)); Vector3 vector4 = new Vector3((float)(this.maxX + 1), y, (float)this.minZ); GenDraw.DrawLineBetween(vector, vector2); GenDraw.DrawLineBetween(vector2, vector3); GenDraw.DrawLineBetween(vector3, vector4); GenDraw.DrawLineBetween(vector4, vector); }
private static void DrawMapEdgeLines(int edgeDist) { float y = Altitudes.AltitudeFor(AltitudeLayer.MetaOverlays); IntVec3 size = Find.VisibleMap.Size; Vector3 vector = new Vector3((float)edgeDist, y, (float)edgeDist); Vector3 vector2 = new Vector3((float)edgeDist, y, (float)(size.z - edgeDist)); Vector3 vector3 = new Vector3((float)(size.x - edgeDist), y, (float)(size.z - edgeDist)); Vector3 vector4 = new Vector3((float)(size.x - edgeDist), y, (float)edgeDist); GenDraw.DrawLineBetween(vector, vector2, GenDraw.LineMatMetaOverlay); GenDraw.DrawLineBetween(vector2, vector3, GenDraw.LineMatMetaOverlay); GenDraw.DrawLineBetween(vector3, vector4, GenDraw.LineMatMetaOverlay); GenDraw.DrawLineBetween(vector4, vector, GenDraw.LineMatMetaOverlay); }
public void DrawSection(bool drawSunShadowsOnly) { int count = this.layers.Count; for (int i = 0; i < count; i++) { if (!drawSunShadowsOnly || this.layers[i] is SectionLayer_SunShadows) { this.layers[i].DrawLayer(); } } if (!drawSunShadowsOnly && DebugViewSettings.drawSectionEdges) { GenDraw.DrawLineBetween(this.botLeft.ToVector3(), this.botLeft.ToVector3() + new Vector3(0f, 0f, 17f)); GenDraw.DrawLineBetween(this.botLeft.ToVector3(), this.botLeft.ToVector3() + new Vector3(17f, 0f, 0f)); } }
public static void DrawCircleOutline(Vector3 center, float radius, Material material) { int num = Mathf.Clamp(Mathf.RoundToInt(24f * radius), 12, 48); float num2 = 0f; float num3 = 6.28318548f / (float)num; Vector3 vector = center; Vector3 a = center; for (int i = 0; i < num + 2; i++) { if (i >= 2) { GenDraw.DrawLineBetween(a, vector, material); } a = vector; vector = center; vector.x += Mathf.Cos(num2) * radius; vector.z += Mathf.Sin(num2) * radius; num2 += num3; } }
public static void DrawLineBetween(Vector3 A, Vector3 B, SimpleColor color) { Material mat; switch (color) { case SimpleColor.White: mat = GenDraw.LineMatWhite; break; case SimpleColor.Red: mat = GenDraw.LineMatRed; break; case SimpleColor.Green: mat = GenDraw.LineMatGreen; break; case SimpleColor.Blue: mat = GenDraw.LineMatBlue; break; case SimpleColor.Magenta: mat = GenDraw.LineMatMagenta; break; case SimpleColor.Yellow: mat = GenDraw.LineMatYellow; break; case SimpleColor.Cyan: mat = GenDraw.LineMatCyan; break; default: mat = GenDraw.LineMatWhite; break; } GenDraw.DrawLineBetween(A, B, mat); }
public static void DrawLineBetween(Vector3 A, Vector3 B, float layer) { GenDraw.DrawLineBetween(A + Vector3.up * layer, B + Vector3.up * layer, GenDraw.LineMatWhite); }
public static void DrawLineBetween(Vector3 A, Vector3 B) { GenDraw.DrawLineBetween(A, B, GenDraw.LineMatWhite); }
public void UpdateRotation() { if (!this.pawn.Destroyed && !this.pawn.jobs.HandlingFacing) { if (this.pawn.pather.Moving) { if (this.pawn.pather.curPath != null && this.pawn.pather.curPath.NodesLeftCount >= 1) { this.FaceAdjacentCell(this.pawn.pather.nextCell); } } else { Stance_Busy stance_Busy = this.pawn.stances.curStance as Stance_Busy; if (stance_Busy != null && stance_Busy.focusTarg.IsValid) { if (stance_Busy.focusTarg.HasThing) { this.Face(stance_Busy.focusTarg.Thing.DrawPos); } else { this.FaceCell(stance_Busy.focusTarg.Cell); } } else { if (this.pawn.jobs.curJob != null) { LocalTargetInfo target = this.pawn.CurJob.GetTarget(this.pawn.jobs.curDriver.rotateToFace); if (target.HasThing) { bool flag = false; IntVec3 c = default(IntVec3); CellRect cellRect = target.Thing.OccupiedRect(); for (int i = cellRect.minZ; i <= cellRect.maxZ; i++) { for (int j = cellRect.minX; j <= cellRect.maxX; j++) { if (this.pawn.Position == new IntVec3(j, 0, i)) { this.Face(target.Thing.DrawPos); return; } } } for (int k = cellRect.minZ; k <= cellRect.maxZ; k++) { for (int l = cellRect.minX; l <= cellRect.maxX; l++) { IntVec3 intVec = new IntVec3(l, 0, k); if (intVec.AdjacentToCardinal(this.pawn.Position)) { this.FaceAdjacentCell(intVec); return; } if (intVec.AdjacentTo8Way(this.pawn.Position)) { flag = true; c = intVec; } } } if (flag) { if (DebugViewSettings.drawPawnRotatorTarget) { this.pawn.Map.debugDrawer.FlashCell(this.pawn.Position, 0.6f, "jbthing", 50); GenDraw.DrawLineBetween(this.pawn.Position.ToVector3Shifted(), c.ToVector3Shifted()); } this.FaceAdjacentCell(c); } else { this.Face(target.Thing.DrawPos); } return; } if (this.pawn.Position.AdjacentTo8Way(target.Cell)) { if (DebugViewSettings.drawPawnRotatorTarget) { this.pawn.Map.debugDrawer.FlashCell(this.pawn.Position, 0.2f, "jbloc", 50); GenDraw.DrawLineBetween(this.pawn.Position.ToVector3Shifted(), target.Cell.ToVector3Shifted()); } this.FaceAdjacentCell(target.Cell); return; } if (target.Cell.IsValid && target.Cell != this.pawn.Position) { this.Face(target.Cell.ToVector3()); return; } } if (this.pawn.Drafted) { this.pawn.Rotation = Rot4.South; } } } } }
public void FaceTarget(LocalTargetInfo target) { if (target.IsValid) { if (target.HasThing) { Thing thing = (!target.Thing.Spawned) ? ThingOwnerUtility.GetFirstSpawnedParentThing(target.Thing) : target.Thing; if (thing != null && thing.Spawned) { bool flag = false; IntVec3 c = default(IntVec3); CellRect cellRect = thing.OccupiedRect(); for (int i = cellRect.minZ; i <= cellRect.maxZ; i++) { for (int j = cellRect.minX; j <= cellRect.maxX; j++) { if (pawn.Position == new IntVec3(j, 0, i)) { Face(thing.DrawPos); return; } } } for (int k = cellRect.minZ; k <= cellRect.maxZ; k++) { for (int l = cellRect.minX; l <= cellRect.maxX; l++) { IntVec3 intVec = new IntVec3(l, 0, k); if (intVec.AdjacentToCardinal(pawn.Position)) { FaceAdjacentCell(intVec); return; } if (intVec.AdjacentTo8Way(pawn.Position)) { flag = true; c = intVec; } } } if (flag) { if (DebugViewSettings.drawPawnRotatorTarget) { pawn.Map.debugDrawer.FlashCell(pawn.Position, 0.6f, "jbthing"); GenDraw.DrawLineBetween(pawn.Position.ToVector3Shifted(), c.ToVector3Shifted()); } FaceAdjacentCell(c); } else { Face(thing.DrawPos); } } } else if (pawn.Position.AdjacentTo8Way(target.Cell)) { if (DebugViewSettings.drawPawnRotatorTarget) { pawn.Map.debugDrawer.FlashCell(pawn.Position, 0.2f, "jbloc"); GenDraw.DrawLineBetween(pawn.Position.ToVector3Shifted(), target.Cell.ToVector3Shifted()); } FaceAdjacentCell(target.Cell); } else if (target.Cell.IsValid && target.Cell != pawn.Position) { Face(target.Cell.ToVector3()); } } }
public void Draw() { GenDraw.DrawLineBetween(this.a, this.b, this.color); }
public static void DrawLineBetween(Vector3 A, Vector3 B, SimpleColor color) { GenDraw.DrawLineBetween(A, B, GenDraw.GetLineMat(color)); }
public void Draw() { GenDraw.DrawLineBetween(a, b, color); }