Пример #1
0
            private static bool InteractPrefix(ref Container __instance)
            {
                if (!StorefrontPieces.IsPointOfSalePiece(__instance.m_piece))
                {
                    return(true);
                }

                StoreManager.GetInstance().TogglePointOfSale(__instance);
                return(false);
            }
Пример #2
0
        public List <Container> GetCashRegisters()
        {
            Vector3      position     = Player.m_localPlayer.transform.position;
            List <Piece> nearbyPieces = new List <Piece>();

            Piece.GetAllPiecesInRadius(position, 30f, nearbyPieces);

            List <Container> nearbyContainers = new List <Container>();

            nearbyPieces.ForEach(piece => {
                if (piece.TryGetComponent <Container>(out Container container))
                {
                    if (StorefrontPieces.IsCashRegisterPiece(container.m_piece))
                    {
                        nearbyContainers.Add(container);
                    }
                }
            });
            return(nearbyContainers);
        }
        public List <Container> GetInventories()
        {
            Vector3      position     = Player.m_localPlayer.transform.position;
            List <Piece> nearbyPieces = new List <Piece>();

            Piece.GetAllPiecesInRadius(position, 10f, nearbyPieces);

            List <Container> nearbyContainers = new List <Container>();

            foreach (Piece piece in nearbyPieces)
            {
                if (piece.TryGetComponent <Container>(out Container container))
                {
                    if (StorefrontPieces.IsInventoryPiece(container.m_piece))
                    {
                        nearbyContainers.Add(container);
                    }
                }
            }
            return(nearbyContainers);
        }
Пример #4
0
 private void initializePieces()
 {
     Jotunn.Logger.LogWarning("Storefront - registering pieces");
     StorefrontPieces.InitializeAllPieces();
     ItemManager.OnVanillaItemsAvailable -= initializePieces;
 }