How to make a msg_display hyperlink in webclient?

80 views
Skip to first unread message

GTM

unread,
Sep 6, 2014, 12:21:49 PM9/6/14
to eve...@googlegroups.com
Hi,there


   Evennia is a great tool to make good game. These days i am studying it.

   There is a question in front of me and I can't find it out(Im newbie, but I Love the system), please help me for a while.

   The question is:
   In ajax webclient, how to implement this(the blue text is hyperlink of command):
   

   Change:
   Exit: large red door, southwest, north, tutorial, chargen
   You see: button
   --------------------------------------------------------------------------------
  To
   Exit: large red door, southwest, north, tutorial, chargen
   You see: button

the html code behind is like:
    
   Exit: <a href="large red door">large red door</a>, <a href="southwest">southwest</a>, <a href="north">north</a>, <a href="tutorial">tutorial</a>, <a href="chargen">chargen</a>
   You see: <a href="look button">button</a>


   So, when players click these hyperlink, the webclient will send the command to sever and get respons.
   The click style in webclient from ios android device will be great.

  Please help me,
  Thanks a lot.

Griatch Art

unread,
Sep 8, 2014, 5:28:15 AM9/8/14
to eve...@googlegroups.com
Hi there,

There is no explicit handling of clickable links in the web client (nor in Evennia) by default. What needs to be done is for the client to process the click (using javascript) and translate this into an Out-of-band (OOB) command to Evennia. The websocket web client (not the ajax one, that is deprecated) has examples of sending data over OOB. Our documentation on sending OOB commands is still not complete, so at the moment you'd need to look at the code for details, sorry. Ask again if you have specific questions.
.
Griatch

GTM

unread,
Sep 9, 2014, 12:18:21 PM9/9/14
to eve...@googlegroups.com
Got it.
I have got implement the js to process the click in the ajax client, and i think it will work the same on websocket client.
It will send command by click to the sever.

But I don't know how to put a link in the message.
As I tried to put a href in the object message, for etc:     
 This is a <a href="look button">button</a>.

It didn't show as I expect in weblient: 
 This is a button.(button is clickable)

But it shows as below, the client didn't resolve the a href to hyperlink:
 This is a <a href="look button">button</a>.

So, all I confuse is how can I get the result as I expect:
 This is a button.(button is clickable)

  I tried but still can't resolve this question.
  Thank you for your help.

Gao.

Griatch Art

unread,
Oct 6, 2014, 1:24:39 PM10/6/14
to eve...@googlegroups.com
Since yesterday, thanks to the work of user "titeuf87", Evennia supports link formatting for creating clickable command-links for telnet and web clients.

You use the following syntax:

msg("This is a {lclook{ltlook command{le that you can click at")

That is,
  • {lc (link command) defines which command should be triggered by the link
  • {lt (link text) starts the definition of the link's text
  • {le (link end) concludes the link

All components are required and the result will be an MXP link in supported telnet clients and a HREF tag for the webclient. If the client does not support clickable links, only the link text will be shown.

.

Griatch

Yijun Lu

unread,
Oct 8, 2014, 11:54:41 AM10/8/14
to eve...@googlegroups.com
It's great! Links can make it much easier in playing MUDs on smart phones.
Reply all
Reply to author
Forward
0 new messages