Forum

> > CS2D > General > XML Newline
Forums overviewCS2D overviewGeneral overviewLog in to reply

English XML Newline

17 replies
To the start Previous 1 Next To the start

old XML Newline

Mami Tomoe
User Off Offline

Quote
How does one create a new line in the XML serverinfo file?

I've tried Google, nothing works.

I've tried using the following:
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.


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

old Re: XML Newline

TimeQuesT
User Off Offline

Quote
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.

old Re: XML Newline

Mami Tomoe
User Off Offline

Quote
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

old Re: XML Newline

Mami Tomoe
User Off Offline

Quote
@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?

old Re: XML Newline

TimeQuesT
User Off Offline

Quote
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.

old Re: XML Newline

Gaios
Reviewer Off Offline

Quote
@user Mami Tomoe: If you mind reading too, HTML is built on top of XML. Pretty much basic HTML tags will work for you.

old Re: XML Newline

Mami Tomoe
User Off Offline

Quote
@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

old Re: XML Newline

SQ
Moderator Off Offline

Quote
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.
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

old Re: XML Newline

Mami Tomoe
User Off Offline

Quote
@user SQ: How would I get around the character limit?
Also will that be fixed in the next CS2D update?

old Re: XML Newline

SQ
Moderator Off Offline

Quote
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.

1
<br/><text size = "15" color="#aaaaaa" align = "left">Server info message.</text>
is equal to
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

old Re: XML Newline

SQ
Moderator Off Offline

Quote
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.

old Re: XML Newline

Mami Tomoe
User Off Offline

Quote
@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

old Re: XML Newline

SQ
Moderator Off Offline

Quote
GIF is not supported by BlitzMax.

Text highlighting is pretty simple.
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

old Re: XML Newline

Mami Tomoe
User Off Offline

Quote
@user SQ: Well I've tried something:

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...
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview