示例#1
0
        // Verse.GhostDrawer
        public static bool HeronDoorGhostHandler(IntVec3 center, Rot4 rot, ThingDef thingDef, Graphic baseGraphic,
                                                 Color ghostCol, AltitudeLayer drawAltitude)
        {
            if (thingDef is DoorExpandedDef def && def.fixedPerspective)
            {
                Graphic graphic = GhostUtility.GhostGraphicFor(baseGraphic, thingDef, ghostCol);
                //Graphic graphic = Traverse.Create(typeof(GhostDrawer)).Method("GhostGraphicFor", new object[] { thingDef.graphic, thingDef, ghostCol }).GetValue<Graphic>();
                Vector3 loc = GenThing.TrueCenter(center, rot, thingDef.Size, drawAltitude.AltitudeFor());

                for (int i = 0; i < 2; i++)
                {
                    bool flipped = (i != 0) ? true : false;
                    Building_DoorExpanded.DrawParams(def, loc, rot, out var mesh, out var matrix, mod: 0,
                                                     flipped: flipped);
                    Graphics.DrawMesh(mesh: mesh, matrix: matrix, material: graphic.MatAt(rot: rot, thing: null),
                                      layer: 0);
                }

                if (thingDef?.PlaceWorkers?.Count > 0)
                {
                    for (int i = 0; i < thingDef.PlaceWorkers.Count; i++)
                    {
                        thingDef.PlaceWorkers[index : i]
                        .DrawGhost(def : thingDef, center : center, rot : rot, ghostCol : ghostCol);
                    }
                }

                return(false);
            }

            return(true);
        }
示例#2
0
        public override void DrawGhost(ThingDef def, IntVec3 loc, Rot4 rot, Color ghostCol)
        {
            Graphic baseGraphic = GraphicDatabase.Get <Graphic_Single>(def.building.turretTopGraphicPath, ShaderDatabase.Cutout, new Vector2(def.building.turretTopDrawSize, def.building.turretTopDrawSize), Color.white);
            Graphic graphic     = GhostUtility.GhostGraphicFor(baseGraphic, def, ghostCol);

            graphic.DrawFromDef(GenThing.TrueCenter(loc, rot, def.Size, AltitudeLayer.MetaOverlays.AltitudeFor()), rot, def);
        }
        public override void DrawGhost(ThingDef def, IntVec3 loc, Rot4 rot, Color ghostCol)
        {
            Graphic baseGraphic = GraphicDatabase.Get <Graphic_Single>("Things/Building/Security/ProjectorTower_ProjectorOff", ShaderDatabase.Cutout, new Vector2(3.5f, 3.5f), Color.white);
            Graphic graphic     = GhostUtility.GhostGraphicFor(baseGraphic, def, ghostCol);

            graphic.DrawFromDef(GenThing.TrueCenter(loc, rot, def.Size, AltitudeLayer.MetaOverlays.AltitudeFor()), rot, def, 0f);
        }
示例#4
0
        public override void DrawGhost(IntVec3 center, Rot4 rot, ThingDef thingDef, Color ghostCol, AltitudeLayer drawAltitude, Thing thing = null)
        {
            Vector3 centerVec = center.ToVector3ShiftedWithAltitude(drawAltitude);

            for (int i = 0; i < graphicElements.Count; i++)
            {
                GhostUtility.GhostGraphicFor(graphicElements[i].Graphic, thingDef, ghostCol).DrawFromDef(centerVec, rot, thingDef);
                centerVec.y += 0.04054054f;
            }
        }
示例#5
0
        // Token: 0x06000AB0 RID: 2736 RVA: 0x00055958 File Offset: 0x00053D58
        public override void DrawGhost(IntVec3 center, Rot4 rot, ThingDef thingDef, Color ghostCol, AltitudeLayer drawAltitude)
        {
            Graphic graphic = GhostUtility.GhostGraphicFor(CompFireOverlay.FireGraphic, thingDef, ghostCol);

            graphic.DrawFromDef(center.ToVector3ShiftedWithAltitude(drawAltitude), rot, thingDef, 0f);
        }
示例#6
0
 public override void DrawGhost(ThingDef def, IntVec3 loc, Rot4 rot, Color ghostCol, Thing thing = null)
 {
     GhostUtility.GhostGraphicFor(GraphicDatabase.Get <Graphic_Single>(def.building.turretGunDef.graphicData.texPath, ShaderDatabase.Cutout, new Vector2(def.building.turretTopDrawSize, def.building.turretTopDrawSize), Color.white), def, ghostCol).DrawFromDef(GenThing.TrueCenter(loc, rot, def.Size, AltitudeLayer.MetaOverlays.AltitudeFor()), rot, def, TurretTop.ArtworkRotation);
 }