private PawnTable CreateTable(MainTabWindow_PawnTable pawnTable, Func <IEnumerable <Pawn> > pawnsFunc)
        {
            var tableDef    = pawnTable.GetType().GetProperty("PawnTableDef", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(pawnTable, null) as PawnTableDef;
            var bottomSpace = (float)pawnTable.GetType().GetProperty("ExtraBottomSpace", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(pawnTable, null);
            var topSpace    = (float)pawnTable.GetType().GetProperty("ExtraTopSpace", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(pawnTable, null);

            return(new PawnTable(tableDef, pawnsFunc, UI.screenWidth - (int)(this.Margin * 2f), (int)((float)(UI.screenHeight - 35) - bottomSpace - topSpace - this.Margin * 2f)));
        }
Beispiel #2
0
        private static void Prefix(MainTabWindow_PawnTable __instance)
        {
            var prisonersTable = __instance.GetType().GetField("prisonersTable", BindingFlags.NonPublic | BindingFlags.Instance);

            if (prisonersTable != null)
            {
                var SetDirty = prisonersTable.FieldType.GetMethod("SetDirty");
                if (SetDirty != null)
                {
                    SetDirty.Invoke(prisonersTable.GetValue(__instance), new object[] { });
                }
            }
        }