//====================================================== // Mechwarrior: Vengeance | Copyright © 1999-2000 // AdvanceTime.script // Original Author: Adam Saunders | August 1, 2002 // Update: //====================================================== // Notes: //====================================================== #define nMSG_ADVANCE_TIME_DLG 3300 #define nMSG_ADVANCE_TIME_1WEEK 3301 #define nMSG_ADVANCE_TIME_2WEEKS 3302 #define cGreen packcolor(20,255,20,255) advance_time_dialog { GUI_CREATE { location = 0,0,parent.location.z + 100 region = location to getresx(), getresy() int alpha_val = 5 int fadeout = false int initialized = false pane gFrame = GPATH "dialog_600x350m-loading.tga" int nOfButtons = 1 object mbutton[nOfButtons] int btnCONTINUE = 0 string buttonText[nOfButtons] buttonText[btnCONTINUE] = localize$( IDS_AT_CONTINUE ) position dlgLocation = 50, 50, location.z cube dlgTitle_Region = dlgLocation.x + 69, dlgLocation.y + 35 to dlgLocation.x + 576, dlgLocation.y + 56 cube paragraph1_Region = dlgLocation.x + 52, dlgLocation.y + 91 to dlgLocation.x + 588, dlgLocation.y + 203 cube paragraph2_Region = dlgLocation.x + 52, dlgLocation.y + 130 to dlgLocation.x + 588, dlgLocation.y + 234 cube paragraph3_Region = dlgLocation.x + 52, dlgLocation.y + 180 to dlgLocation.x + 588, dlgLocation.y + 310 cube account_Balance_Region = dlgLocation.x + 107, dlgLocation.y + 220 to dlgLocation.x + 303, dlgLocation.y + 234 cube account_Balance_Value_Region = dlgLocation.x + 111, dlgLocation.y + 238 to dlgLocation.x + 303, dlgLocation.y + 252 cube per_Cycle_Expenses_Region = dlgLocation.x + 314, dlgLocation.y + 220 to dlgLocation.x + 550, dlgLocation.y + 240 cube per_Cycle_Expenses_Value_Region = dlgLocation.x + 318, dlgLocation.y + 238 to dlgLocation.x + 510, dlgLocation.y + 252 position dlgTitle_Location = dlgLocation.x + 69, dlgLocation.y + 35, dlgLocation.z + 20 position paragraph1_Location = dlgLocation.x + 52, dlgLocation.y + 91, dlgLocation.z + 20 position paragraph2_Location = dlgLocation.x + 52, dlgLocation.y + 130, dlgLocation.z + 20 position paragraph3_Location = dlgLocation.x + 52, dlgLocation.y + 180, dlgLocation.z + 20 position continue_Location = dlgLocation.x + 475, dlgLocation.y + 307, dlgLocation.z + 20 position Adv1Week_Location = dlgLocation.x + 58, dlgLocation.y + 282, dlgLocation.z + 20 position Adv2Week_Location = dlgLocation.x + 58, dlgLocation.y + 305, dlgLocation.z + 20 position Adv0Week_Location = dlgLocation.x + 58, dlgLocation.y + 328, dlgLocation.z + 20 position account_Balance_Location = dlgLocation.x + 107, dlgLocation.y + 220, dlgLocation.z + 20 position account_Balance_Value_Location = dlgLocation.x + 111, dlgLocation.y + 238, dlgLocation.z + 20 position per_Cycle_Expenses_Location = dlgLocation.x + 314, dlgLocation.y + 220, dlgLocation.z + 20 position per_Cycle_Expenses_Value_Location = dlgLocation.x + 320, dlgLocation.y + 238, dlgLocation.z + 20 int nOfCheckboxes = 3 object checkbox[nOfCheckboxes] object o_advancetime_error //time_advance_description 52,114,588,203 //per_cycle_expenses 314,220,550,234 //per_cycle_expenses_value 318,238,510,252 //current_balance 107,220,303,234 //current_balance_value 111,238,303,252 //2_weeks 77,305,269,319 //2_weeks_check 58,305 //1_week 77,282,269,296 //1_week_check 58,282 //don't_advance_time 77,328,269,342 //don’t_advance_checkmark 58,328 //continue 479,316 int THIS_CYCLE = 0 int NEXT_CYCLE = 1 } GUI_INIT { int i for (i = 0; i < nOfButtons; i++) { mbutton[i] = s_multistatepane mbutton[i].file = WPATH "button_reg_119x36m_4state.tga" mbutton[i].total_states = 4 mbutton[i].id = -1 mbutton[i].text = buttonText[i] mbutton[i].text_v_offset = -2 initialize( mbutton[i] ) } for (i=0; i 0 { alpha_val = alpha_val - 5 if alpha_val <= 0 { alpha_val = 0 deactivate(this) } } } else { // Fading in(Entering) if alpha_val < 150 { alpha_val += 5 if alpha_val >= 150 { alpha_val = 150 } } } } GUI_MAILBOX { int i int endDlg = true int WORKING_MECH = -1 switch ( sender ) { case mbutton[0] : // Continue if ( checkbox[0].state == 2 ) { if ( callback($$GetMoneyBalance$$) > callback($$GetCycleExpenses$$, THIS_CYCLE ) ) { if ( @Mechbay_main@o_mainui.tempRepairStatusFlag == true ) { callback($$RepairMech$$, WORKING_MECH) @Mechbay_main@o_mainui.tempRepairStatusFlag = false } callback($$ML_CallbackHandler$$, MLSave) @Mechbay_main@o_mainui.just_saved = true callback($$AdvanceNCycles$$, 1) mail( 3, @Mechbay_main@o_mainui ) mail( 1, @Mechbay_main@o_mainui ) endDlg = true } else { endDlg = false o_advancetime_error = o_ErrorScreen o_advancetime_error.error_header = localize$(IDS_AT_ERROR_MONEY_HEADER) o_advancetime_error.error_message = localize$(IDS_AT_ERROR_MONEY_TEXT1) o_advancetime_error.button_mode = ONE_BUTTON_MODE o_advancetime_error.buttonText[0] = localize$(IDS_GN_OK) initialize(o_advancetime_error) o_advancetime_error.mButton[0].id = -1 activate(o_advancetime_error) } } if ( checkbox[1].state == 2 ) { if ( callback($$GetMoneyBalance$$) > callback($$GetCycleExpenses$$, THIS_CYCLE) + callback($$GetCycleExpenses$$, NEXT_CYCLE) ) { if ( @Mechbay_main@o_mainui.tempRepairStatusFlag == true ) { callback($$RepairMech$$, WORKING_MECH) @Mechbay_main@o_mainui.tempRepairStatusFlag = false } callback($$ML_CallbackHandler$$, MLSave) @Mechbay_main@o_mainui.just_saved = true callback($$AdvanceNCycles$$, 2) mail( 3, @Mechbay_main@o_mainui ) mail( 1, @Mechbay_main@o_mainui ) endDlg = true } else { endDlg = false o_advancetime_error = o_ErrorScreen o_advancetime_error.error_header = localize$(IDS_AT_ERROR_MONEY_HEADER) o_advancetime_error.error_message = localize$(IDS_AT_ERROR_MONEY_TEXT2) o_advancetime_error.button_mode = ONE_BUTTON_MODE o_advancetime_error.buttonText[0] = localize$(IDS_GN_OK) initialize(o_advancetime_error) o_advancetime_error.mButton[0].id = -1 activate(o_advancetime_error) } } if ( endDlg == true ) { fadeout = true for (i = 0; i < nOfButtons; i++) { deactivate(mbutton[i]) } for (i=0; i