[Manialink] Version 2

Talk about ManiaLink development in this forum

Moderator: NADEO

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

[Manialink] Version 2

Post by noyranea » 16 Oct 2014, 22:24

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: 911
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: [Manialink] Version 2

Post by Chris92 » 16 Oct 2014, 22:44

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!
Image

Maintainer of AdminServ - Follow @AdminServ on Twitter!
Check out my Personal Twitter account!

User avatar
djhubertus
Translator
Translator
Posts: 1218
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: [Manialink] Version 2

Post by djhubertus » 16 Oct 2014, 22:49

:1010
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib

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

Re: [Manialink] Version 2

Post by spaii » 16 Oct 2014, 23:58

:thumbsup:

novationx
Posts: 2718
Joined: 10 Aug 2013, 22:33

Re: [Manialink] Version 2

Post by novationx » 17 Oct 2014, 10:58

impressive :thumbsup:
Now I can use my html & css skills :p
NADEO y u do diz? :oops: #MP4

User avatar
domino54
Translator
Translator
Posts: 1674
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: [Manialink] Version 2

Post by domino54 » 17 Oct 2014, 13:53

Would be cool to have more attributes like author="" and <desc> like meta info in html :)
SHOOTMANIA GALAXY • PURSUIT • INVASION • HUNGER GAMES • EVIDENCE CHAT • FINDME
YouTube channel - Facebook page - GitHub repository

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

Re: [Manialink] Version 2

Post by noyranea » 20 Oct 2014, 10:36

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: 1073
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [Manialink] Version 2

Post by spaii » 30 Oct 2014, 21:01

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: 1360
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: [Manialink] Version 2

Post by Nerpson » 22 Nov 2014, 19:08

It seems that the background attribute does not work well in version 2. :?
Image
ImageImage

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

Re: [Manialink] Version 2

Post by noyranea » 25 Nov 2014, 09:25

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 0 guests