in Listing.java
replace ur postbuttons method with this:
Code:
public static void postButtons(Player c, int button) {
switch(button) {
case 189237:
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
int total = 0;
LinkedList<Sale> sales = (LinkedList<Sale>) getSales(c.playerName);
for(@SuppressWarnings("unused") Sale sale : sales)
total++;
/* if(c.amDonated <= 9 && total >= 6) {
c.sendMessage("[@red@Trading Post@bla@] You cannot have more then 6 listings as a regular player.");
return;
} else if(c.amDonated >= 10 && c.amDonated <= 149 && total >= 10) {
c.sendMessage("[@red@Trading Post@bla@] You cannot have more then 10 listings as a low tier donator.");
return;
} else if(c.amDonated >= 150 && total >= 15) {
c.sendMessage("[@red@Trading Post@bla@] You cannot have more then 15 listings.");
return;
}*/
if(!c.inSelecting) {
openNewListing(c);
c.inSelecting = true;
c.getPA().sendFrame106(3);
} else {
resetEverything(c);
c.getPA().showInterface(48600);
c.getPA().sendFrame106(3);
}
break;
case 59229: //Close
c.getPA().closeAllWindows();
resetEverything(c);
break;
case 191072:
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
synchronized (c) {
c.outStream.createFrame(191);
}
c.xInterfaceId = 191072;
break;
case 191075: // Removed quantity button
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
synchronized (c) {
c.outStream.createFrame(192);
}
c.xInterfaceId = 191075;
break;
case 191078:
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
confirmListing(c);
break;
case 189223:
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
collectMoney(c);
break;
case 189234:
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
loadRecent(c, c.pageId);
break;
case 187136:
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
if(c.pageId > 1)
c.pageId--;
//System.out.println("id: "+c.searchId+" lookup: " + c.lookup);
switch(c.searchId) {
case 1:
loadItemName(c, c.lookup);
break;
case 2:
loadPlayerName(c, c.lookup);
break;
case 3:
loadRecent(c, c.pageId);
break;
}
break;
case 187139:
if (!c.getMode().isTradingPermitted()) {
c.sendMessage("You are not permitted to make use of this.");
return;
}
c.pageId++;
//System.out.println("id: "+c.searchId+" lookup: " + c.lookup);
switch(c.searchId) {
case 1:
loadItemName(c, c.lookup);
break;
case 2:
loadPlayerName(c, c.lookup);
break;
case 3:
loadRecent(c, c.pageId);
break;
}
break;
}
}
and loadRecent method:
Code:
public static void loadRecent(Player c, int pageId) {
c.pageId = pageId;
c.searchId = 3;
c.getPA().sendFrame126("Trading Post - Recent listings", 48019);
c.getPA().showInterface(48000);
List<Sale> sales = new LinkedList<Sale>();
int total = 0;
for(int i = NEXT_SALE_ID - 1; i > 0; i--) {
Sale sale = getSale(i);
if(sale.hasSold())
continue;
total++;
sales.add(sale);
if(total == 60)
break;
}
displayResults(sales, c);
}