Exemplo n.º 1
0
            static void Prefix(TombStone __instance, Container ___m_container)
            {
                if (!modEnabled.Value)
                {
                    return;
                }
                Dbgl("TombStone_Interact");

                int height = extraRows.Value + (addEquipmentRow.Value ? 5 : 4);

                __instance.GetComponent <Container>().m_height = height;

                Traverse t          = Traverse.Create(___m_container);
                string   dataString = t.Field("m_nview").GetValue <ZNetView>().GetZDO().GetString("items", "");

                if (string.IsNullOrEmpty(dataString))
                {
                    return;
                }
                ZPackage pkg = new ZPackage(dataString);

                t.Field("m_loading").SetValue(true);
                t.Field("m_inventory").GetValue <Inventory>().Load(pkg);
                t.Field("m_loading").SetValue(false);
                t.Field("m_lastRevision").SetValue(t.Field("m_nview").GetValue <ZNetView>().GetZDO().m_dataRevision);
                t.Field("m_lastDataString").SetValue(dataString);
            }
Exemplo n.º 2
0
            static void Prefix(TombStone __instance)
            {
                if (!modEnabled.Value)
                {
                    return;
                }
                Dbgl("TombStone_Awake");

                int height = extraRows.Value + (addEquipmentRow.Value ? 5 : 4);

                __instance.GetComponent <Container>().m_height = height;
                //AccessTools.FieldRefAccess<Inventory, int>(AccessTools.FieldRefAccess<Container, Inventory>(__instance.GetComponent<Container>(), "m_inventory"), "m_height") = height;
                //Dbgl($"tombstone Awake {__instance.GetComponent<Container>().GetInventory()?.GetHeight()}");
            }