Exemplo n.º 1
0
        public static void RemoveCompostingBin(CompostingBin bin)
        {
            Vector2 BinPos = new Vector2(bin.tileX, bin.tileY);

            ComposterContents.Remove(BinPos);
            ComposterDaysLeft.Remove(BinPos);
            ComposterCompostLeft.Remove(BinPos);
            ModEntry.GetMonitor().Log($"Removed CompostingBin at {BinPos}", StardewModdingAPI.LogLevel.Trace);
        }
Exemplo n.º 2
0
        public ComposterMenu(CompostingBin bin)
        {
            BinPos = new Vector2(bin.tileX, bin.tileY);

            nutritionsComponent = new NutritionsComponent(0, 0, 0, 0);

            cancelButton   = new ClickableComponent(new Rectangle(), "cancel");
            activateButton = new ClickableComponent(new Rectangle(), "activate");
            applyButton    = new ClickableComponent(new Rectangle(), "apply");

            AddCompostItems();

            resetGUI();
        }
Exemplo n.º 3
0
        public ComposterMenu(CompostingBin bin)
        {
            BinPos = new Vector2(bin.tileX, bin.tileY);

            nutritionsComponent = new NutritionsComponent(0, 0, 0, 0);

            cancelButton   = new ClickableComponent(new Rectangle(), "cancel");
            activateButton = new ClickableComponent(new Rectangle(), "activate");
            applyButton    = new ClickableComponent(new Rectangle(), "apply");

            AddCompostItems();

            playerInventoryMenu  = new PlayerInventoryMenu(this);
            compostInventoryMenu = new CompostInventoryMenu(this, nutritionsComponent, compostItems);
            compostInventoryMenu.SetOtherInventoryMenu(playerInventoryMenu);
            playerInventoryMenu.SetOtherInventoryMenu(compostInventoryMenu);

            ResetGUI();

            SetState();

            UpdateGreenTiles();
        }
Exemplo n.º 4
0
 public static void SetCompostingBins()
 {
     Game1.getFarm().buildings.Set(new List <Building>(Game1.getFarm().buildings).Select((Building building) => building is ShippingBin bin && Composting.IsComposter(bin) ? CompostingBin.FromShippingBin(bin) : building).ToList());
 }
Exemplo n.º 5
0
        void Display_MenuChanged(object sender, StardewModdingAPI.Events.MenuChangedEventArgs e)
        {
            if (e.NewMenu is CarpenterMenu menu)
            {
                Helper.Events.Input.ButtonReleased += CarpenterMenu_ButtonReleased;
                Composting.AddBlueprint(menu);
            }
            else if (e.OldMenu is CarpenterMenu oldmenu)
            {
                Helper.Events.Input.ButtonReleased -= CarpenterMenu_ButtonReleased;
                Game1.getFarm().buildings.Set(new List <Building>(Game1.getFarm().buildings).Select((Building building) => building is ShippingBin bin && Composting.IsComposter(bin) ? CompostingBin.FromShippingBin(bin) : building).ToList());
            }

            if (e.NewMenu is ComposterMenu compMenu)
            {
            }
            else if (e.OldMenu is ComposterMenu oldCompMenu)
            {
                oldCompMenu.SaveCompostItems();
            }
        }
Exemplo n.º 6
0
        public static void OnNewDay()
        {
            //if (Game1.getFarm().buildings.ToList().Exists((Building obj) => Composting.IsComposter(obj)))
            //    ModEntry.GetMonitor().Log("Found Composter", StardewModdingAPI.LogLevel.Alert);

            Game1.getFarm().buildings.Set(new List <Building>(Game1.getFarm().buildings).Select((Building building) => building is ShippingBin bin && Composting.IsComposter(bin) ? CompostingBin.FromShippingBin(bin) : building).ToList());

            //if (Game1.getFarm().buildings.ToList().Exists((Building obj) => obj is CompostingBin))
            //    ModEntry.GetMonitor().Log("transformed composter", StardewModdingAPI.LogLevel.Alert);
        }