I want to share my latest project regarding Manialink development, I already introduced in the german mania-community blog.
While I originally didn't had the intention to create something like it is now, mQuery became a framework primarily handling ManiaScript on your Manialinks.
mQuery now is a framework to help you with the little things. Since the most Manialinks don't use excessive amounts of ManiaScript for humble purposes, I wanted to make (my) process of Manialink creating a bit more easy with that.
Since I already wrote quite a lot about the usage and functions on GitHub, I recommend having a look at the Wiki there. To make it interesting for you though, I'll give you a few examples here:
Code: Select all
$("#myElement, .theseElements:gt(2)").click(function(){
log($this.ControlId);
});
Code: Select all
$(".naviIcon").hover(function(){
$this.Scale = 1.2;
$this.PosnY += 2;
}, function(){
$this.Scale = 1.0;
$this.PosnY -= 2;
});
On the project's manialink (which is completely organized with mQuery of course) I have linked some demos where you can also have a look on the code.
[maniaplanet]mQuery?demo=mqUiElements[/maniaplanet] shows something, I like mQuery very much for:
Code: Select all
$("#myEntry").ui_checkbox();
// This creates a checkbox with different looks for each state, you can use it in a form or get the value with ManiaScript
At last a minor interesting thing: Since you can't directly style the checkbox looks (to stick to that example) since they are generated automatically, css-like code can be used to style elements of your Manialink. For example the whole project's Manialink uses things like
Code: Select all
label {
textcolor: 333;
}
.naviLink {
textprefix: $i$o;
scale: 1.2;
}
Since everything is auto-generated it might be quite a mess in some places, but I haven't stoped my work on this project. Because of that there are some bugs remaining and I won't guarantee that everything should work.
Anyway I would be interested in some opinions and maybe some testing experiences.