private void ButtonPressed(object sender, ButtonPressedEventArgs e) { var cc = Game1.currentLocation as CommunityCenter; if (cc == null) { return; } if (!e.Button.IsActionButton()) { return; } var gt = e.Cursor.GrabTile; var p = Game1.MasterPlayer; // Master note if (isMasterNoteVisible(cc) && gt.X == notePos.X && gt.Y == notePos.Y) { Helper.Input.Suppress(e.Button); Func <string, Translation> t = Helper.Translation.Get; Func <string, string> rText = x => Game1.content.LoadString("Strings\\UI:JunimoNote_" + x); if (GameState.Current.Activated) { if (p.mailForTomorrow.Any(x => x.StartsWith("cc"))) { var db = new DialogueBox(t("noteRewardsAlreadyWorking")); Game1.activeClickableMenu = db; } else { GameState.Current.LookingAtVanillaRewards = true; ModEntry.InvalidateCache(); var responses = new List <MyResponse>(); if (!p.hasOrWillReceiveMail("ccPantry")) { var text = rText("RewardPantry") + " (70,000g)"; responses.Add(new MyResponse(text, () => buildUpgrade("ccPantry", 70000))); } if (!p.hasOrWillReceiveMail("ccCraftsRoom")) { var text = rText("RewardCrafts") + " (50,000g)"; responses.Add(new MyResponse(text, () => buildUpgrade("ccCraftsRoom", 50000))); } if (!p.hasOrWillReceiveMail("ccFishTank")) { var text = rText("RewardFishTank") + " (40,000g)"; responses.Add(new MyResponse(text, () => buildUpgrade("ccFishTank", 40000))); } if (!p.hasOrWillReceiveMail("ccBoilerRoom")) { var text = rText("RewardBoiler") + " (30,000g)"; responses.Add(new MyResponse(text, () => buildUpgrade("ccBoilerRoom", 30000))); } if (!p.hasOrWillReceiveMail("ccVault")) { var text = rText("RewardVault") + " (80,000g)"; responses.Add(new MyResponse(text, () => buildUpgrade("ccVault", 80000))); } GameState.Current.LookingAtVanillaRewards = false; ModEntry.InvalidateCache(); var menu = new MyDialogueBox(t("noteRewards"), responses, Helper); Game1.activeClickableMenu = menu; } } else { var menu = new MyDialogueBox(t("noteActivate"), new List <MyResponse> { new MyResponse(t("noteActivateY"), () => ActivateMod(cc)), new MyResponse(t("noteActivateN"), () => DeclineMod(cc)) }, Helper); Game1.activeClickableMenu = menu; } return; } // Bulletin Board var tile = cc.map.GetLayer("Buildings").Tiles[(int)gt.X, (int)gt.Y]?.TileIndex ?? -1; if (tile == 1799) { Helper.Input.Suppress(e.Button); Helper.Reflection.GetMethod(cc, "checkBundle").Invoke(5); return; } }