Skip to content

Instantly share code, notes, and snippets.

@Banane9
Created August 14, 2012 19:42
Show Gist options
  • Save Banane9/3352144 to your computer and use it in GitHub Desktop.
Save Banane9/3352144 to your computer and use it in GitHub Desktop.
Maniascript Test
<?xml version="1.0" encoding="UTF-8"?>
<manialink>
<timeout>0</timeout>
<type>default</type>
<script>
<!--
Void Show(Text ControlId)
{
declare CGameManialinkFrame Container <=> (Page.MainFrame.Controls["container"] as CGameManialinkFrame);
foreach(Frame in Container.Controls)
{
if(Frame.Id == ControlId)
{
Frame.Show();
}
else
{
Frame.Hide();
}
}
}
main()
{
Show("pagehomeframe");
while(True)
{
foreach(Event in PendingEvents)
{
switch(Event.Type)
{
case CGameManialinkScriptEvent::Type::Mouseclick:
{
if(Event.ControlId == "page1" || Event.ControlId == "page2" || Event.ControlId == "pagehome")
{
Show(Event.ControlId^"frame");
}
}
}
}
yield;
}
}
-->
</script>
<frame id="container" posn="0 0 0">
<frame id="pagehomeframe" posn="0 0 0">
<include url="./home.xml"/>
</frame>
<frame id="page1frame" posn="0 0 0">
<include url="./page1.xml"/>
</frame>
<frame id="page2frame" posn="0 0 0">
<include url="./page2.xml"/>
</frame>
</frame>
<label id="pagehome" posn="-43.2 30 -32" sizen="25.3 4.9" halign="center" valign="center" style="TextValueMedium" text="Home" ScriptEvents="1"></label>
<label id="page1" posn="-43.2 22.3 -32" sizen="25.3 4.9" halign="center" valign="center" style="TextValueMedium" text="Page 1" ScriptEvents="1"></label>
<label id="page2" posn="-43 11.2 -32" sizen="25.3 4.9" halign="center" valign="center" style="TextValueMedium" text="Page 2" ScriptEvents="1"></label>
</manialink>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment