From 43867a70184e7387702bea4253864bf2c8b9f0c1 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 7 Nov 2017 22:24:35 +0000 Subject: [PATCH] Refresh all player's pages when an item is purchased --- .../arcade/game/games/cakewars/ui/CakeResourcePage.java | 8 +++++++- .../game/games/cakewars/ui/CakeResourceStarPage.java | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java index d73e2fb0f..61a717111 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java @@ -263,7 +263,13 @@ public class CakeResourcePage extends ShopPageBase + { + if (page.getName().equals(getName())) + { + page.refresh(); + } + }); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourceStarPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourceStarPage.java index 1eed6e948..c9fd4c06e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourceStarPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourceStarPage.java @@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilText; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.recharge.Recharge; import mineplex.core.shop.item.IButton; +import mineplex.core.shop.page.ShopPageBase; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.game.games.cakewars.shop.CakeItem; @@ -174,7 +175,13 @@ public class CakeResourceStarPage extends CakeResourcePage } playAcceptSound(player); - refresh(); + getShop().getPageMap().values().forEach(page -> + { + if (page.getName().equals(getName())) + { + page.refresh(); + } + }); } } }