[Jcrossclient-cvs] jcrossclient CFclient.java,1.38,1.39 Changelog,1.45,1.46 InvWin.java,1.14,1.15 RE
Status: Alpha
Brought to you by:
cavesomething
From: <jcr...@li...> - 2006-04-19 23:05:31
|
Update of /cvsroot/jcrossclient/jcrossclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10581 Modified Files: CFclient.java Changelog InvWin.java README Log Message: add a put in container option to inventory items Index: README =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/README,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** README 23 Jan 2006 19:36:08 -0000 1.4 --- README 19 Apr 2006 23:05:27 -0000 1.5 *************** *** 75,80 **** will take commands. ! Use the quote (') key to give focus to the command window. - here you can issue ! various commands eg "shout hello" "party join foo", type help to see what all of these are. --- 75,80 ---- will take commands. ! Use the quote (') key (or press 't') to give focus to the command window. - ! here you can issue various commands eg "shout hello" "party join foo", type help to see what all of these are. Index: CFclient.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/CFclient.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** CFclient.java 19 Apr 2006 17:12:37 -0000 1.38 --- CFclient.java 19 Apr 2006 23:05:27 -0000 1.39 *************** *** 724,728 **** /* if the object has been newly closed, show the map */ if (((thisobj.getFlags() & F_OPEN) > 0) && ((val & F_OPEN) == 0)) { ! allobjects.setOpenContainer(thisobj); showmap(); } --- 724,728 ---- /* if the object has been newly closed, show the map */ if (((thisobj.getFlags() & F_OPEN) > 0) && ((val & F_OPEN) == 0)) { ! allobjects.setOpenContainer(null); showmap(); } *************** *** 1767,1772 **** public void dropObj(int tag, int quantity) { try { ! mConnection.writeBytes("move 0 "+ tag + " " + quantity ); } catch (Exception e) { errmsg("oops. error writing to server: "+e.getMessage()); --- 1767,1780 ---- public void dropObj(int tag, int quantity) { + moveObj(0, tag, quantity); + } + + public void moveObj(int destination, int tag) { + moveObj(destination, tag, 0); + } + + public void moveObj(int destination, int tag, int quantity) { try { ! mConnection.writeBytes("move " + destination + " "+ tag + " " + quantity ); } catch (Exception e) { errmsg("oops. error writing to server: "+e.getMessage()); *************** *** 1774,1779 **** } - - /* these two commands are speshul, they take the item number in binary form, * rather than the string representation --- 1782,1785 ---- *************** *** 1805,1813 **** public void pickupObj(int tag, int quantity) { int playertag=allobjects.getPlayerTag(); ! try { ! mConnection.writeBytes("move "+Integer.toString(playertag)+" "+Integer.toString(tag)+" " + quantity); ! } catch (Exception e) { ! errmsg("oops. error writing to server: "+e.getMessage()); ! } } --- 1811,1815 ---- public void pickupObj(int tag, int quantity) { int playertag=allobjects.getPlayerTag(); ! moveObj(playertag, tag, quantity); } Index: InvWin.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/InvWin.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** InvWin.java 15 Apr 2006 17:45:01 -0000 1.14 --- InvWin.java 19 Apr 2006 23:05:27 -0000 1.15 *************** *** 135,138 **** --- 135,139 ---- class InvWin extends Canvas implements MouseListener, ActionListener { PopupMenu item_single, item_plural; + MenuItem PutInmenu; int objpixheight=MapWin.pixheight+8; CFclient toplevel; *************** *** 171,174 **** --- 172,179 ---- item_single.add(newMenuItem("Rename")); this.add(item_single); + /* special menu option for when a container is open */ + PutInmenu = new MenuItem("Put In Container"); + PutInmenu.addActionListener(this); + } *************** *** 219,222 **** --- 224,232 ---- rename_menu.setVisible(true); } + else if (cmd.equals("Put In Container")) { + toplevel.moveObj(toplevel.allobjects.getOpenContainer().getTag(), + last_clicked_object.getTag()); + + } } *************** *** 247,253 **** --- 257,271 ---- if ((buttonmask&InputEvent.BUTTON3_MASK)>0) { if (clickobj.getNumObjs() > 1) { + if (toplevel.allobjects.getOpenContainer() != null) + item_plural.add(PutInmenu); + else + item_plural.remove(PutInmenu); item_plural.show(this.getParent(), evt.getX()-(int)offset.getX(), evt.getY()-(int)offset.getY()); } else { + if (toplevel.allobjects.getOpenContainer() != null) + item_single.add(PutInmenu); + else + item_single.remove(PutInmenu); item_single.show(this.getParent(), evt.getX()-(int)offset.getX(), evt.getY()-(int)offset.getY()); Index: Changelog =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/Changelog,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Changelog 19 Apr 2006 17:12:37 -0000 1.45 --- Changelog 19 Apr 2006 23:05:27 -0000 1.46 *************** *** 337,338 **** --- 337,344 ---- Metaserver - allow pressing enter in the url box to connect also. + + 20/04/2006 - CFClient - create a MoveObj function to handle item moving + + InvWin - add a 'put in container' menu option when a container is open + + README - update to mention 't' doubling for the quote key |