Exemplo n.º 1
0
 // Token: 0x060000D9 RID: 217 RVA: 0x00006540 File Offset: 0x00004740
 public override void Draw()
 {
     Comps_PostDraw();
     WorldRendererUtility.DrawQuadTangentialToPlanet(DrawPos, MRC(0f, BlastRadius, 5f, 0f, shockwave), 0.008f,
                                                     GraphicDatabase.Get <Graphic_Single>("ra2/Things/Misc/Nuclear/flash", ShaderDatabase.MoteGlow,
                                                                                          new Vector2(20f, 20f), Color.white).MatSingle);
 }
Exemplo n.º 2
0
        public override void Draw()
        {
            float averageTileSize = Find.WorldGrid.averageTileSize;
            float transitionPct   = ExpandableWorldObjectsUtility.TransitionPct;

            if (this.def.expandingIcon && transitionPct > 0f)
            {
                //Color color = this.Material.color;
                MaterialPropertyBlock materialPropertyBlock = WorldObjectChild_Satellite.propertyBlock;
                WorldRendererUtility.DrawQuadTangentialToPlanet(this.DrawPos, 10f * averageTileSize, 0.008f, this.Material, false, false, null);
                return;
            }
            WorldRendererUtility.DrawQuadTangentialToPlanet(this.DrawPos, 10f * averageTileSize, 0.008f, this.Material, false, false, null);
        }
Exemplo n.º 3
0
 /*
  * Check WorldObject Draw method to find why the construction site icon is rotated strangely when expanded
  */
 public override void Draw()
 {
     if (RoadsOfTheRim.RoadBuildingState.CurrentlyTargeting != this || this.roadDef == null) // Do not draw the site if it's not yet finalised or if we don't know the type of road to build yet
     {
         base.Draw();
         WorldGrid worldGrid      = Find.WorldGrid;
         Vector3   fromPos        = worldGrid.GetTileCenter(this.Tile);
         float     percentageDone = GetComponent <WorldObjectComp_ConstructionSite>().percentageDone();
         if (!ProgressBarMaterial)
         {
             UpdateProgressBarMaterial();
         }
         WorldRendererUtility.DrawQuadTangentialToPlanet(fromPos, Find.WorldGrid.averageTileSize * .8f, 0.15f, ProgressBarMaterial);
     }
 }
Exemplo n.º 4
0
        public void RenderMote()
        {
            float num = (Time.time - lastOrderedToTileTime) / 0.5f;

            if (!(num > 1f))
            {
                if (cachedMaterial == null)
                {
                    cachedMaterial = MaterialPool.MatFrom((Texture2D)FeedbackGoto.mainTexture, FeedbackGoto.shader, Color.white, WorldMaterials.DynamicObjectRenderQueue);
                }
                WorldGrid worldGrid  = Find.WorldGrid;
                Vector3   tileCenter = worldGrid.GetTileCenter(tile);
                Color     value      = new Color(1f, 1f, 1f, 1f - num);
                propertyBlock.SetColor(ShaderPropertyIDs.Color, value);
                Vector3  pos       = tileCenter;
                float    size      = 0.8f * worldGrid.averageTileSize;
                float    altOffset = 0.018f;
                Material material  = cachedMaterial;
                MaterialPropertyBlock materialPropertyBlock = propertyBlock;
                WorldRendererUtility.DrawQuadTangentialToPlanet(pos, size, altOffset, material, false, false, materialPropertyBlock);
            }
        }
Exemplo n.º 5
0
        public override void Draw()
        {
            float averageTileSize = Find.WorldGrid.averageTileSize;
            float transitionPct   = ExpandableWorldObjectsUtility.TransitionPct;

            if (transitionPct > 0f)
            {
                Color color = Material.color;
                float num   = 1f - transitionPct;
                SpecialityWorldObject.propertyBlock.SetColor(ShaderPropertyIDs.Color, new Color(color.r, color.g, color.b, color.a * num));
                Vector3  drawPos   = DrawPos;
                float    size      = 0.7f * averageTileSize;
                float    altOffset = 0.015f;
                Material material  = Material;
                MaterialPropertyBlock materialPropertyBlock = SpecialityWorldObject.propertyBlock;
                WorldRendererUtility.DrawQuadTangentialToPlanet(drawPos, size, altOffset, material, false, true, materialPropertyBlock);
            }
            else
            {
                WorldRendererUtility.DrawQuadTangentialToPlanet(DrawPos, 0.7f * averageTileSize, 0.015f, Material, false, false, null);
            }
        }
