Investigate the possibility of making URLs in the game (more specifically, in TextScrollers, Infoboxes, and other Text objects) clickable. This would possibly attract more users to open links to forums, the website, or to add-on specific information
A point to consider is whether this could be abused by level designers.
True, it could.
Maybe add a confirmation dialog that shows the full URL and asks for permission before opening the URL?
I'd like to start contributing to the game, and this seems like a good first feature to add. It seems the best way to do this would be to use C++'s built-in regex parser to detect links in text, show a pop-up box for the user to confirm, and then use @qwertychouskie's code to open the links. Can someone assign this issue to me? Also open to suggestions if there's a better way to do this : )
@jackhumphries Unfortunately, I can only directly assign issues to members of the organisation or outside collaborators. But consider the issue assigned to you. :)
I think adding a "link tag" to the text is easier than using regex. Additionally to detecting links in the text, you also need to detect the area a link is in.
If you have any questions, please contact us through matrix here: https://riot.im/app/#/room/#supertux:matrix.org (we're mostly active during European daytime).
I'm taking a look at this again. I have a few design questions.
For now, I am looking more closely at TextScroller (e.g., for the credits) and InfoBoxLine (e.g., for the popup boxes in levels).
TextScroller: I am looking at data/credits.stxt. It's not immediately clear which way is best to incorporate URL information if, let's say, you wanted to make a certain word in the name mapping or info mapping clickable.
One option is to add another mapping called name-url (and info-url) that would make the entire name line clickable and linked to the specified URL in the name-url mapping.
A second option is to embed a link tag directly in the strings themselves, similar to HTML. Example:
(string (_ "Current SuperTux Team"))
InfoBoxLine: I have the same issue here, with regard to the infoblock mapping in levels that have popup boxes (e.g., in data/levels/world1/welcome_antarctica.stl). I could add more mappings for URLs or embed link tags directly.
Does anyone have a recommendation? As of now, I prefer embedding the link tags directly, particularly since this works across object types (TextScroller, InfoBoxLine, etc.), is more intuitive for a human to use, and makes it easier to associate only certain regions of text with a URL rather than entire lines, entire blocks, etc.
Most helpful comment
A point to consider is whether this could be abused by level designers.