aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
diff options
context:
space:
mode:
authorBuildTools <james.jenour@protonmail.com>2021-01-30 18:22:49 +0800
committerBuildTools <james.jenour@protonmail.com>2021-01-30 18:22:49 +0800
commit3290259e39e9816fd92afa85710de01a6ddfa3b9 (patch)
treee105bcfccfbc38f091848a94667dd612271eed7c /src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
parent659a0e4981640802058d9eef35fec16fab82c5f2 (diff)
downloadnotenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.gz
notenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.bz2
notenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.zip
PRE13.2
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java176
1 files changed, 88 insertions, 88 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
index cafbff05..401898d2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
@@ -27,7 +27,94 @@ public class ItemPriceInformation {
NumberFormat format = NumberFormat.getInstance(Locale.US);
- if(auctionItem) {
+ if(bazaarItem) {
+ int[] lines = {
+ NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line1,
+ NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line2,
+ NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line3,
+ NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line4,
+ NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line5,
+ NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line6
+ };
+
+ boolean added = false;
+
+ boolean shiftPressed = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);
+
+ int stackMultiplier = 1;
+ int shiftStackMultiplier = 64;
+ if(shiftPressed) {
+ stackMultiplier = shiftStackMultiplier;
+ }
+
+ //values = {"", "Buy", "Sell", "Buy (Insta)", "Sell (Insta)", "Raw Craft Cost"}
+ for(int lineId : lines) {
+ switch (lineId) {
+ case 0:
+ continue;
+ case 1:
+ if(bazaarInfo.has("avg_buy")) {
+ if(!added) {
+ tooltip.add("");
+ if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
+ added = true;
+ }
+ int bazaarBuyPrice = (int)bazaarInfo.get("avg_buy").getAsFloat()*stackMultiplier;
+ tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Buy: "+
+ EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarBuyPrice)+" coins");
+ }
+ break;
+ case 2:
+ if(bazaarInfo.has("avg_sell")) {
+ if(!added) {
+ tooltip.add("");
+ if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
+ added = true;
+ }
+ int bazaarSellPrice = (int)bazaarInfo.get("avg_sell").getAsFloat()*stackMultiplier;
+ tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Sell: "+
+ EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarSellPrice)+" coins");
+ }
+ break;
+ case 3:
+ if(bazaarInfo.has("curr_buy")) {
+ if(!added) {
+ tooltip.add("");
+ if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
+ added = true;
+ }
+ int bazaarInstantBuyPrice = (int)bazaarInfo.get("curr_buy").getAsFloat()*stackMultiplier;
+ tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Buy: "+
+ EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantBuyPrice)+" coins");
+ }
+ break;
+ case 4:
+ if(bazaarInfo.has("curr_sell")) {
+ if(!added) {
+ tooltip.add("");
+ if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
+ added = true;
+ }
+ int bazaarInstantSellPrice = (int)bazaarInfo.get("curr_sell").getAsFloat()*stackMultiplier;
+ tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Sell: "+
+ EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantSellPrice)+" coins");
+ }
+ break;
+ case 5:
+ if(craftCost.fromRecipe) {
+ if(!added) {
+ tooltip.add("");
+ added = true;
+ }
+ tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Raw Craft Cost: "+
+ EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format((int)craftCost.craftCost)+" coins");
+ }
+ break;
+ }
+ }
+
+ return added;
+ } else if(auctionItem) {
int[] lines = {
NotEnoughUpdates.INSTANCE.config.priceInfoAuc.line1,
NotEnoughUpdates.INSTANCE.config.priceInfoAuc.line2,
@@ -151,93 +238,6 @@ public class ItemPriceInformation {
}
return added;
- } else if(bazaarItem) {
- int[] lines = {
- NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line1,
- NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line2,
- NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line3,
- NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line4,
- NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line5,
- NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line6
- };
-
- boolean added = false;
-
- boolean shiftPressed = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);
-
- int stackMultiplier = 1;
- int shiftStackMultiplier = 64;
- if(shiftPressed) {
- stackMultiplier = shiftStackMultiplier;
- }
-
- //values = {"", "Buy", "Sell", "Buy (Insta)", "Sell (Insta)", "Raw Craft Cost"}
- for(int lineId : lines) {
- switch (lineId) {
- case 0:
- continue;
- case 1:
- if(bazaarInfo.has("avg_buy")) {
- if(!added) {
- tooltip.add("");
- if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
- added = true;
- }
- int bazaarBuyPrice = (int)bazaarInfo.get("avg_buy").getAsFloat()*stackMultiplier;
- tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Buy: "+
- EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarBuyPrice)+" coins");
- }
- break;
- case 2:
- if(bazaarInfo.has("avg_sell")) {
- if(!added) {
- tooltip.add("");
- if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
- added = true;
- }
- int bazaarSellPrice = (int)bazaarInfo.get("avg_sell").getAsFloat()*stackMultiplier;
- tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Sell: "+
- EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarSellPrice)+" coins");
- }
- break;
- case 3:
- if(bazaarInfo.has("curr_buy")) {
- if(!added) {
- tooltip.add("");
- if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
- added = true;
- }
- int bazaarInstantBuyPrice = (int)bazaarInfo.get("curr_buy").getAsFloat()*stackMultiplier;
- tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Buy: "+
- EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantBuyPrice)+" coins");
- }
- break;
- case 4:
- if(bazaarInfo.has("curr_sell")) {
- if(!added) {
- tooltip.add("");
- if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]");
- added = true;
- }
- int bazaarInstantSellPrice = (int)bazaarInfo.get("curr_sell").getAsFloat()*stackMultiplier;
- tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Sell: "+
- EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantSellPrice)+" coins");
- }
- break;
- case 5:
- if(craftCost.fromRecipe) {
- if(!added) {
- tooltip.add("");
- added = true;
- }
- tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Raw Craft Cost: "+
- EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format((int)craftCost.craftCost)+" coins");
- }
- break;
- }
- }
-
- return added;
}
return false;