Exemplo n.º 6
0
 public void TargeterUpdate()
 {
     if (IsTargeting)
     {
         Vector3          pos = Vector3.zero;
         GlobalTargetInfo globalTargetInfo = CurrentTargetUnderMouse();
         if (globalTargetInfo.HasWorldObject)
         {
             pos = globalTargetInfo.WorldObject.DrawPos;
         }
         else if (globalTargetInfo.Tile >= 0)
         {
             pos = Find.WorldGrid.GetTileCenter(globalTargetInfo.Tile);
         }
         if (globalTargetInfo.IsValid && !Mouse.IsInputBlockedNow)
         {
             WorldRendererUtility.DrawQuadTangentialToPlanet(pos, 0.8f * Find.WorldGrid.averageTileSize, 0.018f, WorldMaterials.CurTargetingMat);
         }
         if (onUpdate != null)
         {
             onUpdate();
         }
     }
 }
 public void TargeterUpdate()
 {
     if (this.IsTargeting)
     {
         Vector3          pos = Vector3.zero;
         GlobalTargetInfo globalTargetInfo = this.CurrentTargetUnderMouse();
         if (globalTargetInfo.HasWorldObject)
         {
             pos = globalTargetInfo.WorldObject.DrawPos;
         }
         else if (globalTargetInfo.Tile >= 0)
         {
             pos = Find.WorldGrid.GetTileCenter(globalTargetInfo.Tile);
         }
         if (globalTargetInfo.IsValid)
         {
             WorldRendererUtility.DrawQuadTangentialToPlanet(pos, (float)(0.800000011920929 * Find.WorldGrid.averageTileSize), 0.018f, WorldMaterials.CurTargetingMat, false, false, null);
         }
         if (this.onUpdate != null)
         {
             this.onUpdate();
         }
     }
 }
Exemplo n.º 8
0
        public override void TargeterUpdate()
        {
            if (IsTargeting)
            {
                DrawAirDefenseGrid();
                if (aerialVehicle != null)
                {
                    originOnMap = aerialVehicle.DrawPos;
                }
                Vector3          pos = Vector3.zero;
                GlobalTargetInfo arg = CurrentTargetUnderMouse();
                if (arg.HasWorldObject)
                {
                    pos = arg.WorldObject.DrawPos;
                }
                else if (arg.Tile >= 0)
                {
                    pos = Find.WorldGrid.GetTileCenter(arg.Tile);
                }
                if (arg.IsValid && !Mouse.IsInputBlockedNow)
                {
                    if (vehicle.CompVehicleLauncher.launchProtocol.GetFloatMenuOptionsAt(arg.Tile).NotNullAndAny())
                    {
                        WorldRendererUtility.DrawQuadTangentialToPlanet(pos, BaseFeedbackTexSize * Find.WorldGrid.averageTileSize, 0.018f, WorldMaterials.CurTargetingMat);
                    }
                }

                Vector3  start   = originOnMap;
                var      tiles   = new List <int>(FlightPath.Select(n => n.tile));
                Material lineMat = null;
                switch (vehicle.CompVehicleLauncher.GetShuttleStatus(arg, start))
                {
                case ShuttleLaunchStatus.Valid:
                    lineMat = TexData.WorldLineMatWhite;
                    break;

                case ShuttleLaunchStatus.NoReturnTrip:
                    lineMat = TexData.WorldLineMatYellow;
                    break;

                case ShuttleLaunchStatus.Invalid:
                    lineMat = TexData.WorldLineMatRed;
                    break;
                }
                for (int n = 0; n < FlightPath.Count; n++)
                {
                    int     curTile = tiles.PopAt(0);
                    Vector3 end     = Find.WorldGrid.GetTileCenter(curTile);
                    DrawTravelPoint(start, end, lineMat);
                    start = end;
                }
                if (FlightPath.Count > 0)
                {
                    string  destLabel       = "VehicleDoubleClickShuttleTarget".Translate();
                    Vector2 labelGetterText = Text.CalcSize(destLabel);
                    Rect    destPosition    = new Rect(start.x, start.y, 32f, 32f);
                    Rect    rect            = new Rect(destPosition.xMax, destPosition.y, 9999f, 100f);
                    Rect    bgRect          = new Rect(rect.x - labelGetterText.x * 0.1f, rect.y, labelGetterText.x * 1.2f, labelGetterText.y);
                    var     textColor       = GUI.color;
                    GUI.color = Color.white;
                    Graphics.DrawTexture(bgRect, TexUI.GrayTextBG);
                    GUI.color = textColor;
                    //GUI.Label(rect, destLabel);
                    WorldRendererUtility.DrawQuadTangentialToPlanet(start, BaseFeedbackTexSize * Find.WorldGrid.averageTileSize, 0.018f, WorldMaterials.CurTargetingMat, false, false, null);
                }
                if (FlightPath.Count < vehicle.CompVehicleLauncher.launchProtocol.MaxFlightNodes && arg.IsValid)
                {
                    DrawTravelPoint(start, Find.WorldGrid.GetTileCenter(arg.Tile), lineMat);
                }

                onUpdate?.Invoke();
            }
        }