public override GizmoResult GizmoOnGUI(Vector2 topLeft, float maxWidth)
        {
            GizmoResult result = base.GizmoOnGUI(topLeft, maxWidth);

            Designator_Dropdown.DrawExtraOptionsIcon(topLeft, this.GetWidth(maxWidth));
            return(result);
        }
Beispiel #2
0
        private static Designator_Build FindAllowedDesignatorRecursive(Designator designator, BuildableDef buildable, bool mustBeVisible)
        {
            if (!Current.Game.Rules.DesignatorAllowed(designator))
            {
                return(null);
            }
            if (mustBeVisible && !designator.Visible)
            {
                return(null);
            }
            Designator_Build designator_Build = designator as Designator_Build;

            if (designator_Build != null && designator_Build.PlacingDef == buildable)
            {
                return(designator_Build);
            }
            Designator_Dropdown designator_Dropdown = designator as Designator_Dropdown;

            if (designator_Dropdown != null)
            {
                for (int i = 0; i < designator_Dropdown.Elements.Count; i++)
                {
                    Designator_Build designator_Build2 = FindAllowedDesignatorRecursive(designator_Dropdown.Elements[i], buildable, mustBeVisible);
                    if (designator_Build2 != null)
                    {
                        return(designator_Build2);
                    }
                }
            }
            return(null);
        }
Beispiel #3
0
        public override GizmoResult GizmoOnGUI(Vector2 topLeft, float maxWidth)
        {
            GizmoResult result   = base.GizmoOnGUI(topLeft, maxWidth);
            ThingDef    thingDef = entDef as ThingDef;

            if (thingDef != null && thingDef.MadeFromStuff)
            {
                Designator_Dropdown.DrawExtraOptionsIcon(topLeft, GetWidth(maxWidth));
            }
            return(result);
        }