From 5269a540019843901e35ab4a2413fa668f96d929 Mon Sep 17 00:00:00 2001 From: Spencer Date: Sun, 7 Jan 2018 00:06:21 -0500 Subject: [PATCH] add Rank Bonus log at bottom of the menu --- .../ui/rank/SupportRankBonusPage.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java index 5d5a36c93..2307bfe0e 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java @@ -6,9 +6,11 @@ import java.util.List; import org.bukkit.Material; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import mineplex.core.account.CoreClient; import mineplex.core.common.util.C; +import mineplex.core.itemstack.ItemBuilder; import mineplex.core.shop.item.ShopItem; import mineplex.core.shop.page.MultiPageManager; import mineplex.staffServer.customerSupport.CustomerSupport; @@ -46,11 +48,27 @@ public class SupportRankBonusPage extends SupportPage }, entry.getCalendar().get(Calendar.MONTH) + 1, false, true)); } + private ItemStack getLogIcon() + { + int entries = 6; + ItemBuilder builder = new ItemBuilder(Material.SIGN).setTitle(C.cGreenB + "Last " + entries + " Entries").addLore(""); + + for (int i = 0; i < entries; i++) + { + BonusEntry entry = getBonusLog().get(i); + builder.addLore(C.mBody + "Received " + C.cYellow + entry.getItemCount() + " " + entry.getItemName() + C.mBody + " on " + C.cYellow + new SimpleDateFormat("MMMM dd YYYY").format(entry.getCalendar().getTime())); + } + + return builder.build(); + } + @Override protected void buildPage() { super.buildPage(); _multiPageManager.buildPage(); + + addItem(getSlotIndex(5, 4), getLogIcon()); } }