You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evennia currently has very limited MXP support - only links, really, which I think is fair and reasonable. Specifically, Evennia is designed with a built-in webclient, and links are a basic feature for a webclient, since by its very nature a webclient is a webpage and links are a fundamental aspect of webpages.
Another fairly basic feature for a webpage, which MXP has an implementation for as well, is images. It's not uncommon for people to want to take advantage of the webclient's more web-like features and add in images when developing Evennia games. And, while you can currently post images to your webclient, and you can create custom plugins for handling more complex OOB functionality, there's currently no way to actually embed an image into your game's content the way you can embed a link.
Suggested implementation
I propose we add a new markup tag, for example |img, which allows you to put an image directly into your content. For security purposes, this path should be assumed to be within the game server's static content, rather than allowing for embedding images from any and all sources. Using this new markup would thus look similar to this:
|imgcontent/images/goblin.png|img
This would be parsed to reference the file mygame/web/static/content/images/goblin.png via its external URL.
In both the HTML and ANSI parsers, the markup should be identified and parsed in a similar process to the link tags, but looking specifically for matched pairs. Unmatched |img tags will simply be rendered as their normal text.
The HTML parser would produce the standard <img src="image_path"> output, and the ANSI parser would, if the protocol supports the MXP, produce the MXP output of <IMAGE image_path> and otherwise nothing.
Alternate implementation
Both HTML and MXP support a number of additional features on image elements - however, aside from one exception, I believe that the potential benefits to be gained by supporting those features are dramatically outweighed by the increased complexity in supporting them.
That one exception to this, however, is alt text. This is a very valuable feature on image elements, especially when trying to support as wide a range of accessibility on your webclient as possible.
Adding alt text would, however, require a different kind of markup, more similar to the way links are already implemented. This would require a slightly more complex regex match, since unlike clickable text requiring both a link and text, an image does not require alt text along with its image path. My suggested syntax for image markup supporting text would be more like this:
|imcontent/images/goblin.png|ita goblin|ie
or with no alt text:
|imcontent/images/goblin.png|ie
I don't believe the MXP <IMAGE> supports alt text, so this feature would only be relevant for the webclient or other custom protocols using HTML parsing.
The text was updated successfully, but these errors were encountered:
Suggested Feature
Evennia currently has very limited MXP support - only links, really, which I think is fair and reasonable. Specifically, Evennia is designed with a built-in webclient, and links are a basic feature for a webclient, since by its very nature a webclient is a webpage and links are a fundamental aspect of webpages.
Another fairly basic feature for a webpage, which MXP has an implementation for as well, is images. It's not uncommon for people to want to take advantage of the webclient's more web-like features and add in images when developing Evennia games. And, while you can currently post images to your webclient, and you can create custom plugins for handling more complex OOB functionality, there's currently no way to actually embed an image into your game's content the way you can embed a link.
Suggested implementation
I propose we add a new markup tag, for example
|img
, which allows you to put an image directly into your content. For security purposes, this path should be assumed to be within the game server'sstatic
content, rather than allowing for embedding images from any and all sources. Using this new markup would thus look similar to this:This would be parsed to reference the file
mygame/web/static/content/images/goblin.png
via its external URL.In both the HTML and ANSI parsers, the markup should be identified and parsed in a similar process to the link tags, but looking specifically for matched pairs. Unmatched |img tags will simply be rendered as their normal text.
The HTML parser would produce the standard
<img src="image_path">
output, and the ANSI parser would, if the protocol supports the MXP, produce the MXP output of<IMAGE image_path>
and otherwise nothing.Alternate implementation
Both HTML and MXP support a number of additional features on image elements - however, aside from one exception, I believe that the potential benefits to be gained by supporting those features are dramatically outweighed by the increased complexity in supporting them.
That one exception to this, however, is alt text. This is a very valuable feature on image elements, especially when trying to support as wide a range of accessibility on your webclient as possible.
Adding alt text would, however, require a different kind of markup, more similar to the way links are already implemented. This would require a slightly more complex regex match, since unlike clickable text requiring both a link and text, an image does not require alt text along with its image path. My suggested syntax for image markup supporting text would be more like this:
or with no alt text:
I don't believe the MXP
<IMAGE>
supports alt text, so this feature would only be relevant for the webclient or other custom protocols using HTML parsing.The text was updated successfully, but these errors were encountered: