From: Kimmo R. <ki...@us...> - 2008-11-27 15:23:51
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/client/entity In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17416/src/games/stendhal/client/entity Modified Files: RPEntity.java Log Message: added /me command based on code by raignarok Index: RPEntity.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/client/entity/RPEntity.java,v retrieving revision 1.240 retrieving revision 1.241 diff -C2 -d -r1.240 -r1.241 *** RPEntity.java 26 Oct 2008 13:04:45 -0000 1.240 --- RPEntity.java 27 Nov 2008 15:23:44 -0000 1.241 *************** *** 18,21 **** --- 18,22 ---- import games.stendhal.client.StendhalUI; import games.stendhal.client.stendhal; + import games.stendhal.client.gui.chatlog.EventLine; import games.stendhal.client.gui.chatlog.HeaderLessEventLine; import games.stendhal.client.gui.chatlog.StandardEventLine; *************** *** 543,549 **** public void onTalk(final String text) { if (User.isAdmin() || (User.squaredDistanceTo(x, y) < 15 * 15)) { - nonCreatureClientAddEventLine(text); - String line = text.replace("|", ""); // Allow for more characters and cut the text if possible at the --- 544,562 ---- public void onTalk(final String text) { if (User.isAdmin() || (User.squaredDistanceTo(x, y) < 15 * 15)) { String line = text.replace("|", ""); + + //an emote action is changed server side to an chat action with a leading !me + //this supports also invoking an emote with !me instead of /me + //rai...@so... + if(text.startsWith("!me")) + { + line = line.replace("!me", getTitle()); + StendhalUI.get().addEventLine(new HeaderLessEventLine(line, NotificationType.EMOTE)); + + return; + } else { + //add the original version + nonCreatureClientAddEventLine(text); + } // Allow for more characters and cut the text if possible at the |