[Manialink] Version 2

Talk about ManiaLink development in this forum

Moderator: NADEO

Post Reply
User avatar
noyranea
Nadeo
Nadeo
Posts: 187
Joined: 29 Apr 2014, 14:50
Location: Paris, France

[Manialink] Version 2

Post by noyranea »

Hi everyone,

at long last, I can share the changes we made to the Manialink language !

First of all, Manialinks beginning with the version="1" attribute aren't changed at all. If they are, you found a bug and are welcome to report it. The following information apply to version="2" Manialinks.
  • You can now use stylesheets : you just have to add the <stylesheet> </stylesheet> tags to your manialink. Within those tags, you can add styles like

    Code: Select all

    <style id="myid1 myid2" class="myclass1 myclass2" style="mystyle" posn="20 20" sizen="30 30" />
    And every manialink control having the id myid1, myid2 or the class myclass1 or myclass2 will receive the style, posn and sizen attributes you set in the style if they have not already those attributes

    Good to know :
    - if different styles apply to the same id / to the same class, only the last declared one will be applied
    - if a control can receive attributes from both and id-linked style and a class-linked style, only the id-linked style ones will be applied

    A sample manialink using stylesheet has been added (as well as a sample titlepack menu). You can load them using the Interface Designer. They're placed in file://Media/Manialinks/Common/Samples/
  • The format tag has been removed from the language, since it's no longer useful with stylesheets.
  • New "textedit" tag, in order to replace multiple lines entries. This control looks like the script editor. For more information about it's attributes, you can add one in the Interface Designer and see what happens.
  • Entries can now use only one line : autonewline and maxline attributes have been removed. A "selecttext" attribute has been added : if you set it to "1", the text of the entry will be automatically selected when it's focused. A "textformat" attribute has been added as well, allowing you to set the text as a password for instance.
  • Data attributes have been added. In any tag, you can add attributes beginning with "data-".

    Code: Select all

    <quad id="myquad" data-foo="bar" data-link="url" />
    They will be available in the script by using the "DataAttributeExists", "DataAttributeGet" and "DataAttributeSet" functions.

    Code: Select all

     Quad.DataAttributeExists("foo"); //returns True
    Quad.DataAttributeGet("foo"); //returns "bar"
    Quad.DataAttributeSet("foo", "bob");
    Quad.DataAttributeGet("foo"); //returns "bob"
    
That's all ;) Changes have been made to the Interface Designer as well. I'll make a post about it later on.

Have a nice evening,

-- noyranea
User avatar
Chris92
Translator
Translator
Posts: 952
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: [Manialink] Version 2

Post by Chris92 »

Thanks a bunch for this informing post!
Stylesheets make things so much easier if you have a lot elements that have the same style :yes: - really great addition!
Check out my Personal Twitter account!
User avatar
djhubertus
Translator
Translator
Posts: 1252
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: [Manialink] Version 2

Post by djhubertus »

:1010
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
User avatar
spaii
Posts: 1100
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [Manialink] Version 2

Post by spaii »

:thumbsup:
novationx
Posts: 2723
Joined: 10 Aug 2013, 22:33

Re: [Manialink] Version 2

Post by novationx »

impressive :thumbsup:
Now I can use my html & css skills :p
The neverending waiting game has to stop.
User avatar
Dommy
Translator
Translator
Posts: 1901
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: [Manialink] Version 2

Post by Dommy »

Would be cool to have more attributes like author="" and <desc> like meta info in html :)
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
User avatar
noyranea
Nadeo
Nadeo
Posts: 187
Joined: 29 Apr 2014, 14:50
Location: Paris, France

Re: [Manialink] Version 2

Post by noyranea »

Hello !

One of you made a quite relevant remark on the update a few days ago : you cannot access some of the new attributes from the script.

It has been corrected and after the next update, you'll be able to access and set :
  • Entry attribute TextFormat (ETextFormat:: basic, password, newpassword)
  • TextEdit (CMlTextEdit) attribute TextFormat (ETextFormat:: basic, script, password, newpassword)
  • TextEdit attributes ShowLineNumbers (Bool), AutoNewLine (Bool) and MaxLine (Integer)
@domino54 : your request has been noted, but I can't say when it'll be done.

Thanks for waiting,

-- noyranea
User avatar
spaii
Posts: 1100
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [Manialink] Version 2

Post by spaii »

Hi all,

today i converted some manialinks to version 2 and added data attributes in some.
All seems to work nice :thumbsup:

I've got a suggestion concerning data attributes :
Could be nice to have GetDataAttribute and SetDataAttribute in place of DataAttributeGet and DataAttributeSet to correspond with other functions name ;)
User avatar
Nerpson
Translator
Translator
Posts: 1555
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: [Manialink] Version 2

Post by Nerpson »

It seems that the background attribute does not work well in version 2. :?
ImageImageImageImage
User avatar
noyranea
Nadeo
Nadeo
Posts: 187
Joined: 29 Apr 2014, 14:50
Location: Paris, France

Re: [Manialink] Version 2

Post by noyranea »

Hello everyone !

Some answers :
  • @Spai : the functions are named DataAttributeGet/Set/Has so they can be found on consecutive lines in the script documentation
  • @Nerpson : the background attribute for manialink didn't work very well in version 1 either. We know we have to make it work, but since it's not absolutely necessary, it has not been fixed yet.
Have a nice day,

-- noyranea
Post Reply

Return to “ManiaLink”

Who is online

Users browsing this forum: No registered users and 1 guest