Esempio n. 1
0
        public override void DoWindowContents(Rect inRect)
        {
            Pawn pawn = Find.Selector.SingleSelectedThing as Pawn;

            if (pawn == null)
            {
                Find.WindowStack.TryRemove(this, true);
            }
            else
            {
                if (Time.frameCount % 3 == 0)
                {
                    Profiler.BeginSample("Float menu ChoicesAtFor()");
                    List <FloatMenuOption> list = FloatMenuMakerMap.ChoicesAtFor(this.clickPos, pawn);
                    Profiler.EndSample();
                    List <FloatMenuOption> list2 = list;
                    Vector3 vector = this.clickPos;
                    Profiler.BeginSample("StillValid()");
                    for (int i = 0; i < this.options.Count; i++)
                    {
                        if (!this.options[i].Disabled && !FloatMenuMap.StillValid(this.options[i], list, pawn, ref list2, ref vector))
                        {
                            this.options[i].Disabled = true;
                        }
                    }
                    Profiler.EndSample();
                }
                base.DoWindowContents(inRect);
            }
        }
Esempio n. 2
0
        private static bool StillValid(FloatMenuOption opt, List <FloatMenuOption> curOpts, Pawn forPawn)
        {
            List <FloatMenuOption> list = null;
            Vector3 vector = new Vector3(-9999f, -9999f, -9999f);

            return(FloatMenuMap.StillValid(opt, curOpts, forPawn, ref list, ref vector));
        }
Esempio n. 3
0
        public override void PreOptionChosen(FloatMenuOption opt)
        {
            base.PreOptionChosen(opt);
            Pawn pawn = Find.Selector.SingleSelectedThing as Pawn;

            if (!opt.Disabled && (pawn == null || !FloatMenuMap.StillValid(opt, FloatMenuMakerMap.ChoicesAtFor(this.clickPos, pawn), pawn)))
            {
                opt.Disabled = true;
            }
        }
Esempio n. 4
0
        public override void DoWindowContents(Rect inRect)
        {
            Pawn pawn = Find.Selector.SingleSelectedThing as Pawn;

            if (pawn == null)
            {
                Find.WindowStack.TryRemove(this, true);
                return;
            }
            List <FloatMenuOption> curOpts = FloatMenuMakerMap.ChoicesAtFor(this.clickPos, pawn);

            for (int i = 0; i < this.options.Count; i++)
            {
                if (!this.options[i].Disabled && !FloatMenuMap.StillValid(this.options[i], curOpts))
                {
                    this.options[i].Disabled = true;
                }
            }
            base.DoWindowContents(inRect);
        }