From: Matthias T. <mt...@us...> - 2005-12-28 20:28:01
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/client/gui/wt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22930/src/games/stendhal/client/gui/wt Modified Files: EntitySlot.java Log Message: added patch from Janet Hunt: * On double-click a request is sent to server to move content of slot to player's inventory bag. Index: EntitySlot.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/client/gui/wt/EntitySlot.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EntitySlot.java 18 Dec 2005 21:33:13 -0000 1.12 --- EntitySlot.java 28 Dec 2005 20:27:51 -0000 1.13 *************** *** 95,104 **** } ! /** adds an object to this slot */ public void add(RPObject object) { content = object; } - /** --- 95,103 ---- } ! /** adds an object to this slot, this replaces any previous content */ public void add(RPObject object) { content = object; } /** *************** *** 177,180 **** --- 176,207 ---- return true; } + + /** doubleclick moves this item to the players inventory */ + public synchronized boolean onMouseDoubleClick ( Point p ) + { + // check if the baseclass wants to process the event + if ( super.onMouseDoubleClick( p ) ) + { + return true; + } + + RPObject player = StendhalClient.get().getPlayer(); + + System.out.println( "-- mouse doubleclick -- : " + getName() ); + + RPAction action = new RPAction(); + action.put("type","equip"); + // source object and content from THIS container + action.put("baseobject", parent.getID().getObjectID()); + action.put("baseslot", getName()); + action.put("baseitem", content.getID().getObjectID()); + // target is player's bag + action.put("targetobject", player.getID().getObjectID()); + action.put("targetslot","bag"); + StendhalClient.get().send(action); + + return true; + } + } |