From 3abd085de6a31c24a92b05012a3b81e686065edc Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 29 May 2024 23:09:00 +0200 Subject: code cleanup and added regex test --- .../chocolatefactory/ChocolateShopPrice.kt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateShopPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateShopPrice.kt index 8152271fe..1d977d22d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateShopPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateShopPrice.kt @@ -43,6 +43,9 @@ object ChocolateShopPrice { "shop.bought", "§aYou bought §r§.(?[\\w ]+)§r(?:§8 x(?\\d+)§r)?§a!" ) + /** + * REGEX-TEST: §7Chocolate Spent: §60 + */ private val chocolateSpentPattern by ChocolateFactoryAPI.patternGroup.pattern( "shop.spent", "§7Chocolate Spent: §6(?[\\d,]+)" @@ -143,15 +146,15 @@ object ChocolateShopPrice { ) } - val newList = mutableListOf() - newList.add(Renderable.string("§e§lCoins per million chocolate§f:")) - // TODO update this value every second - // TODO add time until can afford - newList.add(Renderable.string("§eChocolate available: §6${ChocolateAmount.CURRENT.formatted}")) - // TODO add chocolate spend needed for next milestone - newList.add(Renderable.string("§eChocolate spent: §6${chocolateSpent.addSeparators()}")) - newList.add(LorenzUtils.fillTable(table, padding = 5, itemScale = config.itemScale)) - display = newList + display = buildList { + add(Renderable.string("§e§lCoins per million chocolate§f:")) + // TODO update this value every second + // TODO add time until can afford + add(Renderable.string("§eChocolate available: §6${ChocolateAmount.CURRENT.formatted}")) + // TODO add chocolate spend needed for next milestone + add(Renderable.string("§eChocolate spent: §6${chocolateSpent.addSeparators()}")) + add(LorenzUtils.fillTable(table, padding = 5, itemScale = config.itemScale)) + } } @SubscribeEvent -- cgit