コード例 #1
0
        public static Vector2 GetSize(List <Thing> things, float paneTopY, bool doNeeds = true)
        {
            float a = 0f;

            if (things.Any((Thing x) => x is Pawn))
            {
                a = 100f;
                if (doNeeds)
                {
                    a = (float)(a + (float)CaravanPeopleAndItemsTabUtility.MaxNeedsCount(things) * 100.0);
                }
                a = (float)(a + 24.0);
            }
            float b = 0f;

            if (CaravanPeopleAndItemsTabUtility.AnyItemOrEmpty(things))
            {
                b = 300f;
                b = (float)(b + 24.0);
                b = (float)(b + 60.0);
            }
            Vector2 result = default(Vector2);

            result.x = (float)(103.0 + Mathf.Max(a, b) + 16.0);
            result.y = Mathf.Min(550f, (float)(paneTopY - 30.0));
            return(result);
        }
コード例 #2
0
        public static Vector2 GetSize(List <Thing> things, float paneTopY, bool doNeeds = true)
        {
            float num = 0f;

            if (things.Any((Thing x) => x is Pawn))
            {
                num = 100f;
                if (doNeeds)
                {
                    num += (float)CaravanPeopleAndItemsTabUtility.MaxNeedsCount(things) * 100f;
                }
                num += 24f;
            }
            float num2 = 0f;

            if (CaravanPeopleAndItemsTabUtility.AnyItemOrEmpty(things))
            {
                num2  = 300f;
                num2 += 24f;
                num2 += 60f;
            }
            Vector2 result;

            result.x = 103f + Mathf.Max(num, num2) + 16f;
            result.y = Mathf.Min(550f, paneTopY - 30f);
            return(result);
        }