Exemple #1
0
        public Designator_Build(BuildableDef entDef)
        {
            this.entDef = entDef;
            icon        = entDef.uiIcon;
            iconAngle   = entDef.uiIconAngle;
            iconOffset  = entDef.uiIconOffset;
            hotKey      = entDef.designationHotKey;
            tutorTag    = entDef.defName;
            order       = 20f;
            ThingDef thingDef = entDef as ThingDef;

            if (thingDef != null)
            {
                iconProportions = thingDef.graphicData.drawSize.RotatedBy(thingDef.defaultPlacingRot);
                iconDrawScale   = GenUI.IconDrawScale(thingDef);
            }
            else
            {
                iconProportions = new Vector2(1f, 1f);
                iconDrawScale   = 1f;
            }
            if (entDef is TerrainDef)
            {
                iconTexCoords = Widgets.CroppedTerrainTextureRect(icon);
            }
            ResetStuffToDefault();
        }