From: Kimmo R. <ki...@us...> - 2009-12-17 21:43:12
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/semos/tavern/market In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23402/src/games/stendhal/server/maps/semos/tavern/market Modified Files: ShowOffersChatAction.java Log Message: prettier names for the items, and handle stacks correctly Index: ShowOffersChatAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/semos/tavern/market/ShowOffersChatAction.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ShowOffersChatAction.java 13 Dec 2009 13:06:49 -0000 1.10 --- ShowOffersChatAction.java 17 Dec 2009 21:43:00 -0000 1.11 *************** *** 1,5 **** --- 1,7 ---- package games.stendhal.server.maps.semos.tavern.market; + import games.stendhal.common.Grammar; import games.stendhal.server.entity.item.Item; + import games.stendhal.server.entity.item.StackableItem; import games.stendhal.server.entity.npc.ChatAction; import games.stendhal.server.entity.npc.ConversationStates; *************** *** 175,181 **** return counter; } message.append(counter); message.append(": "); ! message.append(offer.getItem().getName()); message.append(" for "); message.append(offer.getPrice()); --- 177,190 ---- return counter; } + + Item item = offer.getItem(); + int quantity = 1; + if (item instanceof StackableItem) { + quantity = ((StackableItem) item).getQuantity(); + } + message.append(counter); message.append(": "); ! message.append(Grammar.quantityplnoun(quantity, item.getName())); message.append(" for "); message.append(offer.getPrice()); |