// Load two screens. One is topscreen one is bottomscreen.
int botscr = NewImage(256,192);
int topscr = NewImage(256,192);
// Load all the UI images.
int back = LoadImage("UI\Court Room Lowerscreen.png");
int bigbutton = LoadImage("UI\BigButton.png");
int bigarrow = LoadImage("UI\BigArrow.bmp");
int lines = LoadImage("UI\Scanlines.png");
int bars = LoadImage("UI\Bars.png");
int crecord = LoadImage("UI\Court Record.png");
int cursor = LoadImage0("UI\mouse.png");
int buttons = LoadImage("UI\Buttons.png");
int mwin = LoadImage("UI\mwin.png");
int mwintitle = LoadImage("UI\mwin base.png");
int bcrecord = LoadImage("UI\bcrecord.png");//NewImage(80,33);
int crecordbox = LoadImage("UI\crecordbox.png");
// Load graphics.
int dlob = LoadImage("Graphics\Defense Lobby.PNG");
int butz = LoadImage("Graphics\Butz.png");
// Load fonts.
int font = LoadFont("UI\font.png");
int font2 = LoadFont("smallfont3.gif");
int font3 = LoadFont("menu_font_white.png");
int i = 0;
int item = 0;
int GUInum = 1;
int prevGUI = 1;
int changem = 0;
int done = 0;
int textnum = 0;
int backp = dlob;
int frontp = butz;
string txt = "Press ENTER to exit.";
string texts[4][500];
void autoexec()
{
texts[0][0] = "Butz";
texts[1][0] = "Huhuh! I am ready for anything!";
texts[2][0] = "I am Larry Butz.... ultimate";
texts[3][0] = "human being! <Smiles>";
//texts[4][0] = "Graphics\Defense Lobby.PNG|Graphics\Butz.PNG";
texts[0][1] = "Butz";
texts[1][1] = "That is an awesome intro, ";
texts[2][1] = "isn't it? Tell me tell me.";
texts[3][1] = "";
texts[0][2] = "Phoenix";
texts[1][2] = "No. It is lame. My hair is";
texts[2][2] = "better than your intro.";
texts[3][2] = "..heck, Payne's hair is better.";
setresolution(256,384);
EnableVariableWidth(font);
EnableVariableWidth(font2);
EnableVariableWidth(font3);
windowsetsize(1,265,415);
while (!b3)
{
//Draw the guis.
if (GUInum == 1) {GUI1();}
if (GUInum == 2) {GUI2();}
if (GUInum == 3) {GUI3();}
//Draw some blah stuff on the top screen.
blit(0,0,backp,topscr);
tblit(0,0,frontp,topscr);
//printString(5,(192 - 48) + 5,topscr,font,"Press ESC to exit [Textnum = " + str(textnum) + "]");
if (mouse.y >= 192) {printString(5,0,topscr,font2,"Lower Mouse Pos:" + str(mouse.x) + ", " + str(mouse.y - 192));}
//Blit the two screens onto the screen.
blit(0,192,botscr,screen);
blit(0,0,topscr,screen);
tmwin(texts[0][textnum],texts[1][textnum],texts[2][textnum],texts[3][textnum],1);
//Draw mouse cursor.
Tblit(mouse.x,mouse.y,cursor,screen);
ShowPage();
UpdateControls();
}
}
//GAME MAIN GUI
void GUI1()
{
blit(0,0,back,botscr);
Tblitlucent(16,40,15,bigbutton,botscr);
blitlucent(0,0,70,lines,botscr);
Tblit(223/2,25+(111/2),bigarrow,botscr);
Tblit(0,0,bars,botscr);
Tblit(256 - 80, 0, bcrecord, botscr);
//printString(144,3,botscr,font2,"ALT");
//printString(76,157,botscr,font2,"ENTER");
if (MouseBox(178,192,254,220,0) && mouse.l == 1 || b2 == 1)
{
Tadditiveblit(256 - 80,0,bcrecord,botscr);
unpress(1);
mouse.l = 0;
changem = 1;
prevGUI = 1;
GUInum = 2;
}
if (MouseBox(16,40,238,151,1) && mouse.l == 1 || b1 == 1)
{
Tadditiveblit(16,40,bigbutton,botscr);
//Tadditiveblit(16,40,bigbutton,botscr);
textnum += 1;
unpress(1);
mouse.l = 0;
done = 0;
}
}
//EVIDENCE MAIN GUI
void GUI2()
{
if (changem)
{
i += 1;
blit(0,0,back,botscr);
if (prevGUI = 1)
{
if (i < 30)
{
tscaleblit(22,36,208,i * 3,crecordbox,botscr);
}
else
{
tblit(22,36,crecordbox,botscr);
}
}
else
{
if (i < 30)
{
tscaleblit(22,36,208,124 - (i * 3),crecordbox,botscr);
}
if (i < 60)
{
tscaleblit(22,36,208,(i - 30) * 3,crecordbox,botscr);
}
else
{
tblit(22,36,crecordbox,botscr);
}
}
blitlucent(0,0,70,lines,botscr);
tgrabregion(0,0,256,34,0,0,crecord,botscr);
tgrabregion(0,160,255,191,0,160,crecord,botscr);
Tblit(256 - 80, (0 - i)/2, bcrecord, botscr);
Tadditiveblit(256 - 80, 0 - i, bcrecord, botscr);
tgrabregion(7,110,86,140,0,160,crecord,botscr);
if (i < 30)
{
tgrabregion(170,101,250,131,256 - 80, (i - 30), crecord, botscr);
}
else
{
tgrabregion(170,101,250,131,256 - 80, 0, crecord, botscr);
}
if (i > 30)
{
if (i < 81)
{
tgrabregion(2,35,194,60,0,(i - 81)/2,crecord,botscr);
tgrabregion(0,0,256,34,0,0,crecord,botscr);
tgrabregion(170,101,250,131,256 - 80, 0, crecord, botscr);
}
else {tgrabregion(2,35,194,60,0,7,crecord,botscr);}
if (i == 117) {changem = 0; i = 0;}
}
}
if (!changem)
{
blit(0,0,back,botscr);
tblit(22,36,crecordbox,botscr);
blitlucent(0,0,70,lines,botscr);
tgrabregion(2,35,194,60,0,7,crecord,botscr);
//Draw the two bars
tgrabregion(0,0,256,34,0,0,crecord,botscr);
tgrabregion(0,160,255,191,0,160,crecord,botscr);
//Draw the "back" button.
tgrabregion(7,110,86,140,0,160,crecord,botscr);
//Draw the "profiles" button.
tgrabregion(170,101,250,131,256 - 80, 0, crecord, botscr);
//printString(81,178,botscr,font2,"SPACE");
//printString(144,3,botscr,font2,"ALT");
//Handle the squares
if (MouseBox(34,64,74,104,1))
{
printString(29,41,botscr,font,"Slot 1");
item = 1;
}
if (MouseBox(82,64,122,104,1))
{
printString(29,41,botscr,font,"Slot 2");
item = 2;
}
if (MouseBox(130,64,170,104,1))
{
printString(29,41,botscr,font,"Slot 3");
item = 3;
}
if (MouseBox(178,64,218,104,1))
{
printString(29,41,botscr,font,"Slot 4");
item = 4;
}
if (MouseBox(34,122,74,152,1))
{
printString(29,41,botscr,font,"Slot 5");
item = 5;
}
if (MouseBox(82,122,122,152,1))
{
printString(29,41,botscr,font,"Slot 6");
item = 6;
}
if (MouseBox(130,122,170,152,1))
{
printString(29,41,botscr,font,"Slot 7");
item = 7;
}
if (MouseBox(178,122,218,152,1))
{
printString(29,41,botscr,font,"Slot 8");
item = 8;
}
if (MouseBox(22,58,229,158,1) && mouse.l == 1 && item > 0|| b1 == 1)
{
unpress(1);
mouse.l = 0;
changem = 1;
GUInum = 3;
}
//Handle the "back" button.
if (MouseBox(0,160,77,191,1) && mouse.l == 1 || b4 == 1)
{
unpress(4);
mouse.l = 0;
GUInum = 1;
}
//Handle the "profile" button
if (MouseBox(178,192,254,220,0) && mouse.l == 1 || b2 == 1)
{
unpress(2);
mouse.l = 0;
changem = 1;
GUInum = 3;
}
}
}
void GUI3()
{
if (changem)
{
i += 1;
blit(0,0,back,botscr);
if (i < 30)
{
tscaleblit(22,36,208,124 - (i * 3),crecordbox,botscr);
}
if (i < 60)
{
tscaleblit(22,36,208,(i - 30) * 3,crecordbox,botscr);
}
else
{
tblit(22,36,crecordbox,botscr);
}
//scanlines
blitlucent(0,0,70,lines,botscr);
// bars
tgrabregion(0,0,256,34,0,0,crecord,botscr);
tgrabregion(0,160,255,191,0,160,crecord,botscr);
//Court record button going out.
Tblit(256 - 80, (0 - i)/2, bcrecord, botscr);
Tadditiveblit(256 - 80, 0 - i, bcrecord, botscr);
//Back button
tgrabregion(7,110,86,140,0,160,crecord,botscr);
if (i < 30)
{
//evidence button
tgrabregion(89,101,168,131,256 - 80, (i - 30), crecord, botscr);
}
else
{
//evidence button
tgrabregion(89,101,168,131,256 - 80, 0, crecord, botscr);
}
if (i > 30)
{
if (i < 81)
{
//profile tab
tgrabregion(2,63,194,88,0,(i - 81)/2,crecord,botscr);
//bar
tgrabregion(0,0,256,34,0,0,crecord,botscr);
//evidence button
tgrabregion(89,101,168,131,256 - 80, 0, crecord, botscr);
}
else {tgrabregion(2,63,194,88,0,7,crecord,botscr);}
if (i == 117) {changem = 0; i = 0;}
}
}
if (!changem)
{
blit(0,0,back,botscr);
tblit(22,36,crecordbox,botscr);
blitlucent(0,0,70,lines,botscr);
tgrabregion(2,63,194,88,0,7,crecord,botscr);
//Draw the two bars
tgrabregion(0,0,256,34,0,0,crecord,botscr);
tgrabregion(0,160,255,191,0,160,crecord,botscr);
//Draw the "back" button.
tgrabregion(7,110,86,140,0,160,crecord,botscr);
//Draw the "profiles" button.
tgrabregion(89,101,168,131,256 - 80, 0, crecord, botscr);
//Draw scanlines on top to get 'disabled' look.
printString(29,63,botscr,font,"SOON TO COME: Profiles!");
printString(29,75,botscr,font,"Press [ALT].");
if (b2 == 1 || mouse.l = 1)
{
unpress(2);
mouse.l = 0;
prevGUI = 3;
changem = 1;
GUInum = 2;
}
}
}
int MouseBox(int x1, int y1, int x2, int y2,int botscre)
{
if (botscre == 1)
{
y1 += 192;
y2 += 192;
}
if (mouse.x > x1 && mouse.x < x2 && mouse.y > y1 && mouse.y < y2)
{
return 1;
}
else
{
return 0;
}
}
void tmwin(string charac,string text1,string text2,string text3,int speed)
{
string txthold;
//txtmov = 1;
int l1,l2,l3;
render();
while (!done)
{
blit(0,0,backp,topscr);
tblit(0,0,frontp,topscr);
tblitlucent(0,192 - 48,28,mwin,topscr);
tgrabregion(50,139,99,153,0,192 - 48 - 14,mwintitle,topscr);
printcenter(25,(192 - 48 - 14)+3,topscr,font3,charac);
printString(5,(192 - 48) + 5 ,topscr,font,left(text1,l1));
l1 += speed;
if (l1 > len(text1))
{
printString(5,(192 - 48) + 18,topscr,font,left(text2,l2));
l2 += speed;
if (l2 > len(text2))
{
printString(5,(192 - 48) + 31,topscr,font,left(text3,l3));
l3 += speed;
if (l3 > len(text3))
{ done = 1;}
}
}
for (i = 0;i < speed * 100;i++) { blit(0,0,topscr,screen);}
i = 0;
blit(0,0,topscr,screen);
showpage();
updatecontrols();
}
if (done == 1)
{
tblitlucent(0,192 - 48,28,mwin,topscr);
tgrabregion(50,139,99,153,0,192 - 48 - 14,mwintitle,topscr);
printcenter(25,(192 - 48 - 14)+3,topscr,font3,charac);
printString(5,(192 - 48) + 5 ,topscr,font,text1);
printString(5,(192 - 48) + 18,topscr,font,text2);
printString(5,(192 - 48) + 31,topscr,font,text3);
blit(0,0,topscr,screen);
}
}