Skip to content

Commit

Permalink
adding >2.1b support for custom ah (Moulberry#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 authored Aug 9, 2022
1 parent 197e463 commit 5308904
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public HashSet<String> getAuctionsForInternalname(String internalname) {
public class Auction {
public String auctioneerUuid;
public long end;
public int starting_bid;
public long starting_bid;
public int highest_bid_amount;
public int bid_count;
public boolean bin;
Expand All @@ -137,7 +137,7 @@ public class Auction {
public int enchLevel = 0; //0 = clean, 1 = ench, 2 = ench/hpb

public Auction(
String auctioneerUuid, long end, int starting_bid, int highest_bid_amount, int bid_count,
String auctioneerUuid, long end, long starting_bid, int highest_bid_amount, int bid_count,
boolean bin, String category, String rarity, int dungeonTier, String item_tag_str
) {
this.auctioneerUuid = auctioneerUuid;
Expand Down Expand Up @@ -540,7 +540,7 @@ private void processAuction(JsonObject auction) {
String auctionUuid = auction.get("uuid").getAsString();
String auctioneerUuid = auction.get("auctioneer").getAsString();
long end = auction.get("end").getAsLong();
int starting_bid = auction.get("starting_bid").getAsInt();
long starting_bid = auction.get("starting_bid").getAsLong();
int highest_bid_amount = auction.get("highest_bid_amount").getAsInt();
int bid_count = auction.get("bids").getAsJsonArray().size();
boolean bin = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private enum PriceFilter {
private boolean shouldUpdateSearch = false;
private boolean shouldSortItems = false;

private int startingBid = 0;
private long startingBid = 0;
private String currentAucId = null;

private int clickedMainCategory = -1;
Expand Down Expand Up @@ -640,7 +640,7 @@ public void drawScreen(int mouseX, int mouseY) {
}
}
if (priceNumbers.length() > 0) {
startingBid = Integer.parseInt(priceNumbers.toString());
startingBid = Long.parseLong(priceNumbers.toString());
}
}
}
Expand Down Expand Up @@ -1578,18 +1578,18 @@ public void sortItems() throws ConcurrentModificationException {
if (auc2 == null) return -1;

if (sortMode == SORT_MODE_HIGH) {
int price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid);
int price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid);
int diff = price2 - price1;
long price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid);
long price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid);
long diff = price2 - price1;
if (diff != 0) {
return diff;
return Long.compare(price2, price1);
}
} else if (sortMode == SORT_MODE_LOW) {
int price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid);
int price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid);
int diff = price1 - price2;
long price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid);
long price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid);
long diff = price1 - price2;
if (diff != 0) {
return diff;
return Long.compare(price1, price2);
}
} else {
long end1 = auc1.end;
Expand Down Expand Up @@ -1679,16 +1679,16 @@ private void increasePriceByFactor(float factor) {
priceField.setText((int) (priceI * factor) + end);
}

private int getPriceFilterAmount() {
private long getPriceFilterAmount() {
return getNumberFromTextBox(priceFilterField);
}

private int getNumberFromTextBox(GuiTextField textField) {
private long getNumberFromTextBox(GuiTextField textField) {
if (textField.getText().equals("")) {
return -2;
}
try {
int parsed = Integer.parseInt(textField.getText());
long parsed = Long.parseLong(textField.getText());
if (parsed < 0) {
return -1;
}
Expand All @@ -1698,7 +1698,7 @@ private int getNumberFromTextBox(GuiTextField textField) {
}
}

private int getBinPriceFilterAmount() {
private long getBinPriceFilterAmount() {
return getNumberFromTextBox(binPriceFilterField);
}

Expand Down

0 comments on commit 5308904

Please sign in to comment.