-- Message Box Area script -- title text, + 3 static Objects , 1 Scroll ( progress bar ) , 4 pushbuttons _sound_select = "highlight" _sound_accept = "accept" alpha_text_normal = 255 r_text_normal = 100 g_text_normal = 250 b_text_normal = 0 alpha_text_sel = 255 r_text_sel = 10 g_text_sel = 50 b_text_sel = 20 _fontscale_push_normal= "0.7" _fontscale_push_sel= "0.8" button_dx=100 button_dy=24 button_x1= 50 button_x2= 170 button_x3= 290 button_x4= 300 button_y= 300 _file_button1_normal="" _file_button1_sel="" _file_button2_normal="" _file_button2_sel="" _file_button3_normal="" _file_button3_sel="" _file_button4_normal="" _file_button4_sel="" _function_accept_push1_mb="MessageBoxPush1" _function_accept_push2_mb="MessageBoxPush2" _function_accept_push3_mb="MessageBoxPush3" _function_accept_push4_mb="MessageBoxPush4" function message_box() -- code should change the appearence of the area and it's children SetMaterial( 'message_box', 0 ,"", 255 ,2,2,2); SetMaterial( 'message_box', 1 ,"", 255 ,2,2,2) SetPos( 'message_box',0 , 500, 300); SetDim( 'message_box',0 , 100, 50 ); SetPos( 'message_box',1 , 500, 300); SetDim( 'message_box',1 , 100, 50 ); AddStaticObject( "message_box", "mesgbox_text0" ); AddStaticObject( "message_box", "mesgbox_text1" ); AddStaticObject( "message_box", "mesgbox_text2" ); AddStaticObject( "message_box", "mesgbox_text3" ); AddStaticObject( "message_box", "mesgbox_text4" ); AddStaticObject( "message_box", "mesgbox_text5" ); AddStaticObject( "message_box", "mesgbox_text6" ); AddPushButton ( "message_box" , "push1_messagebox" ); AddPushButton ( "message_box" , "push2_messagebox" ); AddPushButton ( "message_box" , "push3_messagebox" ); AddPushButton ( "message_box" , "push4_messagebox" ); AddScroll( "message_box" , "mesgbox_scroll1"); GUISetVisible('message_box', 0 ); end function push1_messagebox() SetMaterial( 'push1_messagebox', 0, _file_button1_normal , alpha_normal ,255,255,255 ); SetMaterial( 'push1_messagebox', 1, _file_button1_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push1_messagebox', 2, _file_button1_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push1_messagebox', 3, _file_button1_normal , alpha_normal ,255,255,255 ); SetPos( 'push1_messagebox', 0 , button_x1 , button_y ); SetDim( 'push1_messagebox', 0 , button_dx, button_dy ); SetPos( 'push1_messagebox', 1 , button_x1 , button_y ); SetDim( 'push1_messagebox', 1 , button_dx, button_dy ); SetPos( 'push1_messagebox', 2 , button_x1 , button_y ); SetDim( 'push1_messagebox', 2 , button_dx, button_dy ); SetPos( 'push1_messagebox', 3 , button_x1 , button_y ); SetDim( 'push1_messagebox', 3 , button_dx, button_dy ); SetState( 'push1_messagebox', 3 ); -- disabled SetTxt( "push1_messagebox" , _but_font_no , _but_align , "NULL"); SetFontScale('push1_messagebox' , _fontscale_push_normal); SetFontScale('push1_messagebox' , _fontscale_push_sel , 1); SetTextColor( "push1_messagebox", alpha_text_normal , r_text_normal, g_text_normal, b_text_normal ); SetTextColor( "push1_messagebox", alpha_text_sel , r_text_sel, g_text_sel, b_text_sel , 1); SetPush( 'push1_messagebox', _function_accept_push1_mb ); SetSndSelect( "push1_messagebox" , _sound_select); SetSndPush( "push1_messagebox" , _sound_accept); end function push2_messagebox() SetMaterial( 'push2_messagebox', 0, _file_button2_normal , alpha_normal ,255,255,255 ); SetMaterial( 'push2_messagebox', 1, _file_button2_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push2_messagebox', 2, _file_button2_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push2_messagebox', 3, _file_button2_normal , alpha_normal ,255,255,255 ); SetPos( 'push2_messagebox', 0 , button_x2 , button_y ); SetDim( 'push2_messagebox', 0 , button_dx, button_dy ); SetPos( 'push2_messagebox', 1 , button_x2 , button_y ); SetDim( 'push2_messagebox', 1 , button_dx, button_dy ); SetPos( 'push2_messagebox', 2 , button_x2 , button_y ); SetDim( 'push2_messagebox', 2 , button_dx, button_dy ); SetPos( 'push2_messagebox', 3 , button_x2 , button_y ); SetDim( 'push2_messagebox', 3 , button_dx, button_dy ); SetState( 'push2_messagebox', 3 ); -- disabled SetTxt( "push2_messagebox" , _but_font_no , _but_align , "NULL"); SetFontScale('push2_messagebox' , _fontscale_push_normal); SetFontScale('push2_messagebox' , _fontscale_push_sel , 1); SetTextColor( "push2_messagebox", alpha_text_normal , r_text_normal, g_text_normal, b_text_normal ); SetTextColor( "push2_messagebox", alpha_text_sel , r_text_sel, g_text_sel, b_text_sel , 1); SetPush( 'push2_messagebox', _function_accept_push2_mb ); SetSndSelect( "push2_messagebox" , _sound_select); SetSndPush( "push2_messagebox" , _sound_accept); end function push3_messagebox() SetMaterial( 'push3_messagebox', 0, _file_button3_normal , alpha_normal ,255,255,255 ); SetMaterial( 'push3_messagebox', 1, _file_button3_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push3_messagebox', 2, _file_button3_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push3_messagebox', 3, _file_button3_normal , alpha_normal ,255,255,255 ); SetPos( 'push3_messagebox', 0 , button_x3 , button_y ); SetDim( 'push3_messagebox', 0 , button_dx, button_dy ); SetPos( 'push3_messagebox', 1 , button_x3 , button_y ); SetDim( 'push3_messagebox', 1 , button_dx, button_dy ); SetPos( 'push3_messagebox', 2 , button_x3 , button_y ); SetDim( 'push3_messagebox', 2 , button_dx, button_dy ); SetPos( 'push3_messagebox', 3 , button_x3 , button_y ); SetDim( 'push3_messagebox', 3 , button_dx, button_dy ); SetState( 'push3_messagebox', 3 ); -- disabled SetTxt( "push3_messagebox" , _but_font_no , _but_align , "NULL"); SetFontScale('push3_messagebox' , _fontscale_push_normal); SetFontScale('push3_messagebox' , _fontscale_push_sel , 1); SetTextColor( "push3_messagebox", alpha_text_normal , r_text_normal, g_text_normal, b_text_normal ); SetTextColor( "push3_messagebox", alpha_text_sel , r_text_sel, g_text_sel, b_text_sel , 1); SetPush( 'push3_messagebox', _function_accept_push3_mb ); SetSndSelect( "push3_messagebox" , _sound_select); SetSndPush( "push3_messagebox" , _sound_accept); end function push4_messagebox() SetMaterial( 'push4_messagebox', 0, _file_button4_normal , alpha_normal ,255,255,255 ); SetMaterial( 'push4_messagebox', 1, _file_button4_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push4_messagebox', 2, _file_button4_sel , alpha_sel ,255,255,255 ); SetMaterial( 'push4_messagebox', 3, _file_button4_normal , alpha_normal ,255,255,255 ); SetPos( 'push4_messagebox', 0 , button_x4 , button_y ); SetDim( 'push4_messagebox', 0 , button_dx, button_dy ); SetPos( 'push4_messagebox', 1 , button_x4 , button_y ); SetDim( 'push4_messagebox', 1 , button_dx, button_dy ); SetPos( 'push4_messagebox', 2 , button_x4 , button_y ); SetDim( 'push4_messagebox', 2 , button_dx, button_dy ); SetPos( 'push4_messagebox', 3 , button_x4 , button_y ); SetDim( 'push4_messagebox', 3 , button_dx, button_dy ); SetState( 'push4_messagebox', 3 ); -- disabled SetTxt( "push4_messagebox" , _but_font_no , _but_align , "NULL"); SetFontScale('push4_messagebox' , _fontscale_push_normal); SetFontScale('push4_messagebox' , _fontscale_push_sel , 1); SetTextColor( "push4_messagebox", alpha_text_normal , r_text_normal, g_text_normal, b_text_normal ); SetTextColor( "push4_messagebox", alpha_text_sel , r_text_sel, g_text_sel, b_text_sel , 1); SetPush( 'push4_messagebox', _function_accept_push4_mb ); SetSndSelect( "push4_messagebox" , _sound_select); SetSndPush( "push4_messagebox" , _sound_accept); end -- title: function mesgbox_text0() SetMaterial( 'mesgbox_text0', 0 , "", 0 , 255 , 255 , 255 ); SetMaterial( 'mesgbox_text0', 1 , "", 0 , 255 , 255 , 255 ); SetPos( 'mesgbox_text0', 0 , 500 , 300); SetDim( 'mesgbox_text0', 0 , 100, 50); SetPos( 'mesgbox_text0', 1 , 500 , 300); SetDim( 'mesgbox_text0', 1 , 100, 50); SetState( 'mesgbox_text0', 1); SetTxt( 'mesgbox_text0', 0, 0, "NULL" ) end function mesgbox_scroll1() SetMaterial( 'mesgbox_scroll1', 0, "", 255,225,20,20 );-- ND SetMaterial( 'mesgbox_scroll1', 1, "", 100,3,3,200 ); SetPos( 'mesgbox_scroll1', 0, 250, 220); SetDim( 'mesgbox_scroll1', 0, 160, 30); SetPos( 'mesgbox_scroll1', 1, 250, 220); SetDim( 'mesgbox_scroll1', 1, 160, 30); SetStartStopStep( 'mesgbox_scroll1', 0, 100, 1 ) SetState( 'mesgbox_scroll1', 0); SetCrtValComtroled( 'mesgbox_scroll1', 40 ) GUISetVisible('mesgbox_scroll1',0); end function mesgbox_text1() SetMaterial( 'mesgbox_text1', 0 , "", 0 , 255 , 255 , 255 ); SetMaterial( 'mesgbox_text1', 1 , "", 0 , 255 , 255 , 255 ); SetPos( 'mesgbox_text1', 0 , 500 , 300); SetDim( 'mesgbox_text1', 0 , 100, 50); SetPos( 'mesgbox_text1', 1 , 500 , 300); SetDim( 'mesgbox_text1', 1 , 100, 50); SetState( 'mesgbox_text1', 1); SetTxt( 'mesgbox_text1', 0, 0, "NULL" ) end function mesgbox_text2() SetMaterial( 'mesgbox_text2', 0 , "", 0 , 255 , 255 , 255 ); SetMaterial( 'mesgbox_text2', 1 , "", 0 , 255 , 255 , 255 ); SetPos( 'mesgbox_text2', 0 , 500 , 300); SetDim( 'mesgbox_text2', 0 , 100, 50); SetPos( 'mesgbox_text2', 1 , 500 , 300); SetDim( 'mesgbox_text2', 1 , 100, 50); SetState( 'mesgbox_text2', 1); SetTxt( 'mesgbox_text2', 0, 0, "NULL" ) end function mesgbox_text3() SetMaterial( 'mesgbox_text3', 0 , "", 0 , 255 , 255 , 255 ); SetMaterial( 'mesgbox_text3', 1 , "", 0 , 255 , 255 , 255 ); SetPos( 'mesgbox_text3', 0 , 500 , 300); SetDim( 'mesgbox_text3', 0 , 100, 50); SetPos( 'mesgbox_text3', 1 , 500 , 300); SetDim( 'mesgbox_text3', 1 , 100, 50); SetState( 'mesgbox_text3', 1); SetTxt( 'mesgbox_text3', 0, 0, "NULL" ) end function mesgbox_text4() SetMaterial( 'mesgbox_text4', 0 , "", 0 , 255 , 255 , 255 ); SetMaterial( 'mesgbox_text4', 1 , "", 0 , 255 , 255 , 255 ); SetPos( 'mesgbox_text4', 0 , 500 , 300); SetDim( 'mesgbox_text4', 0 , 100, 50); SetPos( 'mesgbox_text4', 1 , 500 , 300); SetDim( 'mesgbox_text4', 1 , 100, 50); SetState( 'mesgbox_text4', 1); SetTxt( 'mesgbox_text4', 0, 0, "NULL" ) end function mesgbox_text5() SetMaterial( 'mesgbox_text5', 0 , "", 0 , 255 , 255 , 255 ); SetMaterial( 'mesgbox_text5', 1 , "", 0 , 255 , 255 , 255 ); SetPos( 'mesgbox_text5', 0 , 500 , 300); SetDim( 'mesgbox_text5', 0 , 100, 50); SetPos( 'mesgbox_text5', 1 , 500 , 300); SetDim( 'mesgbox_text5', 1 , 100, 50); SetState( 'mesgbox_text5', 1); SetTxt( 'mesgbox_text5', 0, 0, "NULL" ) end function mesgbox_text6() SetMaterial( 'mesgbox_text6', 0 , "", 0 , 255 , 255 , 255 ); SetMaterial( 'mesgbox_text6', 1 , "", 0 , 255 , 255 , 255 ); SetPos( 'mesgbox_text6', 0 , 500 , 300); SetDim( 'mesgbox_text6', 0 , 100, 50); SetPos( 'mesgbox_text6', 1 , 500 , 300); SetDim( 'mesgbox_text6', 1 , 100, 50); SetState( 'mesgbox_text6', 1); SetTxt( 'mesgbox_text6', 0, 0, "NULL" ) end