#include "Content\\ShellScripts\\stddefs.h" #include "Content\\ShellScripts\\ScriptStrings.h" #include "Content\\ShellScripts\\buttons.script" #include "Content\\ShellScripts\\ErrorScreen.script" #include "Content\\ShellScripts\\common_shell.script" // jcem //#include "Content\\ShellScripts\\MechLabHeaders.h" #define ALPHA_MIN 0 #define ALPHA_DEC 15 // fade out deccrement down to ALPHA_MIN #define ALPHA_INIT_VALUE 5 // should be between ALPHA_MIN < & < ALPHA_MAX #define ALPHA_INC 15 // fade in incrementsupward ALPHA_MAX #define ALPHA_MAX 120 // #define RANK_MAXLOOPS 10 #define TITLE_HEIGHT 28 #define TITLE_GAPY 9 #define RANK_YSTART 220 #define RANK_LMARGIN 160 #define RANK_RMARGIN (160 - 30) #define RANK_TOTALX (800 - RANK_LMARGIN - RANK_RMARGIN) #define RANK_H_THICK 4 #define RANK_H_THIN 2 #define RANK_T_HEIGHT 20 #define RANK_L_HEIGHT 20 #define NAME_TIME_HEIGHT 60 // 60 pixel high #define MAX_IDLE 15000 #define MAX_IDLE2 10000 main { GUI_CREATE { //Makes the connection to the string table .dll //Requires the #include "Content\\ShellScripts\\ScriptStrings.h" in every script with localizable text setresource("ScriptStrings.dll") location = 0, 0, 10000 if callback($$CTCL_CheckUseJPD$$) setpointer(0) object screen = o_QNet_Screen initialize(screen) focus(screen.o_fscreen) mail(25, @shell@volumn_control) } GUI_DESTROY { } } o_QNet_Screen { GUI_CREATE { int nTimeCutOFF int nTime_Quit = MAX_IDLE int nTime_Left = -1 int nTime_Cur // temp value nTimeCutOFF = gettimex() + nTime_Quit framerate=10 sound sndOpenPanel = SPATH "sfx_vtol_drop.wav" // sfx_turret_actuator.wav play sndOpenPanel, 1 callback($$CTCL_SetDispStateCOOP$$, 0, 1, 1) callback($$CTCL_SetDispStateCOOP$$, 1, 1, 0) callback($$CTCL_SetDispStateCOOP$$, 2, 1, 1) callback($$CTCL_SetDispStateCOOP$$, 3, 1, 1) font3d TitleFont = "arial.ttf" font3d font_mesg = "arial.ttf" // FPATH "" if callback($$CTCL_GetACP$$) == 949 // korean font3d help_font = "±¼¸².ttf" else font3d help_font = "arial.ttf" // FPATH "" object o_fscreen = s_fscreen //o_fscreen.playHorz = 1 //o_fscreen.playVert = 1 initialize(o_fscreen) pane p_infopanel = "hsh\\coop\\infopanel.png" color(p_infopanel) = packcolor(255, 255, 255, 255) alphamode(p_infopanel) = am_alpha_alphainvalpha int nDiffX = 15 int nPanelX = -getwidth(p_infopanel) pane p_rank = "hsh\\coop\\netsvr.png" color(p_rank) = packcolor(255, 255, 255, 255) alphamode(p_rank) = am_alpha_alphainvalpha // variables for fading in and out int alpha_val = ALPHA_INIT_VALUE int fadeout = false int nRetBut = 0 } GUI_INIT { } GUI_EXECUTE { if (!fadeout) { nTime_Cur = gettimex() if nTimeCutOFF <= nTime_Cur { // esc.. cancel this screen //play btnTriggeredSound,1 fadeout = true nRetBut = fs_but2 return } else { nTime_Cur = nTimeCutOFF - nTime_Cur nTime_Cur = nTime_Cur + 500 // round up nTime_Cur = nTime_Cur / 1000 // as sec if nTime_Cur < 0 nTime_Cur = 0 if (nTime_Quit / 1000) < nTime_Cur nTime_Cur = nTime_Quit / 1000 // display as sec... nTime_Left = nTime_Cur } } if fadeout == true { // Fading out(Exiting) if ALPHA_MIN < alpha_val { alpha_val = alpha_val - ALPHA_DEC if alpha_val <= ALPHA_MIN { alpha_val = ALPHA_MIN @shell@id_type_is_single = 1 unfocus if nRetBut == fs_but2 { @SHELL@currentScreen = MAINMENU // @SHELL@lastScreen[@SHELL@lastScreenDepth] // mainmenu? @SHELL@lastScreenDepth-- } else { @SHELL@id_type_is_single = 0 callback($$CTCL_CheckCampaign$$, 3, 0) //@SHELL@lastScreenDepth++ @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU @SHELL@currentScreen = 201 // id input... } //script_end "gs_qnet.script" } } return } else { // Fading in(Entering) if alpha_val < ALPHA_MAX { alpha_val += ALPHA_INC if alpha_val >= ALPHA_MAX { alpha_val = ALPHA_MAX } } } nDiffX = nDiffX + 15 if nPanelX < 0 nPanelX = nPanelX + nDiffX if 0 < nPanelX nPanelX = 0 } GUI_DRAW { render @shell@p_bkgnd_4coop, 0, 0, 0 setpencolor(0, 0, 40, alpha_val) drawrect 0, 0 to getresx(), getresy() int boxcolor int y #if 0 boxcolor = packcolor(0, 0, 120, 255) // blue setpencolor(boxcolor) drawrect 0, 0 to getresx(), getresy() #endif render p_infopanel, nPanelX, 0, 0 render p_rank, nPanelX + RANK_LMARGIN, RANK_YSTART - (TITLE_HEIGHT + TITLE_GAPY), 0 y = RANK_YSTART int text_size int n_color n_color = packcolor(255,255,0,255) print3d_attributes = TitleFont, n_color, text_size,0,1,1,0,just_left,1 boxcolor = packcolor(40, 40, 40, 255) // gray string text print3d_position = nPanelX + 0, y //print3d "Rank" if (nPanelX == 0) && (nTime_Left != -1) { print3d_margins = 160, 260 to 660, 440 text_size = -(1000 + 28) n_color = packcolor(255,255,0,255) print3d_attributes = font_mesg, n_color, text_size,1,1,1,0,just_center,1 print3d_position = 160, 260 print3d "³×Æ®¿÷ °ÔÀÓ ¼­¹ö¸¦ »ý¼ºÇÏ¿©, ´Ù¸¥ »ç¶÷À» ÃÊ´ëÇÏ¿© °ÔÀÓÀ» Áñ±â½Ã°Ú½À´Ï±î?\n\n¼­¹ö¸¦ ¸¸µå½Ã·Á¸é Á¶À̽ºÆ½ ¹æ¾Æ¼è ¹öưÀ» ´©¸£½Ê½Ã¿À." print3d_margins = 160, 450 to 660, 530 text_size = -(1000 + 16) n_color = packcolor(255,255,0,255) print3d_attributes = font_mesg, 0xff80ff00, text_size,1,1,1,0,just_center,1 print3d_position = 160, 450 print3d "¼­¹ö°¡ ¾Æ´Ñ Âü°¡¸¦ ¿øÇÏ½Ã¸é ¾öÁö(¹Ì»çÀÏ) ¹öưÀ» ´­·¯ ÃʱâÈ­¸éÀ¸·Î °¡½Å´ÙÀ½ Ãʴ븦 ±â´Ù¸®½Ê½Ã¿À." print3d_margins = 610, 140 to 690, 214 text = conv$(nTime_Left) text_size = -(1000 + NAME_TIME_HEIGHT) n_color = packcolor(255,255,255,255) print3d_attributes = font_mesg, n_color, text_size,0,1,1,0,just_center,1 int nHeight = getprint3dheight(text) print3d_position = 610, 214 - nHeight print3d text #if 0 // jcem - draw help text!!! print3d_attributes = help_font, 0xff80ff00, -(1000 + 14), 1, 1, 1, 0, just_center print3d_margins = 140, 490 to 670, 530 print3d_position = 140, 490 if callback($$CTCL_GetACP$$) == 949 // korean { print3d "³×Æ®¿÷ °ÔÀÓÀÇ ¼­¹ö°¡ ¾Æ´Ñ Âü°¡¸¦ ¿øÇÏ½Ã¸é ¾öÁö(¹Ì»çÀÏ) ¹öưÀ» ´­·¯ ÃʱâÈ­¸éÀ¸·Î °¡½Å´ÙÀ½ Ãʴ븦 ±â´Ù¸®½Ê½Ã¿À.\n³»Æ®¿÷ °ÔÀÓ ¼­¹ö¸¦ ¸¸µå½Ã·Á¸é Á¶À̽ºÆ½ÀÇ ¹æ¾Æ¼è¸¦ ´ç±â½Ê½Ã¿À." } else { print3d "Thumb button(on joystick) for Network Client\nTrigger for Network Server Creation." } #endif } } GUI_MAILBOX { if sender == o_fscreen { nTime_Cur = gettimex() nTime_Quit = nTimeCutOFF - nTime_Cur nTime_Quit = nTime_Quit / 1000 nTime_Quit = nTime_Quit * 1000 if nTime_Quit < MAX_IDLE2 nTime_Quit = MAX_IDLE2 if MAX_IDLE < nTime_Quit nTime_Quit = MAX_IDLE // possible? nTime_Left = nTime_Quit / 1000 nTimeCutOFF = gettimex() + nTime_Quit int kEvent = getmessage(1) if kEvent == fs_but1 { fadeout = true nRetBut = fs_but1 return } if kEvent == fs_but2 { // esc.. cancel this screen //play btnTriggeredSound,1 fadeout = true nRetBut = fs_but2 return } if (kEvent & fs_left) { } if (kEvent & fs_right) { } if (kEvent & fs_up) { } if (kEvent & fs_down) { } } } GUI_DESTROY { unfocus } }