English XML Newline

17 replies
Goto Page
To the start Previous 1 Next To the start
23.11.20 10:15:25 pm
Up
Mami Tomoe
User
Offline Off
How does one create a new line in the XML serverinfo file?

I've tried Google, nothing works.

I've tried using the following:
Code:
1
2
3






And god knows what else...

I just want to have a bunch of text under the same <text> tag but I need newlines for that.


Code:
1
2
3
4
<text size = "15" color="#FFFFFF" align = "center">
Title
Line1
Line2</text>

How to make this a reality?
edited 2×, last 23.11.20 11:23:11 pm
fish
24.11.20 12:38:25 am
Up
TimeQuesT
User
Offline Off
Code:
1
2
3
4
5
6
7
8
<?xml version="1.0"?>
<serverinfo>
 
<text size = "15" color="#FFFFFF" align = "center">Title</text><br/>
<text size = "15" color="#FFFFFF" align = "center">Line1</text><br/>
<text size = "15" color="#FFFFFF" align = "center">Line2</text><br/>
 
</serverinfo>


Same text tag seems not to work.
Muh
24.11.20 01:16:22 am
Up
Mami Tomoe
User
Offline Off
Also is there a fully explained article on how this XML stuff works?

I mean do I need to add the images that I use to the server transfer list file or is it automated like mods?

Also, why don't we have the word wrap feature like in the original server info?

And how to get XML errors to appear in the console?

May we turn this into an XML troubleshooting thread if there isn't already?


EDIT:

Can you have more than 1 color in 1 text tag?
Can you change the font somehow?
edited 1×, last 24.11.20 10:12:47 am
fish
24.11.20 10:47:36 am
Up
Gaios
Security Supporter
Offline Off
24.11.20 11:03:06 am
Up
Mami Tomoe
User
Offline Off
@user Gaios: It is quite clear that whatever CS2D is using is not identical to XML, would you mind reading and understanding the thread before you post anything?

Moving on... Here's a tl;dr of my questions thus far:

How does one vertically align text in the text tag?
Why is there no word wrap for the text tag?
Why don't newlines work in the text tag?
Can you have more than 1 color in 1 text tag?
Can you change the font somehow?
Do I need to add the images that I use to the server transfer list file or is it automated like mods?
And how to get XML errors to appear in the console?
fish
24.11.20 01:09:27 pm
Up
TimeQuesT
User
Offline Off
The serverinfo feature is not documented well. THIS might help.

Alot of questions that can only be answered by trying and/or asking user SQ.
Muh
24.11.20 01:09:55 pm
Up
Gaios
Security Supporter
Offline Off
@user Mami Tomoe: If you mind reading too, HTML is built on top of XML. Pretty much basic HTML tags will work for you.
24.11.20 01:30:56 pm
Up
Mami Tomoe
User
Offline Off
@user Gaios which they clearly haven't.

Have you not noticed that I've literally spent hours trying to find a solution online?

I've used both XML and HTML tags and neither work.

Do you even know the solution yourself?


EDIT:
Upon further inspection, when I connect to my server with another client I find out that the server info XML file that the client receives is not equal to the one that the server contains, it goes through some kind of line compression and breaks the XML file.

@user SQ, @user DC am I crazy or is this XML thing completely broken?
edited 1×, last 24.11.20 02:30:09 pm
fish
24.11.20 03:03:19 pm
Up
SQ
Moderator
Offline Off
It is XML, not HTML. It's just a language to implement structure.
Everything else depends on implementation which is very simple at the moment.
You can still achieve more than with regular server info.

There are a few tags implemented.
It's image, break, and text.

A good sample of what you can achieve.

https://pastebin.com/3M12kKUY

also great implementation in brazil server
IMG:https://i.imgur.com/lYp3XYC.png


You can create a new line only via break command.
Code:
1
<br/>


The main point of this XML feature was to make server info more extendable with images/colors and more properties for the objects in the description. (+ without braking existing features)

- More In-Depth

Tags:

• text
atributes:
color
hover-color
align
url
size

• image
atributes:
color
hover-color
align
url
width
height
source
webimage

• br - simple break

Regarding the difference in client and server.
Yes, there is character limit per line because legacy server info transfer deletes characters if they are over certain limit. That's not intended for new server info, but it's not fixed.
However, it is still possible to get around it.
edited 9×, last 24.11.20 03:28:01 pm
24.11.20 03:29:56 pm
Up
Mami Tomoe
User
Offline Off
@user SQ: How would I get around the character limit?
Also will that be fixed in the next CS2D update?
fish
24.11.20 03:33:47 pm
Up
SQ
Moderator
Offline Off
As you can see you can break a line in a file without "br" and it won't take affect.

I am working on too many things right now.
I might take a look at some point, but right now CS2D project and all BlitzMax setup is on old computer which I don't use daily right now.

It would be quite a bothersome task to implement a very solid HTML-like tags in BlitzMax.
For example whole text size and image handling system is almost entirely natively written.
It is simply too much of work for a feature no one uses.

Code:
1
<br/><text size = "15" color="#aaaaaa" align = "left">Server info message.</text>

is equal to
Code:
1
2
3
4
5
6
7
8
9
<br/>

<text size = "15" 
color="#aaaaaa"
align = "left">

Server info message.

</text>
edited 1×, last 24.11.20 03:40:54 pm
24.11.20 03:40:40 pm
Up
Mami Tomoe
User
Offline Off
@user SQ: What is the character per line count limit?
fish
24.11.20 03:41:51 pm
Up
SQ
Moderator
Offline Off
You can test that with old server info.
That is as many lines can be fit in one row.

It is simply server transfer for serverlist.
24.11.20 03:49:39 pm
Up
Mami Tomoe
User
Offline Off
@user SQ: the limit is about 80 chars.

EDIT: Is having GIF's and embedded content out of the question for the F1 menu? Just a random question, you don't have to take it too seriously

I'm also hoping most of the bugs with XML will be fixed by the next update.

I can't seem to use the text highlight feature, it doesn't work for me, but I haven't put much attention to it, nor do I really care or understand what it is anyways.
edited 1×, last 24.11.20 10:42:56 pm
fish
25.11.20 04:03:03 am
Up
SQ
Moderator
Offline Off
GIF is not supported by BlitzMax.

Text highlighting is pretty simple.
Code:
1
<br/><text size = "15" color="#ffffaa" hover-color="#ffffff" url = "www.cs2d.com">www.CS2D.com</text>
edited 1×, last 26.11.20 12:10:50 am
25.11.20 12:00:43 pm
Up
Mami Tomoe
User
Offline Off
@user SQ: Well I've tried something:

Code:
1
<br/><text size = "15" color="#FF0000" hovercolor="#ffffff" url = "www.cs2d.com">www.CS2D.com</text>


IMG:https://cdn.discordapp.com/attachments/397470084089643012/781111952373841930/unknown.png


I can't see white anywhere...
fish
26.11.20 12:09:36 am
Up
SQ
Moderator
Offline Off
@user Mami Tomoe:
it should be "hover-color"
26.11.20 12:15:03 am
Up
Mami Tomoe
User
Offline Off
@user SQ: Works now, thanks.
fish
To the start Previous 1 Next To the start