
I used it for menu switching/navigation in an old manialink. If someone can/wants to clear this up or make it easier, feel free, this way I could learn too ^^ I remember I made it from 0 maniascript knowledge
Code: Select all
<script><!--
#Include "TextLib" as TextLib
main(){
declare CMlFrame mainpage <=> (Page.GetFirstChild("mainpage") as CMlFrame);
declare CMlFrame home <=> (Page.GetFirstChild("home") as CMlFrame);
declare CMlFrame skins <=> (Page.GetFirstChild("skins") as CMlFrame);
declare CMlFrame avatars <=> (Page.GetFirstChild("avatars") as CMlFrame);
declare CMlFrame horns <=> (Page.GetFirstChild("horns") as CMlFrame);
while(True){
foreach(Event in PendingEvents){
switch(Event.Type) {
case CMlEvent::Type::MouseClick: {
if(Event.ControlId=="menuhome"){
if(skins.Visible)skins.Hide();
if(avatars.Visible)avatars.Hide();
if(horns.Visible)horns.Hide();
home.Show();
}
if(Event.ControlId=="menuskins"){
if(home.Visible)home.Hide();
if(avatars.Visible)avatars.Hide();
if(horns.Visible)horns.Hide();
skins.Show();
}
if(Event.ControlId=="menuavatars"){
if(home.Visible)home.Hide();
if(skins.Visible)skins.Hide();
if(horns.Visible)horns.Hide();
avatars.Show();
}
if(Event.ControlId=="menuhorns"){
if(home.Visible)home.Hide();
if(skins.Visible)skins.Hide();
if(avatars.Visible)avatars.Hide();
horns.Show();
}
}
}
}
yield;
}
}
--></script>