home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 November
/
CDVD1105.ISO
/
Util
/
Winamp
/
Skins
/
Anime_Shogo.wal
/
scripts
/
libraryscrpt.m
< prev
next >
Wrap
Text File
|
2004-08-22
|
3KB
|
118 lines
#include <lib/std.mi>
Function mlresize(int h, int w);
Function doortoggle(int h);
Global Group Topdoor, Bottomdoor, frameGroup, Overlay;
Global Layer Toplogo, BottomLogo;
Global Timer doorTimer;
Global Guiobject mleditor;
Global Boolean doorState, doorML;
System.onScriptLoaded() {
frameGroup = getScriptGroup();
mleditor = framegroup.findObject("library.content");
Topdoor = framegroup.findObject("library.topdoor");
Bottomdoor = framegroup.findObject("library.bottomdoor");
Toplogo = framegroup.findObject("topdoor.logo");
Bottomlogo = framegroup.findObject("bottomdoor.logo");
Overlay = frameGroup.findObject("library.overlay");
doorState = 1;
doorML = system.getPrivateInt(getSkinName(), "doorML", 0);
if(doorML) {
mleditor.hide();
mlresize(framegroup.getHeight(), framegroup.getWidth());
doorTimer = new Timer;
doorTimer.setDelay(300);
doorTimer.start();
} else {
Topdoor.hide();
Toplogo.hide();
Bottomdoor.hide();
Bottomlogo.hide();
Overlay.hide();
mleditor.show();
}
}
System.onScriptUnloading() {
delete doorTimer;
}
mlresize(int h, int w) {
Topdoor.setXmlParam("h", integerToString((h-48)/2));
Toplogo.setXmlParam("x", integerToString((w-44)/2-47));
Bottomdoor.setXmlParam("h", integerToString((h-48)/2));
Bottomdoor.setXmlParam("y", integerToString((h-48)/2+24));
Bottomlogo.setXmlParam("x", integerToString((w-44)/2-61));
}
framegroup.onresize(int x, int y, int w, int h) {
if(doorML) mlresize(h, w);
}
doorTimer.onTimer() {
doortoggle(framegroup.getHeight());
doorTimer.stop();
}
doortoggle(int h) {
if(doorstate) {
int toph = Topdoor.getXmlParam("h");
Topdoor.setTargetY(24-toph);
Topdoor.setTargetSpeed(3);
Topdoor.gotoTarget();
Bottomdoor.setTargetY((h-48)/2+(h-48)/2+24);
Bottomdoor.setTargetSpeed(3);
Bottomdoor.gotoTarget();
doorState = 0;
} else {
Topdoor.setTargetY(24);
Topdoor.setTargetSpeed(3);
Topdoor.gotoTarget();
Bottomdoor.setTargetY((h-48)/2+24);
Bottomdoor.setTargetSpeed(3);
Bottomdoor.gotoTarget();
doorState = 1;
}
}
Topdoor.onTargetReached() {
if(!doorState) {
mleditor.show();
Overlay.setTargetA(0);
Overlay.setTargetSpeed(0.5);
Overlay.gotoTarget();
Topdoor.hide();
Bottomdoor.hide();
}
}
Overlay.onTargetReached() {
if(Overlay.getAlpha()==0) Overlay.hide();
else {
Topdoor.show();
Bottomdoor.show();
mleditor.hide();
doortoggle(framegroup.getHeight());
}
}