Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,228 @@
#include "..\\content\\..\\Content\\..\\content\\..\\Content\\ShellScripts\\stddefs.h"
s_simpledropbox
{
GUI_CREATE
{
font3d dropboxFont = "arial.ttf"
int textsize = 1
int textcolor = 0xffffffff
int backcolor = 0
int bordercolor = 0xffffffff
int droppedflag = 0
int selected = 0
int itemwidth = 128
int itemheight = 16
int total_items = 0
string Name
object o_dropbutton
object o_dropitem[16]
}
GUI_UNFOCUS
{
if (droppedflag)
{
int i
for(i = 0; i < total_items; i++)
{
deactivate(o_dropitem[i])
}
}
droppedflag = false
}
GUI_INIT
{
int i
for(i = 0; i < total_items; i++)
{
o_dropitem[i].location = location.x,location.y+((itemheight)*(i+1)),location.z
deactivate(o_dropitem[i])
o_dropitem[i].id = i
}
region = 0,0 to itemwidth,itemheight
o_dropbutton = s_dropbutton
o_dropbutton.location.z = location.z
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if (mouse.left == BUTTON_CLICKED)
{
if (droppedflag)
{
int i
for(i = 0; i < total_items; i++)
{
deactivate(o_dropitem[i])
}
}
else
{
focus(this)
int i
for(i = 0; i < total_items; i++)
{
activate(o_dropitem[i])
}
}
droppedflag = !droppedflag
}
}
}
GUI_MAILBOX
{
if (sender == o_dropbutton)
{
droppedflag = !droppedflag
if (droppedflag)
{
focus(this)
int i
for(i = 0; i < total_items; i++)
{
activate(o_dropitem[i])
}
}
else
{
int i
for(i = 0; i < total_items; i++)
{
deactivate(o_dropitem[i])
}
}
}
else
{
selected = getmessage()
int i
for(i = 0; i < total_items; i++)
{
deactivate(o_dropitem[i])
}
droppedflag = false
}
}
GUI_DRAW
{
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, -8,0,1,1,0
print3d Name
// draw background
setpencolor(backcolor)
drawrect location.x,location.y to location.x+itemwidth,location.y+16
// draw border
setpencolor(bordercolor)
drawframe location.x,location.y to location.x+itemwidth,location.y+itemheight
print3d_margins = location.x+8, location.y to location.x+itemwidth-8, location.y+itemheight
print3d_attributes = dropboxFont, textcolor,-8,1,1,0,0,1 // Ignore embedded codes!
print3d_position = location.x+8, location.y+3
print3d o_dropitem[selected].text
print3d_margins = 0,0 to 1024,768
}
}
s_dropbutton
{
GUI_CREATE
{
region = 0,0 to 16,16
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if (mouse.left == BUTTON_CLICKED)
{
mail(-1)
}
}
}
GUI_DRAW
{
// draw background
setpencolor(parent.backcolor)
location.x = parent.location.x+parent.itemwidth
location.y = parent.location.y
drawrect location.x, location.y to location.x+16, location.y+parent.itemheight
// draw border
setpencolor(parent.bordercolor)
drawframe location.x, location.y to location.x+16, location.y+parent.itemheight
// display arrow
drawline location.x+8, location.y+4 to location.x+8, location.y+13
if (parent.droppedflag)
{
drawline location.x+8, location.y+4 to location.x+4,location.y+8
drawline location.x+9, location.y+4 to location.x+13,location.y+8
}
else
{
drawline location.x+8, location.y+11 to location.x+4,location.y+7
drawline location.x+8, location.y+11 to location.x+13,location.y+7
}
}
}
s_dropitem
{
GUI_CREATE
{
string text
region = 0,0 to parent.itemwidth, parent.itemheight
int id
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if (mouse.left == BUTTON_CLICKED)
{
mail(id)
}
}
}
GUI_DRAW
{
// draw background
if (parent.selected == id)
{
setpencolor(parent.bordercolor)
drawrect location.x,location.y to location.x+parent.itemwidth+1,location.y+parent.itemheight
print3d_margins = location.x+8, location.y to location.x+parent.itemwidth-8, location.y+parent.itemheight
print3d_attributes = parent.dropboxFont, 0xff000000,-8,1,1,1,1,0,1
}
else
{
setpencolor(parent.backcolor)
drawrect location.x,location.y to location.x+parent.itemwidth,location.y+parent.itemheight
setpencolor(parent.bordercolor)
drawframe location.x,location.y to location.x+parent.itemwidth,location.y+parent.itemheight
print3d_margins = location.x+8, location.y to location.x+parent.itemwidth-8, location.y+parent.itemheight
print3d_attributes = parent.dropboxFont, parent.bordercolor,-8,1,1,0,0,0,1
}
print3d_position = location.x+8, location.y+3
print3d text
print3d_margins = 0,0 to 1024,768
}
}
@@ -0,0 +1,166 @@
#include "..\\content\\..\\Content\\..\\content\\..\\Content\\ShellScripts\\stddefs.h"
#DEFINE GRFPATH "Assets\\Graphics\\"
#DEFINE SNDPATH "Assets\\Sounds\\"
#DEFINE SCRIPTPATH "Assets\\Scripts\\"
#DEFINE CANCEL_ID 5
#DEFINE PROVIDER_COUNT 5
main
{
GUI_CREATE
{
object o_button[PROVIDER_COUNT + 1]=s_button
object i_cursor=s_cursor
sound press = SNDPATH "sfx_button5.wav"
assign 0, press
sound typing = SNDPATH "fx_button.wav"
assign 1, typing
font3d gFont3d= "arial.ttf"
string text[PROVIDER_COUNT + 1]
text[0] = "TCP/IP"
text[1] = "IPX"
text[2] = "SERIAL"
text[3] = "MODEM"
text[4] = "GUNTech"
text[5] = "CANCEL"
string which[PROVIDER_COUNT]
which[0] = SCRIPTPATH "NetworkTCPIP.script"
which[1] = SCRIPTPATH "NetworkIPX.script"
which[2] = SCRIPTPATH "NetworkSerial.script"
which[3] = SCRIPTPATH "NetworkModem.script"
which[4] = SCRIPTPATH "NetworkGunTech.script"
// construct service provider buttons
for(int i=0; i < PROVIDER_COUNT; i++)
{
$$CheckThisConnection$$ = i+1
callback($$IsConnectionAvailable$$)
if ($$Available$$==0)
{
o_button[i].greyed = 1
}
o_button[i].location=getresx()/2-20,getresy()/3+i*20,1
o_button[i].id = i
initialize(o_button[i])
}
// construct cancel button
o_button[PROVIDER_COUNT].location=getresx()/2-20,getresy()/3+7*20,1
o_button[PROVIDER_COUNT].id = PROVIDER_COUNT
initialize(o_button[PROVIDER_COUNT])
}
GUI_DRAW
{
setpencolor(0xff000000)
drawrect 0,0 to getresx(),getresy()
print3d_margins = 0,0 to getresx(), getresy();
print3d_attributes = gFont3d, 0xffffffff, 2,0,1,0,0
print3d_position = getresx()/2 - (getprint3dwidth("Generic Networking GUI"))/2,getresy()/5
print3d "Generic Networking GUI"
}
}
s_button
{
GUI_CREATE
{
int button_state = 0
int greyed = 0
int bcolor
int id= 1
region=0,0 to 64,16
framerate=1
}
GUI_INIT
{
if (!greyed)
bcolor = 0xff0000ff
else
bcolor = 0xff000040
}
REGION_ENTERED
{
if (!greyed)
bcolor = 0xff8080ff
}
REGION_EXITED
{
if (!greyed)
bcolor = 0xff0000ff
}
LBUTTON_UPDATE
{
if (!greyed)
{
if (mouse.left == BUTTON_PRESSED)
bcolor = 0xffa0a0ff
if (mouse.left == BUTTON_CLICKED)
{
play 0
// check if provider button or cancel button
if id==PROVIDER_COUNT
{
$$gConnectionType$$ = -1
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
$$gConnectionType$$ = id
script_run which[id], 0x1000
script_end
}
}
}
}
GUI_DRAW
{
setpencolor(bcolor)
ldrawrect region
print3d_margins = 0,0 to getresx(), getresy();
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
print3d_position =location.x+8, location.y+2
print3d text[id]
}
}
s_cursor
{
GUI_CREATE
{
pane_create pic=16,32,1,volatile
alphamode(pic)=am_alpha_alphainvalpha
bitmap bm=GRFPATH "mouse_pointer.tga"
blit bm,0,0 on pic
update(pic)
location=0,0,2
}
GUI_DRAW
{
render pic, mouse.x, mouse.y, 2
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,825 @@
#include "..\\content\\..\\Content\\..\\content\\..\\Content\\ShellScripts\\stddefs.h"
#DEFINE GRFPATH "Assets\\Graphics\\"
#DEFINE SNDPATH "Assets\\Sounds\\"
#DEFINE SCRIPTPATH "Assets\\Scripts\\"
#DEFINE FLASH_PLAYER 1
#DEFINE FLASH_GAME 2
#DEFINE FLASH_GAMELIST 3
#DEFINE FLASH_ADDRESS 4
#DEFINE FLASH_PASSWORD 5
#DEFINE WAIT_SELECTGAME 0
#DEFINE WAIT_PLAYERS 1
main
{
GUI_CREATE
{
callback ($$ConnectIPX$$)
if !$$Available$$
{
script_run SCRIPTPATH "Network.script",0x1000
script_end
return
}
else
{
int selected = 0
int flasharea = 0
int flashtimer = 0
int WaitStart = 0
$$GameName$$=""
object o_cursor=s_cursor
object o_gamelist=s_gamelist
object o_playerlist=s_playerlist
object o_playername=s_playername
object o_password=s_password
object o_gamename=s_gamename
font3d gFont3d= "arial.ttf"
object o_go=s_GoCancelButton
o_go.location=getresx()/2-128,getresy()-50,1
o_go.id = 0
object o_cancel=s_GoCancelButton
o_cancel.location=getresx()/2+64,getresy()-50,1
o_cancel.id = 1
object o_join=s_JoinCreateButton
o_join.location=getresx()/2-20,getresy()-105,1
o_join.id = 2
initialize(o_join)
object o_create=s_JoinCreateButton
o_create.location=getresx()/2-20,getresy()-80,1
o_create.id = 3
o_create.button_state = 1
initialize(o_create)
framerate=4
focus( o_playername )
}
}
GUI_DRAW
{
setpencolor(0xff000000)
drawrect 0,0 to 640,480
print3d_attributes = gFont3d, 0xffffffff, 2,0,1,0,0
print3d_position =200,100
if WaitStart==0
print3d "Create or Join an IPX Game"
if WaitStart==1
print3d " Wait for other players"
if WaitStart==2
print3d " Wait for game to start"
}
GUI_EXECUTE
{
if flasharea
{
if flashtimer++>3
flasharea=0
}
if WaitStart==2
{
if callback($$HasGameBegun$$)
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
}
}
}
s_gamelist
{
GUI_CREATE
{
region= 0,0 to 412,128
location = getresx()-448,getresy()/2-64,1
framerate=1
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
int yloc = mouse.y - location.y;
yloc -= 4
yloc /= 12
if yloc >= $$NumberOfGames$$
{
$$GameName$$ = ""
}
else
{
$$GameName$$ = $$ListOfGames$$[yloc]
}
}
}
}
GUI_DRAW
{
//
// Update the list of games
//
callback ($$UpdateGameList$$)
//
// Flahsing the game area to show no game selected?
//
if flasharea==FLASH_GAMELIST && flashtimer&1
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 128
ldrawrect 128, 0 to 320, 128
ldrawrect 320, 0 to 364, 128
ldrawrect 364, 0 to 380, 128
ldrawrect 380, 0 to 396, 128
ldrawrect 396, 0 to 412, 128
}
//
// Display the titles above the boxes
//
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
lprint3d_position = 4, -14
print3d "Available Games"
lprint3d_position = 134, -14
print3d "Description"
lprint3d_position = 322, -14
print3d "Players"
lprint3d_position = 369, -14
print3d "P"
lprint3d_position = 385, -14
print3d "L"
lprint3d_position = 400, -14
print3d "S"
//
// Draw box around names
//
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 128
//
// Draw game Info box
//
ldrawframe 128, 0 to 320, 128
//
// Draw box for players ( n/n )
//
ldrawframe 320, 0 to 364, 128
//
// Draw box for password
//
ldrawframe 364, 0 to 380, 128
//
// Draw box for locked
//
ldrawframe 380, 0 to 396, 128
//
// Draw box for encrypted
//
ldrawframe 396, 0 to 412, 128
//
// Display game information
//
lprint3d_margins = 0, 0 to 122, 126
if $$NumberOfGames$$
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1
for(int j = 0; j < $$NumberOfGames$$; j++)
{
if equal$( $$GameName$$, $$ListOfGames$$[j] ) // Current selected game?
{
setpencolor(0xff0000c0)
ldrawrect 4, 4+(j*12)-1 to 124, 4+(j*12)+12
ldrawrect 128+4, 4+(j*12)-1 to 320-3, 4+(j*12)+12
ldrawrect 320+2, 4+(j*12)-1 to 364-2, 4+(j*12)+12
ldrawrect 364+2, 4+(j*12)-1 to 380-2, 4+(j*12)+12
ldrawrect 380+2, 4+(j*12)-1 to 396-2, 4+(j*12)+12
ldrawrect 396+2, 4+(j*12)-1 to 412-2, 4+(j*12)+12
setpencolor(0xffffffff)
}
//
// Game Name
//
lprint3d_position = 8,4+(j*12)
print3d $$ListOfGames$$[j]
//
// Game description
//
lprint3d_position = 136,4+(j*12)
print3d $$ListOfDescriptions$$[j]
//
// Players and max players
//
lprint3d_position = 330,4+(j*12)
print3d $$ListOfNumPlayers$$[j]
//
// Passworded?
//
lprint3d_position = 370,4+(j*12)
print3d $$ListOfPassworded$$[j]
//
// Locked?
//
lprint3d_position = 386,4+(j*12)
print3d $$ListOfLocked$$[j]
//
// Secure?
//
lprint3d_position = 402,4+(j*12)
print3d $$ListOfSecure$$[j]
}
}
}
}
s_playerlist
{
GUI_CREATE
{
region = 0,0 to 128,128
location = 32,getresy()/2-64,1
framerate=1
}
GUI_DRAW
{
callback ($$UpdatePlayerList$$)
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
lprint3d_position = 4, -14
print3d "Players In Game"
lprint3d_margins = 0,0 to 122, 126
if !equal$( $$GameName$$ , "" )
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
for(int j = 0; j < $$NumberOfPlayers$$; j++)
{
lprint3d_position = 8,+4+(j*12)
print3d $$ListOfPlayers$$[j]
}
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 128
print3d_margins = 0,0 to getresx(),getresy()
}
}
//
//
// Mouse pointer
//
//
s_cursor
{
GUI_CREATE
{
pane_create pic=16,32,1,volatile
alphamode(pic)=am_alpha_alphainvalpha
bitmap bm=GRFPATH "mouse_pointer.tga"
blit bm,0,0 on pic
update(pic)
location=0,0,2
}
GUI_DRAW
{
render pic, mouse.x, mouse.y
}
}
//
//
// GO / START and CANCEL buttons
//
//
s_GoCancelButton
{
GUI_CREATE
{
int button_state = 0
int id
int bcolor = 0xff0000ff
region=0,0 to 64,16
}
REGION_ENTERED
{
bcolor = 0xff8080ff
}
REGION_EXITED
{
button_state = 0
bcolor = 0xff0000ff
}
LBUTTON_UPDATE
{
if mouse.left==BUTTON_PRESSED
{
//
// Pressed GO button?
//
if id==0
{
if 0==length$($$PlayerName$$)
button_state = 0
else
{
if o_create.button_state == 1 && 0==length$($$GameName$$)
{
button_state = 0
}
else
{
button_state = 1
}
}
}
else
button_state = 1
button_state = 0
bcolor = 0xffa0a0ff
}
if mouse.left==BUTTON_CLICKED
{
if id==0
{
play 0
//
// Clicked on the GO button when JOIN is active
//
if o_join.button_state==1
{
int error = callback($$JoinSelected$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
flasharea=FLASH_GAMELIST
if error==2
flasharea=FLASH_PLAYER
if error==5
flasharea=FLASH_PASSWORD
flashtimer=6
}
}
else
//
// Clicked on the GO button when CREATE is active
//
{
int error = callback($$CreateSession$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
flasharea=FLASH_GAME
if error==2
flasharea=FLASH_PLAYER
flashtimer=6
}
}
}
if id == 1
{
play 0
script_run SCRIPTPATH "Network.script",0x1000
callback($$Disconnect$$)
script_end
}
}
}
GUI_DRAW
{
if id==0
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,2
print3d "Start"
}
if id==1
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 14,2
print3d "Cancel"
}
}
}
s_JoinCreateButton
{
GUI_CREATE
{
int button_state = 0
pane_create pbutton=80,16,volatile
bitmap up_pic = GRFPATH "radio_up.bmp"
bitmap down_pic = GRFPATH "radio_down.bmp"
int id
region=up_pic
blit up_pic, 0,0 on pbutton
update(pbutton)
}
GUI_INIT
{
if button_state == 0
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
LBUTTON_UPDATE
{
if 0==WaitStart
{
if mouse.left==BUTTON_CLICKED
{
focus( o_playername )
if button_state == 0
{
button_state = 1
if id==2
{
play 0
o_create.button_state = 0
initialize(o_create)
if gotfocus(o_gamename)
{
focus( o_playername )
}
}
else if id==3
{
play 0
o_join.button_state = 0
initialize(o_join)
}
}
}
if button_state == 0
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
}
GUI_DRAW
{
if 0==WaitStart
{
render pbutton, location
if id==2
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,4
print3d "Join"
}
if id==3
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,4
print3d "Create"
}
}
}
}
s_playername
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if 0==WaitStart
{
if mouse.left==BUTTON_CLICKED
{
focus (this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09 && o_create.button_state == 1
{
focus( o_gamename )
}
else
{
if key == 0x08)
{
if length$($$PlayerName$$)
{
play 1
$$PlayerName$$ = left$($$PlayerName$$, length$($$PlayerName$$)-1)
}
}
else
{
if length$($$PlayerName$$) < 19
{
play 1
$$PlayerName$$ = $$PlayerName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PLAYER && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$PlayerName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,3
else
lprint3d_position = 6,3
print3d $$PlayerName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Your Name"
}
}
s_password
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-80,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_playername )
}
else
{
if key == 0x08
{
if length$($$Password$$)
{
play 1
$$Password$$ = left$($$Password$$, length$($$Password$$)-1)
}
}
else
{
if length$($$Password$$) < 19
{
play 1
$$Password$$ = $$Password$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PASSWORD && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$Password$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$Password$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Password"
}
}
s_gamename
{
GUI_CREATE
{
region = 0,0 to 128,16
location = getresx()-256,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if o_create.button_state == 1
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_password )
}
else
{
if key == 0x08
{
if length$($$GameName$$)
{
play 1
$$GameName$$ = left$($$GameName$$, length$($$GameName$$)-1)
}
}
else
{
if length$($$GameName$$) < 19
{
play 1
$$GameName$$ = $$GameName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if o_create.button_state == 1 && flasharea==FLASH_GAME && flashtimer&1
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 16
}
int col
if o_create.button_state == 1
col=0xffffffff
else
col=0xff404040
setpencolor(col)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, col, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$GameName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$GameName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, col, 1,0,1,1,0
print3d "Game Name"
}
}
@@ -0,0 +1,879 @@
#include "..\\content\\..\\Content\\..\\content\\..\\Content\\ShellScripts\\stddefs.h"
#DEFINE GRFPATH "Assets\\Graphics\\"
#DEFINE SNDPATH "Assets\\Sounds\\"
#DEFINE SCRIPTPATH "Assets\\Scripts\\"
#DEFINE FLASH_PLAYER 1
#DEFINE FLASH_GAME 2
#DEFINE FLASH_NUMBER 3
#DEFINE FLASH_ADDRESS 4
#DEFINE FLASH_PASSWORD 5
#DEFINE WAIT_SELECTGAME 0
#DEFINE WAIT_PLAYERS 1
#DEFINE WAIT_FINDGAME 3
#DEFINE WAIT_DIALING 4
#include SCRIPTPATH "Dropboxes.script"
main
{
GUI_CREATE
{
callback ($$UpdateModemList$$)
font3d gFont3d= "arial.ttf"
int flasharea = 0
int flashtimer = 0
int connecting = 0
int WaitStart = WAIT_SELECTGAME
object o_cursor=s_cursor
object o_playername=s_PlayerName
object o_password=s_password
object o_gamename=s_GameName
object o_phonenumber=s_phonenumber
object o_go=s_GoCancelButton
o_go.location=getresx()/2-128,getresy()-50,1
o_go.id = 0
object o_cancel=s_GoCancelButton
o_cancel.location=getresx()/2+64,getresy()-50,1
o_cancel.id = 1
object o_join=s_JoinCreateButton
o_join.location=getresx()/2-20,getresy()-105,1
o_join.id = 2
initialize(o_join)
object o_create=s_JoinCreateButton
o_create.location=getresx()/2-20,getresy()-80,1
o_create.id = 3
o_create.button_state = 1
initialize(o_create)
framerate=4
object o_dropbox = s_simpledropbox
o_dropbox.Name = "Modem"
o_dropbox.location = getresx()/2-68,getresy()/2-48,1
o_dropbox.total_items = $$NumberOfModems$$
o_dropbox.selected = $$CurrentModem$$
for( int t0=0; t0<$$NumberOfModems$$; t0++ )
{
o_dropbox.o_dropitem[t0] = s_dropitem
o_dropbox.o_dropitem[t0].text = $$ListOfModems$$[t0]
}
initialize(o_dropbox)
focus( o_playername )
}
GUI_EXECUTE
{
if flasharea
{
flashtimer--
if( flashtimer<0 )
flasharea=0
}
if WaitStart==WAIT_DIALING
{
int error = callback($$JoinSelected$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
callback($$Disconnect$$)
if error==2
{
flasharea=FLASH_PLAYER // Duplicate player name
flashtimer=6
}
if error==3
{
WaitStart=WAIT_SELECTGAME // Error
}
if error==4
{
WaitStart=WAIT_SELECTGAME // No dial tone
}
}
}
if WaitStart==WAIT_FINDGAME
{
int error = callback($$CreateSession$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
callback($$Disconnect$$)
if error==1
{
flasharea=FLASH_GAME
flashtimer=6
}
if error==2
{
flasharea=FLASH_PLAYER
flashtimer=6
}
if error==3
{
WaitStart=WAIT_SELECTGAME
}
if error==4
{
WaitStart=WAIT_SELECTGAME // No dial tone
}
}
}
}
GUI_DRAW
{
setpencolor(0xff000000)
drawrect 0,0 to getresx(),getresy()
print3d_attributes = gFont3d, 0xffffffff, 2,0,1,0,0
print3d_position =getresx()/2 - getprint3dwidth("Create or Join a MODEM Game")/2,100
if WaitStart==0
print3d "Create or Join a MODEM Game"
if WaitStart==WAIT_PLAYERS
print3d " Waiting for other players"
if WaitStart==WAIT_FINDGAME
print3d " Waiting for call"
if WaitStart==WAIT_DIALING
print3d " Dialing and Connecting"
}
}
//
// The mouse cursor
//
s_cursor
{
GUI_CREATE
{
pane_create pic=16,32,1,volatile
alphamode(pic)=am_alpha_alphainvalpha
bitmap bm=GRFPATH "mouse_pointer.tga"
blit bm,0,0 on pic
update(pic)
location=0,0,2
}
GUI_DRAW
{
render pic, mouse.x, mouse.y
}
}
//
//
// The Go and Cancel buttons
//
//
s_GoCancelButton
{
GUI_CREATE
{
int button_state = 0
int id
int bcolor = 0xff0000ff
region=0,0 to 64,16
}
REGION_ENTERED
{
bcolor = 0xff8080ff
}
REGION_EXITED
{
button_state = 0
bcolor = 0xff0000ff
}
LBUTTON_UPDATE
{
if mouse.left == BUTTON_PRESSED
{
//
// Pressed GO button?
//
if id == 0
{
if 0==length$($$PlayerName$$)
button_state = 0
else
{
if o_create.button_state == 1 && 0==length$($$GameName$$)
{
button_state = 0
}
else
{
button_state = 1
}
}
}
else
button_state = 1
button_state = 0
bcolor = 0xffa0a0ff
}
if mouse.left == BUTTON_CLICKED
{
unfocus
if id == 0 && WaitStart!=WAIT_DIALING
{
play 0
//
// Clicked on the GO button when JOIN is active
//
if o_join.button_state==1
{
if 0==length$($$PhoneNumber$$)
{
flasharea=FLASH_NUMBER
flashtimer=6
}
else
{
$$CurrentModem$$=o_dropbox.selected
int error = callback($$JoinModemGame$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
if error==1
{
WaitStart=WAIT_DIALING
}
else
{
callback($$Disconnect$$)
flasharea=FLASH_PLAYER
flashtimer=6
}
}
}
}
else
//
// Clicked on the GO button when CREATE is active
//
{
$$CurrentModem$$=o_dropbox.selected
int error = callback($$HostModemGame$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
if error==4
{
WaitStart=WAIT_FINDGAME
}
else
{
if error==1
flasharea=FLASH_GAME
if error==2
flasharea=FLASH_PLAYER
if error==5
flasharea=FLASH_PASSWORD
flashtimer=6
callback($$Disconnect$$)
}
}
}
}
if id == 1
{
play 0
if WaitStart==WAIT_FINDGAME || WaitStart==WAIT_DIALING
{
callback($$Disconnect$$)
WaitStart=WAIT_SELECTGAME
}
else
{
script_run SCRIPTPATH "Network.script",0x1000
callback($$Disconnect$$)
script_end
}
}
}
}
GUI_DRAW
{
if id==0 && WaitStart!=WAIT_DIALING
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,2
print3d "Start"
}
if id == 1
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 14,2
print3d "Cancel"
}
}
}
//
//
// The Join and Create radio buttons
//
//
s_JoinCreateButton
{
GUI_CREATE
{
int button_state = 0
pane_create pbutton=80,16,1,volatile
bitmap up_pic = GRFPATH "radio_up.bmp"
bitmap down_pic = GRFPATH "radio_down.bmp"
int id
region=up_pic
blit up_pic, 0,0 on pbutton
update(pbutton)
}
GUI_INIT
{
if (button_state == 0)
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
LBUTTON_UPDATE
{
if (mouse.left == BUTTON_CLICKED)
{
focus( o_playername )
if WaitStart==WAIT_DIALING || WaitStart==WAIT_FINDGAME
{
callback($$Disconnect$$)
WaitStart=WAIT_SELECTGAME
}
if (button_state == 0)
{
button_state = 1
if (id == 2)
{
play 0
o_create.button_state = 0
initialize(o_create)
}
else if (id == 3)
{
play 0
o_join.button_state = 0
initialize(o_join)
}
}
}
if (button_state == 0)
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
GUI_DRAW
{
render pbutton, location
if id==2
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
print3d_position = 316,375
print3d "Join"
}
if id==3
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
print3d_position = 316,400
print3d "Create"
}
}
}
//
//
// The edit box for the player name
//
//
s_playername
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left==BUTTON_CLICKED
{
focus (this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
if( o_create.button_state == 1 )
{
focus( o_gamename )
}
else
{
focus( o_phonenumber )
}
}
else
{
if key == 0x08)
{
if length$($$PlayerName$$)
{
play 1
$$PlayerName$$ = left$($$PlayerName$$, length$($$PlayerName$$)-1)
}
}
else
{
if length$($$PlayerName$$) < 19
{
play 1
$$PlayerName$$ = $$PlayerName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PLAYER && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$PlayerName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,3
else
lprint3d_position = 6,3
print3d $$PlayerName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Your Name"
}
}
//
//
// The edit box for the game name
//
//
s_gamename
{
GUI_CREATE
{
region = 0,0 to 128,16
location = getresx()-256,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if o_create.button_state == 1
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_password )
}
else
{
if key == 0x08
{
if length$($$GameName$$)
{
play 1
$$GameName$$ = left$($$GameName$$, length$($$GameName$$)-1)
}
}
else
{
if length$($$GameName$$) < 19
{
play 1
$$GameName$$ = $$GameName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if o_create.button_state == 1 && flasharea==FLASH_GAME && flashtimer&1
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 16
}
int col
if o_create.button_state == 1
col=0xffffffff
else
col=0xff404040
setpencolor(col)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, col, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$GameName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$GameName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, col, 1,0,1,1,0
print3d "Game Name"
}
}
s_password
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-80,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_playername )
}
else
{
if key == 0x08
{
if length$($$Password$$)
{
play 1
$$Password$$ = left$($$Password$$, length$($$Password$$)-1)
}
}
else
{
if length$($$Password$$) < 19
{
play 1
$$Password$$ = $$Password$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PASSWORD && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$Password$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$Password$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Password"
}
}
//
//
// The edit box for the phone number
//
//
s_phonenumber
{
GUI_CREATE
{
region = 0,0 to 128,16
location = getresx()-256,getresy()-80,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if o_create.button_state == 0
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_password )
}
else
{
if key == 0x08
{
if length$($$PhoneNumber$$)
{
play 1
$$PhoneNumber$$ = left$($$PhoneNumber$$, length$($$PhoneNumber$$)-1)
}
}
else
{
if length$($$PhoneNumber$$) < 19
{
play 1
$$PhoneNumber$$ = $$PhoneNumber$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if o_create.button_state == 0 && flasharea==FLASH_NUMBER && flashtimer&1
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 16
}
int col
if o_create.button_state == 0
col=0xffffffff
else
col=0xff404040
setpencolor(col)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, col, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$PhoneNumber$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$PhoneNumber$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, col, 1,0,1,1,0
print3d "Phone Number"
}
}
@@ -0,0 +1,720 @@
#include "..\\content\\..\\Content\\..\\content\\..\\Content\\ShellScripts\\stddefs.h"
#DEFINE GRFPATH "Assets\\Graphics\\"
#DEFINE SNDPATH "Assets\\Sounds\\"
#DEFINE SCRIPTPATH "Assets\\Scripts\\"
#DEFINE FLASH_PLAYER 1
#DEFINE FLASH_GAME 2
#DEFINE FLASH_ADDRESS 4
#DEFINE FLASH_PASSWORD 5
#DEFINE WAIT_SELECTGAME 0
#DEFINE WAIT_PLAYERS 1
#DEFINE WAIT_TOSTART 2
#DEFINE WAIT_FINDGAME 3
#include SCRIPTPATH "Dropboxes.script"
main
{
GUI_CREATE
{
callback ($$UpdateSerialPortList$$)
int flasharea = 0
int flashtimer = 0
int connecting = 0
int WaitStart = WAIT_SELECTGAME
object o_cursor=s_cursor
object o_playername=s_PlayerName
object o_password=s_password
object o_gamename=s_GameName
font3d gFont3d= "arial.ttf"
object o_go=s_GoCancelButton
o_go.location=getresx()/2-128,getresy()-50,1
o_go.id = 0
object o_cancel=s_GoCancelButton
o_cancel.location=getresx()/2+64,getresy()-50,1
o_cancel.id = 1
object o_join=s_JoinCreateButton
o_join.location=getresx()/2-20,getresy()-105,1
o_join.id = 2
initialize(o_join)
object o_create=s_JoinCreateButton
o_create.location=getresx()/2-20,getresy()-80,1
o_create.id = 3
o_create.button_state = 1
initialize(o_create)
framerate=4
object o_dropbox = s_simpledropbox
o_dropbox.Name = "Serial Port"
o_dropbox.location = getresx()/2-68,getresy()/2-48,1
o_dropbox.total_items = $$NumberOfSerialPorts$$
o_dropbox.selected = $$CurrentSerialPort$$
for( int t0=0; t0<$$NumberOfSerialPorts$$; t0++ )
{
o_dropbox.o_dropitem[t0] = s_dropitem
o_dropbox.o_dropitem[t0].text = $$ListOfSerialPorts$$[t0]
}
initialize(o_dropbox)
focus( o_playername )
}
GUI_EXECUTE
{
if flasharea
{
flashtimer--
if( flashtimer<0 )
flasharea=0
}
if WaitStart==WAIT_FINDGAME
{
int error = callback($$JoinSelected$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
callback($$Disconnect$$)
if error==2
{
flasharea=FLASH_PLAYER
flashtimer=6
}
if error==3
{
WaitStart=WAIT_SELECTGAME
}
}
}
}
GUI_DRAW
{
setpencolor(0xff000000)
drawrect 0,0 to getresx(),getresy()
print3d_attributes = gFont3d, 0xffffffff, 2,0,1,0,0
print3d_position =getresx()/2 - getprint3dwidth("Create or Join a SERIAL Game")/2,100
if WaitStart==0
print3d "Create or Join a SERIAL Game"
if WaitStart==WAIT_PLAYERS
print3d " Waiting for other players"
if WaitStart==WAIT_FINDGAME
print3d " Searching for serial game"
}
}
//
// The mouse cursor
//
s_cursor
{
GUI_CREATE
{
pane_create pic=16,32,1,volatile
alphamode(pic)=am_alpha_alphainvalpha
bitmap bm=GRFPATH "mouse_pointer.tga"
blit bm,0,0 on pic
update(pic)
location=0,0,2
}
GUI_DRAW
{
render pic, mouse.x, mouse.y
}
}
//
//
// The Go and Cancel buttons
//
//
s_GoCancelButton
{
GUI_CREATE
{
int button_state = 0
int id
int bcolor = 0xff0000ff
region=0,0 to 64,16
}
REGION_ENTERED
{
bcolor = 0xff8080ff
}
REGION_EXITED
{
button_state = 0
bcolor = 0xff0000ff
}
LBUTTON_UPDATE
{
if mouse.left == BUTTON_PRESSED
{
//
// Pressed GO button?
//
if id == 0
{
if 0==length$($$PlayerName$$)
button_state = 0
else
{
if o_create.button_state == 1 && 0==length$($$GameName$$)
{
button_state = 0
}
else
{
button_state = 1
}
}
}
else
button_state = 1
button_state = 0
bcolor = 0xffa0a0ff
}
if mouse.left == BUTTON_CLICKED
{
unfocus
if id == 0 && WaitStart!=WAIT_FINDGAME
{
play 0
//
// Clicked on the GO button when JOIN is active
//
if o_join.button_state==1
{
$$CurrentSerialPort$$=o_dropbox.selected
callback ($$ConnectSerialPort$$)
if !$$Available$$
{
script_run SCRIPTPATH "Network.script",0x1000
script_end
return
}
int error = callback($$JoinSelected$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
if error==1
{
WaitStart=WAIT_FINDGAME
}
else
{
callback($$Disconnect$$)
flasharea=FLASH_PLAYER
flashtimer=6
}
}
}
else
//
// Clicked on the GO button when CREATE is active
//
{
$$CurrentSerialPort$$=o_dropbox.selected
callback ($$ConnectSerialPort$$)
if !$$Available$$
{
callback($$Disconnect$$)
script_run SCRIPTPATH "Network.script",0x1000
script_end
return
}
int error = callback($$CreateSession$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
if error==1
flasharea=FLASH_GAME
if error==2
flasharea=FLASH_PLAYER
if error==5
flasharea=FLASH_PASSWORD
flashtimer=6
callback($$Disconnect$$)
}
}
}
if id == 1
{
play 0
if WaitStart==WAIT_FINDGAME
{
callback($$Disconnect$$)
WaitStart=WAIT_SELECTGAME
}
else
{
script_run SCRIPTPATH "Network.script",0x1000
callback($$Disconnect$$)
script_end
}
}
}
}
GUI_DRAW
{
if id==0
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,2
print3d "Start"
}
if id == 1
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 14,2
print3d "Cancel"
}
}
}
//
//
// The Join and Create radio buttons
//
//
s_JoinCreateButton
{
GUI_CREATE
{
int button_state = 0
pane_create pbutton=80,16,1,volatile
bitmap up_pic = GRFPATH "radio_up.bmp"
bitmap down_pic = GRFPATH "radio_down.bmp"
int id
region=up_pic
blit up_pic, 0,0 on pbutton
update(pbutton)
}
GUI_INIT
{
if (button_state == 0)
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
LBUTTON_UPDATE
{
if (mouse.left == BUTTON_CLICKED)
{
if WaitStart==WAIT_FINDGAME
{
callback($$Disconnect$$)
WaitStart=WAIT_SELECTGAME
}
focus( o_playername )
if (button_state == 0)
{
button_state = 1
if (id == 2)
{
play 0
o_create.button_state = 0
initialize(o_create)
}
else if (id == 3)
{
play 0
o_join.button_state = 0
initialize(o_join)
}
}
}
if (button_state == 0)
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
GUI_DRAW
{
render pbutton, location
if id==2
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
print3d_position = 316,375
print3d "Join"
}
if id==3
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
print3d_position = 316,400
print3d "Create"
}
}
}
//
//
// The edit box for the player name
//
//
s_playername
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left==BUTTON_CLICKED
{
focus (this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
if( o_create.button_state == 1 )
{
focus( o_gamename )
}
else
{
focus( o_password )
}
}
else
{
if key == 0x08)
{
if length$($$PlayerName$$)
{
play 1
$$PlayerName$$ = left$($$PlayerName$$, length$($$PlayerName$$)-1)
}
}
else
{
if length$($$PlayerName$$) < 19
{
play 1
$$PlayerName$$ = $$PlayerName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PLAYER && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$PlayerName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,3
else
lprint3d_position = 6,3
print3d $$PlayerName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Your Name"
}
}
s_password
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-80,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_playername )
}
else
{
if key == 0x08
{
if length$($$Password$$)
{
play 1
$$Password$$ = left$($$Password$$, length$($$Password$$)-1)
}
}
else
{
if length$($$Password$$) < 19
{
play 1
$$Password$$ = $$Password$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PASSWORD && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$Password$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$Password$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Password"
}
}
//
//
// The edit box for the game name
//
//
s_gamename
{
GUI_CREATE
{
region = 0,0 to 128,16
location = getresx()-256,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if o_create.button_state == 1
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_password )
}
else
{
if key == 0x08
{
if length$($$GameName$$)
{
play 1
$$GameName$$ = left$($$GameName$$, length$($$GameName$$)-1)
}
}
else
{
if length$($$GameName$$) < 19
{
play 1
$$GameName$$ = $$GameName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if o_create.button_state == 1
{
if flasharea==FLASH_GAME && flashtimer&1
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$GameName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$GameName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Game Name"
}
}
}
@@ -0,0 +1,984 @@
#include "..\\content\\..\\Content\\..\\content\\..\\Content\\ShellScripts\\stddefs.h"
#DEFINE GRFPATH "Assets\\Graphics\\"
#DEFINE SNDPATH "Assets\\Sounds\\"
#DEFINE SCRIPTPATH "Assets\\Scripts\\"
#DEFINE FLASH_PLAYER 1
#DEFINE FLASH_GAME 2
#DEFINE FLASH_GAMELIST 3
#DEFINE FLASH_ADDRESS 4
#DEFINE FLASH_PASSWORD 5
#DEFINE WAIT_SELECTGAME 0
#DEFINE WAIT_PLAYERS 1
main
{
GUI_CREATE
{
callback ($$ConnectTCP$$)
if !$$Available$$
{
script_run SCRIPTPATH "Network.script",0x1000
script_end
return
}
else
{
int selected = 0
int flasharea = 0
int flashtimer = 0
int invalidServer = 0
int WaitStart = WAIT_SELECTGAME
$$GameName$$=""
object o_cursor=s_cursor
object o_gamelist=s_gamelist
object o_playerlist=s_playerlist
object o_playername=s_playername
object o_gamename=s_gamename
object o_password=s_password
object o_serveraddress=s_serveraddress
font3d gFont3d= "arial.ttf"
object o_go=s_GoCancelButton
o_go.location=getresx()/2-128,getresy()-50,1
o_go.id = 0
object o_cancel=s_GoCancelButton
o_cancel.location=getresx()/2+64,getresy()-50,1
o_cancel.id = 1
object o_join=s_JoinCreateButton
o_join.location=getresx()/2-20,getresy()-105,1
o_join.id = 2
initialize(o_join)
object o_create=s_JoinCreateButton
o_create.location=getresx()/2-20,getresy()-80,1
o_create.id = 3
o_create.button_state = 1
initialize(o_create)
framerate=4
focus( o_playername )
}
}
GUI_DRAW
{
setpencolor(0xff000000)
drawrect 0,0 to getresx(),getresy()
print3d_attributes = gFont3d, 0xffffffff, 2,0,1,0,0
print3d_position =getresx()/2 - getprint3dwidth("Create or Join a TCPIP Game")/2,100
if WaitStart==WAIT_SELECTGAME
print3d "Create or Join a TCPIP Game"
if WaitStart==WAIT_PLAYERS
print3d " Waiting for other players"
}
GUI_EXECUTE
{
if flasharea
{
flashtimer--
if( flashtimer<0 )
flasharea=0
}
}
}
s_gamelist
{
GUI_CREATE
{
region= 0,0 to 412,128
location = getresx()-448,getresy()/2-64,1
framerate=1
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
int yloc = mouse.y - location.y;
yloc -= 4
yloc /= 12
if yloc >= $$NumberOfGames$$
{
$$GameName$$ = ""
}
else
{
$$GameName$$ = $$ListOfGames$$[yloc]
}
}
}
}
GUI_DRAW
{
//
// Update the list of games
//
callback ($$UpdateGameList$$)
//
// Flahsing the game area to show no game selected?
//
if flasharea==FLASH_GAMELIST && flashtimer&1
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 128
ldrawrect 128, 0 to 320, 128
ldrawrect 320, 0 to 364, 128
ldrawrect 364, 0 to 380, 128
ldrawrect 380, 0 to 396, 128
ldrawrect 396, 0 to 412, 128
}
//
// Display the titles above the boxes
//
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
lprint3d_position = 4, -14
print3d "Available Games"
lprint3d_position = 134, -14
print3d "Description"
lprint3d_position = 322, -14
print3d "Players"
lprint3d_position = 369, -14
print3d "P"
lprint3d_position = 385, -14
print3d "L"
lprint3d_position = 400, -14
print3d "S"
//
// Draw box around names
//
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 128
//
// Draw game Info box
//
ldrawframe 128, 0 to 320, 128
//
// Draw box for players ( n/n )
//
ldrawframe 320, 0 to 364, 128
//
// Draw box for password
//
ldrawframe 364, 0 to 380, 128
//
// Draw box for locked
//
ldrawframe 380, 0 to 396, 128
//
// Draw box for encrypted
//
ldrawframe 396, 0 to 412, 128
//
// Display game information
//
lprint3d_margins = 0, 0 to 122, 126
if $$NumberOfGames$$
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1
for(int j = 0; j < $$NumberOfGames$$; j++)
{
if equal$( $$GameName$$, $$ListOfGames$$[j] ) // Current selected game?
{
setpencolor(0xff0000c0)
ldrawrect 4, 4+(j*12)-1 to 124, 4+(j*12)+12
ldrawrect 128+4, 4+(j*12)-1 to 320-3, 4+(j*12)+12
ldrawrect 320+2, 4+(j*12)-1 to 364-2, 4+(j*12)+12
ldrawrect 364+2, 4+(j*12)-1 to 380-2, 4+(j*12)+12
ldrawrect 380+2, 4+(j*12)-1 to 396-2, 4+(j*12)+12
ldrawrect 396+2, 4+(j*12)-1 to 412-2, 4+(j*12)+12
setpencolor(0xffffffff)
}
//
// Game Name
//
lprint3d_position = 8,4+(j*12)
print3d $$ListOfGames$$[j]
//
// Game description
//
lprint3d_position = 136,4+(j*12)
print3d $$ListOfDescriptions$$[j]
//
// Players and max players
//
lprint3d_position = 330,4+(j*12)
print3d $$ListOfNumPlayers$$[j]
//
// Passworded?
//
lprint3d_position = 370,4+(j*12)
print3d $$ListOfPassworded$$[j]
//
// Locked?
//
lprint3d_position = 386,4+(j*12)
print3d $$ListOfLocked$$[j]
//
// Secure?
//
lprint3d_position = 402,4+(j*12)
print3d $$ListOfSecure$$[j]
}
}
}
}
s_playerlist
{
GUI_CREATE
{
region = 0,0 to 128,128
location = 32,getresy()/2-64,1
framerate=1
}
GUI_DRAW
{
callback ($$UpdatePlayerList$$)
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
lprint3d_position = 4, -14
print3d "Players In Game"
lprint3d_margins = 0,0 to 122, 126
if !equal$( $$GameName$$ , "" )
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
for(int j = 0; j < $$NumberOfPlayers$$; j++)
{
lprint3d_position = 8,+4+(j*12)
print3d $$ListOfPlayers$$[j]
}
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 128
print3d_margins = 0,0 to getresx(),getresy()
}
}
//
//
// Mouse pointer
//
//
s_cursor
{
GUI_CREATE
{
pane_create pic=16,32,1,volatile
alphamode(pic)=am_alpha_alphainvalpha
bitmap bm=GRFPATH "mouse_pointer.tga"
blit bm,0,0 on pic
update(pic)
location=0,0,2
}
GUI_DRAW
{
render pic, mouse.x, mouse.y
}
}
//
//
// GO / START and CANCEL buttons
//
//
s_GoCancelButton
{
GUI_CREATE
{
int button_state = 0
int id
int bcolor = 0xff0000ff
region=0,0 to 64,16
}
REGION_ENTERED
{
bcolor = 0xff8080ff
}
REGION_EXITED
{
button_state = 0
bcolor = 0xff0000ff
}
LBUTTON_UPDATE
{
if mouse.left == BUTTON_PRESSED
{
//
// Pressed GO button?
//
if id == 0
{
if 0==length$($$PlayerName$$)
button_state = 0
else
{
if o_create.button_state == 1 && 0==length$($$GameName$$)
{
button_state = 0
}
else
{
button_state = 1
}
}
}
else
button_state = 1
button_state = 0
bcolor = 0xffa0a0ff
}
if mouse.left == BUTTON_CLICKED
{
if id == 0
{
play 0
//
// Clicked on the GO button when JOIN is active
//
if o_join.button_state==1
{
int error=callback($$JoinSelected$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
flasharea=FLASH_GAMELIST
if error==2
flasharea=FLASH_PLAYER
if error==5
flasharea=FLASH_PASSWORD
flashtimer=6
}
}
else
//
// Clicked on the GO button when CREATE is active
//
{
int error = callback($$CreateSession$$)
if error==0
{
callback($$SetShellCommand$$, END_NETWORK_STARTUP_SHELL_COMMAND)
script_end
}
else
{
flasharea=FLASH_GAME
if error==2
flasharea=FLASH_PLAYER
flashtimer=6
}
}
}
if id == 1
{
play 0
script_run SCRIPTPATH "Network.script",0x1000
callback($$Disconnect$$)
script_end
}
}
}
GUI_DRAW
{
if id==0
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,2
print3d "Start"
}
if id==1
{
setpencolor(bcolor)
ldrawrect region
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 14,2
print3d "Cancel"
}
}
}
s_JoinCreateButton
{
GUI_CREATE
{
int button_state = 0
pane_create pbutton=80,16,volatile
bitmap up_pic = GRFPATH "radio_up.bmp"
bitmap down_pic = GRFPATH "radio_down.bmp"
int id
region=up_pic
blit up_pic, 0,0 on pbutton
update(pbutton)
}
GUI_INIT
{
if button_state == 0
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus( o_playername )
if button_state == 0
{
button_state = 1
if (id == 2) // Selected CREATE button
{
play 0
o_create.button_state = 0
if length$($$ServerIPAddress$$) // If a server IP address was in use, clear it
{
invalidServer=0
$$ServerIPAddress$$=""
callback($$Disconnect$$)
callback($$ConnectTCP$$)
}
initialize(o_create)
if gotfocus(o_gamename)
{
focus( o_playername )
}
}
else if (id == 3)
{
play 0
o_join.button_state = 0
initialize(o_join)
if gotfocus(o_serveraddress)
{
focus( o_playername )
}
}
}
}
if button_state == 0
blit up_pic, 0,0 on pbutton
else
blit down_pic,0,0 on pbutton location
update(pbutton);
}
}
GUI_DRAW
{
if WaitStart==WAIT_SELECTGAME
{
render pbutton, location
if id == 2
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,4
print3d "Join"
}
if id == 3
{
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0
lprint3d_position = 16,4
print3d "Create"
}
}
}
}
s_playername
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left==BUTTON_CLICKED
{
focus (this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
if( o_create.button_state == 1 )
{
focus( o_gamename )
}
else
{
invalidServer=0
focus( o_serveraddress )
}
}
else
{
if key == 0x08)
{
if length$($$PlayerName$$)
{
play 1
$$PlayerName$$ = left$($$PlayerName$$, length$($$PlayerName$$)-1)
}
}
else
{
if length$($$PlayerName$$) < 19
{
play 1
$$PlayerName$$ = $$PlayerName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PLAYER && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$PlayerName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,3
else
lprint3d_position = 6,3
print3d $$PlayerName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Your Name"
}
}
s_gamename
{
GUI_CREATE
{
region = 0,0 to 128,16
location = getresx()-256,getresy()-130,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if o_create.button_state == 1
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_password )
}
else
{
if key == 0x08
{
if length$($$GameName$$)
{
play 1
$$GameName$$ = left$($$GameName$$, length$($$GameName$$)-1)
}
}
else
{
if length$($$GameName$$) < 19
{
play 1
$$GameName$$ = $$GameName$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if o_create.button_state == 1 && flasharea==FLASH_GAME && flashtimer&1
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 16
}
int col
if o_create.button_state == 1
col=0xffffffff
else
col=0xff404040
setpencolor(col)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, col, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$GameName$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$GameName$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, col, 1,0,1,1,0
print3d "Game Name"
}
}
s_password
{
GUI_CREATE
{
region = 0,0 to 128,16
location = 128,getresy()-80,1
framerate = 4
int draw_caret = 0
}
LBUTTON_UPDATE
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_playername )
}
else
{
if key == 0x08
{
if length$($$Password$$)
{
play 1
$$Password$$ = left$($$Password$$, length$($$Password$$)-1)
}
}
else
{
if length$($$Password$$) < 19
{
play 1
$$Password$$ = $$Password$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if flasharea==FLASH_PASSWORD && flashtimer&1
{
setpencolor(0xffff0000)
drawrect location.x, location.y to location.x+128, location.y+16
}
setpencolor(0xffffffff)
ldrawframe 0, 0 to 128, 16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_margins = 6, 0 to 126, 16
int beyond = 12+getprint3dwidth($$Password$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,+3
else
lprint3d_position = 6,3
print3d $$Password$$
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,1,0
print3d "Password"
}
}
//
// Server address - this is only available during JOIN game.
//
// The user can enter a web url or IP address that will be used to look for games
//
s_serveraddress
{
GUI_CREATE
{
region = 0,0 to 128,16
location = getresx()-256,getresy()-80,1
framerate = 4
int draw_caret = 0
int updated = 0
}
LBUTTON_UPDATE
{
if o_create.button_state != 1
{
if WaitStart==WAIT_SELECTGAME
{
if mouse.left == BUTTON_CLICKED
{
focus(this)
invalidServer=0
}
}
}
}
GUI_EXECUTE
{
if gotfocus(this)
draw_caret = !draw_caret
else
draw_caret = 0
}
GUI_UNFOCUS
{
if updated
{
updated = 0
callback($$Disconnect$$)
callback($$ConnectTCP$$)
if $$Available$$
invalidServer=0
else
invalidServer=1
}
}
GUI_CHAR
{
int key = getchar()
if key == char("\n")
{
focus( NULL )
}
else
{
if key == 0x09
{
focus( o_password )
}
else
{
if key == 0x08
{
if length$($$ServerIPAddress$$)
{
updated = 1
play 1
$$ServerIPAddress$$ = left$($$ServerIPAddress$$, length$($$ServerIPAddress$$)-1)
}
}
else
{
if length$($$ServerIPAddress$$) < 19
{
updated = 1
play 1
$$ServerIPAddress$$ = $$ServerIPAddress$$ chr$(key)
}
}
}
}
}
GUI_DRAW
{
if o_create.button_state != 1 && invalidServer
{
setpencolor(0xffff0000)
ldrawrect 0, 0 to 128, 16
}
int col
int DimColor
if o_create.button_state != 1
{
col=0xffffffff
DimColor=0xff808080
}
else
{
col=0xff404040
DimColor=0xff202020
}
setpencolor(col)
ldrawframe region
print3d_attributes = gFont3d, col, 1,0,1,0,0,0,1 // Ignore embedded codes!
lprint3d_position = 6,3
lprint3d_margins = 6, 0 to 126, 16
if( length$($$ServerIPAddress$$) = 0 && !gotfocus(this) )
{
print3d_attributes = gFont3d, DimColor, 1,0,1,0,0
print3d " -Browse Local Net-"
}
else
{
print3d_attributes = gFont3d, col, 1,0,1,0,0,0,1 // Ignore embedded codes!
int beyond = 12+getprint3dwidth($$ServerIPAddress$$) - (region.p2.x)
if (beyond > 0 && gotfocus(this))
lprint3d_position = -beyond,3
else
lprint3d_position = 6, 3
print3d $$ServerIPAddress$$
}
if draw_caret && gotfocus(this)
{
print3d "|"
}
print3d_margins = 0,0 to getresx(),getresy()
lprint3d_position = 0,-16
print3d_attributes = gFont3d, col, 1,0,1,1,0
print3d "Server Address"
}
}