//--------- Begin of function FirmHarbor::put_det ---------// // void FirmHarbor::put_det(int refreshFlag) { if( refreshFlag == INFO_REPAINT ) vga_util.d3_panel_up( SHIP_DET_X1, SHIP_DET_Y1, SHIP_DET_X2, SHIP_DET_Y2 ); else vga_util.blt_buf( SHIP_DET_X1, SHIP_DET_Y1, SHIP_DET_X2, SHIP_DET_Y2, 0 ); if( browse_ship.none_record ) return; refreshFlag = INFO_REPAINT; // for calling disp_ship_units() and disp_ship_goods() //------- display info of the ship --------// UnitMarine* shipUnitPtr = (UnitMarine*) unit_array[ ship_recno_array[browse_ship.recno()-1] ]; UnitInfo* shipUnitInfo = unit_res[shipUnitPtr->unit_id]; //----- if the ship can carry both goods and units, display mode selection button ---// if( shipUnitInfo->carry_goods_capacity > 0 && shipUnitInfo->carry_unit_capacity > 0 ) { button_mode[0].create_text( SHIP_DET_X1+10, SHIP_DET_Y1+3, SHIP_DET_X1+80, SHIP_DET_Y1+19, "Units" ); button_mode[1].create_text( SHIP_DET_X1+90, SHIP_DET_Y1+3, SHIP_DET_X2-10, SHIP_DET_Y1+19, "Goods" ); button_mode.paint(ship_disp_mode); if( ship_disp_mode == SHIP_MENU_UNIT ) disp_ship_units(shipUnitPtr, SHIP_DET_Y1+22, refreshFlag); else disp_ship_goods(shipUnitPtr, SHIP_DET_Y1+22, refreshFlag); } else if( shipUnitInfo->carry_goods_capacity > 0 ) { disp_ship_goods(shipUnitPtr, SHIP_DET_Y1+22, refreshFlag); } else if( shipUnitInfo->carry_unit_capacity > 0 ) { disp_ship_units(shipUnitPtr, SHIP_DET_Y1+22, refreshFlag); } }
// ----- begin of function ScenarioEditor::disp_monster_main ------// // void ScenarioEditor::disp_monster_main(int refreshFlag) { String str; // unit or structure button group button_unit_or_struct[0].create_text( INFO_X1+15, INFO_Y1+5, INFO_X1+110, INFO_Y1+25, text_editor.str_unit(), 0 ); // "Unit", 0 ); button_unit_or_struct[1].create_text( INFO_X1+115, INFO_Y1+5, INFO_X1+210, INFO_Y1+25, text_editor.str_structure(), 0 ); //"Structure", 0 ); font_zoom.put( INFO_X1+10, INFO_Y2-28, text_editor.str_double_left_add(), 0, INFO_X2-5); font_zoom.put( INFO_X1+10, INFO_Y2-14, text_editor.str_double_right_del(), 0, INFO_X2-5); button_unit_or_struct.paint(unit_or_struct); { // player number button group for( int nationRecno = 0; nationRecno <= MAX_NATION; ++nationRecno ) { button_player_recno[nationRecno].create( INFO_X1+16+nationRecno*25, INFO_Y1+30, INFO_X1+16+(nationRecno+1)*25-2, INFO_Y1+57, i_disp_nation_button, ButtonCustomPara(NULL, nationRecno), 0 ); button_player_recno[nationRecno].visible_flag = button_player_recno[nationRecno].enable_flag = !nationRecno || !nation_array.is_deleted(nationRecno); // nation 0 always enable } } if( brush_player_recno && nation_array.is_deleted(brush_player_recno) ) { brush_player_recno = 0; // set to nation 0 if that nation is deleted } button_player_recno.paint(brush_player_recno); // display browser collect_monster_unit(monster_race_filter); collect_monster_firm(monster_race_filter); // display browser if( !unit_or_struct ) { // init unit browser vbrowse_unit_id.init( INFO_X1+5, INFO_Y1+80, INFO_X2-5, INFO_Y2-30, -1, 20, monster_unit_id_count, disp_monster_unit_id ); vbrowse_unit_id.open(monster_unit_id_browse_recno); browse_unit_width = vbrowse_unit_id.ix2 - vbrowse_unit_id.ix1 + 1; vbrowse_unit_id.paint(); vbrowse_unit_id.refresh(); } else { // init firm browser vbrowse_firm_build.init( INFO_X1+5, INFO_Y1+80, INFO_X2-5, INFO_Y2-30, -1, 20, monster_firm_group_count, disp_monster_firm_group ); vbrowse_firm_build.open(monster_firm_group_browse_recno); browse_firm_width = vbrowse_firm_build.ix2 - vbrowse_firm_build.ix1 + 1; vbrowse_firm_build.paint(); vbrowse_firm_build.refresh(); } // init race filter button // int raceLength = ((INFO_X2-4) - (INFO_X1+5) + 1) / (1+MAX_MONSTER_TYPE); // char raceAbbr[2] = " "; // for( int r = 0; r <= MAX_MONSTER_TYPE; ++r ) // { // if( r > 0 ) // raceAbbr[0] = monster_res[r]->name[0]; // button_race_group[r].create_text( INFO_X1+5+r*raceLength, INFO_Y1+58, // INFO_X1+5+(r+1)*raceLength-1, INFO_Y1+78, raceAbbr ); // } spinner_race_group.create( INFO_X1+80, INFO_Y1+58, INFO_X1+210, INFO_Y1+78, 200,//146, 0, 1+MAX_MONSTER_TYPE, i_disp_race_spinner, -monster_race_filter ); // button_race_group.paint(-monster_race_filter); spinner_race_group.paint(-monster_race_filter); }
//--------- Begin of static function disp_nation_info ---------// // static void disp_nation_info() { vga_util.d3_panel_down( REPORT_DET_X1, REPORT_DET_Y1, REPORT_DET_X2, REPORT_DET_Y2 ); //----------- display info ------------// int nationRecno = info.nation_filter(browse_nation.recno()); Nation* nationPtr = nation_array[nationRecno]; Nation* viewingNation = nation_array[info.viewing_nation_recno]; NationRelation* nationRelation = viewingNation->get_relation(nationRecno); int x1=REPORT_DET_X1+6, x2=REPORT_DET_X1+380, x3=REPORT_DET_X2-10; int y=REPORT_DET_Y1+6; const int lineSpacing = 19; //---- display the nationality of the king ----// if( nationPtr->is_human() ) font_bld.put_field( x1, y, text_reports.str_king_race(nationPtr->race_id), x2, nationPtr->is_human() ? race_res[nationPtr->race_id]->name : monster_res[nationPtr->monster_id()]->name ); y += lineSpacing; //-------- display economic data ----------// String str; if( nationRecno == info.viewing_nation_recno ) { // font_bld.put_field( x1, y, "Your Food", x2, nationPtr->food_str() ); font_bld.put_field( x1, y, text_reports.str_your_food(), x2, nationPtr->food_str() ); str = "$"; str += nationPtr->cash_str(); font_bld.put_field( x1, y+=lineSpacing, text_reports.str_your_treasure(), x2, str ); if( nationPtr->is_monster() ) font_bld.put_field( x1, y+=lineSpacing, text_reports.str_your_live_points(), x2, (int) nationPtr->live_points ); font_bld.field( x1, y+=lineSpacing, text_reports.str_your_peace_time(), x2, nationPtr->peace_duration_str(), x3, INFO_REPAINT, "PEACE" ); } else { //str = translate.process("Your Yearly Import from "); //str += nationPtr->nation_name(); // font_bld.field( x1, y , str, x2, (int) viewingNation->get_relation(nationRecno)->import_365days(IMPORT_TOTAL), 2, x3, INFO_REPAINT, "IMPORT" ); font_bld.field( x1, y , text_reports.str_enemy_import_from(nationPtr->nation_name()), x2, (int) viewingNation->get_relation(nationRecno)->import_365days(IMPORT_TOTAL), 2, x3, INFO_REPAINT, "IMPORT" ); // str = translate.process("Your Yearly Export to "); // str += nationPtr->nation_name(); // font_bld.field( x1, y+=lineSpacing, str, x2, (int) nationPtr->get_relation(info.viewing_nation_recno)->import_365days(IMPORT_TOTAL), 2, x3, INFO_REPAINT, "EXPORT" ); font_bld.field( x1, y+=lineSpacing, text_reports.str_enemy_export_to(nationPtr->nation_name()), x2, (int) nationPtr->get_relation(info.viewing_nation_recno)->import_365days(IMPORT_TOTAL), 2, x3, INFO_REPAINT, "EXPORT" ); // str = translate.process("Continuous Peace Time of "); // str += nationPtr->nation_name(); // font_bld.field( x1, y+=lineSpacing, str, x2, nationPtr->peace_duration_str(), x3, INFO_REPAINT, "PEACE" ); font_bld.field( x1, y+=lineSpacing, text_reports.str_enemy_peace_time(nationPtr->nation_name()), x2, nationPtr->peace_duration_str(), x3, INFO_REPAINT, "PEACE" ); //--------- duration of current status ----------// // str = translate.process("Duration of "); // str += translate.process(nationRelation->status_str()); // str += " Status"; // font_bld.field( x1, y+=lineSpacing, str, x2, nationRelation->status_duration_str(), x3, INFO_REPAINT, "STATTIME" ); font_bld.field( x1, y+=lineSpacing, text_reports.str_enemy_status_duration(nationRelation->status_str()), x2, nationRelation->status_duration_str(), x3, INFO_REPAINT, "STATTIME" ); //------- display the allow_attack field --------// // str = "Allow Your Units to Attack "; // str += nationPtr->nation_name(); // font_bld.field( x1, y+=lineSpacing, str, x2, "", x3, INFO_REPAINT, "ALLOWATK" ); font_bld.field( x1, y+=lineSpacing, text_reports.str_enemy_allow_attack(nationPtr->nation_name()), x2, "", x3, INFO_REPAINT, "ALLOWATK" ); // button_allow_attack[0].set_font( &font_bld ); // button_allow_attack[1].set_font( &font_bld ); button_allow_attack[1].create_text( x2+6 , y, x2+50 , y+lineSpacing-1, text_reports.str_no_yes(1)); // "Yes" ); button_allow_attack[0].create_text( x2+54, y, x2+100, y+lineSpacing-1, text_reports.str_no_yes(0)); // "No" ); button_allow_attack.paint( viewingNation->get_relation(nationRecno)->should_attack ); //---- if this nation is our ally, display its cash and food ----// if( viewingNation->get_relation(nationRecno)->status == RELATION_ALLIANCE ) { // str = nationPtr->nation_name(); // str += " 's Treasure"; // font_bld.field( x1, y+=lineSpacing, str, x2, nationPtr->cash, 2, x3, INFO_REPAINT ); font_bld.field( x1, y+=lineSpacing, text_reports.str_ally_cash(nationPtr->nation_name()), x2, nationPtr->cash, 2, x3, INFO_REPAINT ); // str = nationPtr->nation_name(); // str += " 's Food"; // font_bld.field( x1, y+=lineSpacing, str, x2, nationPtr->food, 1, x3, INFO_REPAINT ); font_bld.field( x1, y+=lineSpacing, text_reports.str_ally_food(nationPtr->nation_name()), x2, nationPtr->food, 1, x3, INFO_REPAINT ); } } y+=lineSpacing+10; //----- display its relation status with other nations -----// if( info.viewing_nation_recno != nationRecno ) { // String str; nationPtr->disp_nation_color(x1, y+1); font_bld.put(x1+20, y, text_reports.str_enemy_relation(nationPtr->nation_name())); y+=20; for( int i=1 ; i<=nation_array.size() ; i++ ) { if( nation_array.is_deleted(i) || i == nationRecno || i == info.viewing_nation_recno ) { continue; } nation_array[i]->disp_nation_color(x1, y+1); font_bld.put( x1+20, y, nation_array[i]->nation_name() ); font_bld.put( x1+240, y, nationPtr->get_relation(i)->status_str() ); if( nationPtr->get_relation(i)->trade_treaty ) { int x2 = font_bld.put( x1+330, y, text_talk.str_trade_treaty()); // "Trade Treaty" ); // font_bld.put( x1+450, y, misc.format((int)nationPtr->total_year_trade(i),2) ); font_bld.put( x2+10, y, misc.format((int)nationPtr->total_year_trade(i),2) ); } if( config.show_debug_info ) { font_bld.put( x1+500, y, nationPtr->get_relation(i)->ai_relation_level ); font_bld.put( x1+530, y, (int) nationPtr->get_relation(i)->good_relation_duration_rating ); } y+=16; } } }
//--------- Begin of static function disp_nation_info ---------// // static void disp_nation_info() { vga.d3_panel_down( REPORT_DET_X1, REPORT_DET_Y1, REPORT_DET_X2, REPORT_DET_Y2 ); //----------- display info ------------// int nationRecno = nation_filter(browse_nation.recno()); Nation* nationPtr = nation_array[nationRecno]; Nation* viewingNation = nation_array[info.viewing_nation_recno]; NationRelation* nationRelation = viewingNation->get_relation(nationRecno); int x1=REPORT_DET_X1+6, x2=REPORT_DET_X1+340, x3=REPORT_DET_X2-10; int y=REPORT_DET_Y1+6; //-------- display economic data ----------// String str; if( nationRecno == info.viewing_nation_recno ) { font_san.put_field( x1, y, "Your Food", x2, nationPtr->food_str() ); str = "$"; str += nationPtr->cash_str(); font_san.put_field( x1, y+=16, "Your Treasure", x2, str ); font_san.field( x1, y+=16, "Your Continuous Peace Time", x2, nationPtr->peace_duration_str(), x3, INFO_REPAINT, "PEACE" ); } else { str = translate.process("Your Yearly Import from "); str += nationPtr->nation_name(); font_san.field( x1, y , str, x2, (int) viewingNation->get_relation(nationRecno)->import_365days(IMPORT_TOTAL), 2, x3, INFO_REPAINT, "IMPORT" ); str = translate.process("Your Yearly Export to "); str += nationPtr->nation_name(); font_san.field( x1, y+=16, str, x2, (int) nationPtr->get_relation(info.viewing_nation_recno)->import_365days(IMPORT_TOTAL), 2, x3, INFO_REPAINT, "EXPORT" ); str = translate.process("Continuous Peace Time of "); str += nationPtr->nation_name(); font_san.field( x1, y+=16, str, x2, nationPtr->peace_duration_str(), x3, INFO_REPAINT, "PEACE" ); //--------- duration of current status ----------// #if(defined(SPANISH)) str = "Duración del estado de "; str += translate.process(nationRelation->status_str()); #elif(defined(FRENCH)) str = "Duration of "; str += nationRelation->status_str(); str += " Status"; str = translate.process(str); #else // GERMAN and US str = translate.process("Duration of "); str += translate.process(nationRelation->status_str()); str += " Status"; #endif font_san.field( x1, y+=16, str, x2, nationRelation->status_duration_str(), x3, INFO_REPAINT, "STATTIME" ); //------- display the allow_attack field --------// #if(defined(SPANISH)) // str = "Permitir que tus Unidades ataquen al "; str = "Permitir atacar al "; str += nationPtr->nation_name(); #elif(defined(FRENCH)) str = "Autoriser attaque contre le "; str += nationPtr->nation_name(); #elif(defined(GERMAN)) str = "Angriffe auf "; str += nationPtr->nation_name(); str += " erlauben"; #else str = "Allow Your Units to Attack "; str += nationPtr->nation_name(); #endif font_san.field( x1, y+=16, str, x2, "", x3, INFO_REPAINT, "ALLOWATK" ); button_allow_attack[1].create_text( x2+6 , y, x2+50 , y+15, "Yes" ); button_allow_attack[0].create_text( x2+54, y, x2+100, y+15, "No" ); button_allow_attack.paint( viewingNation->get_relation(nationRecno)->should_attack ); //---- if this nation is our ally, display its cash and food ----// if( viewingNation->get_relation(nationRecno)->status == NATION_ALLIANCE ) { #if(defined(SPANISH)) str = "Tesoro del "; str += nationPtr->nation_name(); #elif(defined(FRENCH)) str = "Trésor du "; str += nationPtr->nation_name(); #else // GERMAN and US str = nationPtr->nation_name(); str += " 's Treasure"; #endif font_san.field( x1, y+=16, str, x2, nationPtr->cash, 2, x3, INFO_REPAINT ); #if(defined(SPANISH)) str = "Alimentos del "; str += nationPtr->nation_name(); #elif(defined(FRENCH)) str = "Réserves de nourriture du "; str += nationPtr->nation_name(); #else // GERMAN and US str = nationPtr->nation_name(); str += " 's Food"; #endif font_san.field( x1, y+=16, str, x2, nationPtr->food, 2, x3, INFO_REPAINT ); } } y+=26; //----- display its relation status with other nations -----// if( info.viewing_nation_recno != nationRecno ) { String str; #if(defined(SPANISH)) str = "Estado Diplomático del "; str += nationPtr->nation_name(); str += " con otros Reinos:"; #elif(defined(FRENCH)) str = "Relations diplomatiques de "; str += nationPtr->nation_name(); str += " avec les autres royaumes:"; #else // GERMAN and US str = nationPtr->nation_name(); str += "'s "; str += translate.process( "Diplomatic Status with Other Kingdoms:" ); #endif nationPtr->disp_nation_color(x1, y+1); font_san.put(x1+20, y, str); y+=20; for( int i=1 ; i<=nation_array.size() ; i++ ) { if( nation_array.is_deleted(i) || i == nationRecno || i == info.viewing_nation_recno ) { continue; } nation_array[i]->disp_nation_color(x1, y+1); font_san.put( x1+20, y, nation_array[i]->nation_name() ); font_san.put( x1+240, y, nationPtr->get_relation(i)->status_str() ); if( nationPtr->get_relation(i)->trade_treaty ) { font_san.put( x1+330, y, "Trade Treaty" ); #if(defined(FRENCH)) font_san.put( x1+460, y, m.format((int)nationPtr->total_year_trade(i),2) ); #else // German and US font_san.put( x1+450, y, m.format((int)nationPtr->total_year_trade(i),2) ); #endif } if( config.show_ai_info ) { font_san.put( x1+500, y, nationPtr->get_relation(i)->ai_relation_level ); font_san.put( x1+530, y, (int) nationPtr->get_relation(i)->good_relation_duration_rating ); } y+=16; } } }
// ----- begin of function ScenarioEditor::disp_players_main ------// // void ScenarioEditor::disp_players_main(int refreshFlag) { // ------- display scroll area ----------// browse_nation.init( INFO_X1, INFO_Y1, INFO_X2, INFO_Y1+168, -1, 32, MAX_NATION, disp_nation_rec ); browse_nation.open(brush_player_recno); browse_nation.paint(); // ######## begin Gilbert 22/2 #######// // browse_nation.refresh(brush_player_recno); browse_nation.refresh(); // ######## end Gilbert 22/2 #######// // ------ display king name -------// int y = INFO_Y1+170; // if( !nation_array.is_deleted(brush_player_recno) ) // font_whbl.put( font_whbl.put( INFO_X1+20, y, text_editor.str_king_name()) // "King Name" ) // +10, y, nation_array[brush_player_recno]->king_name() ) ; if( !nation_array.is_deleted(brush_player_recno) ) { vga_buffer.d3_panel_up( INFO_X1+5, y, INFO_X2-5, y+8+font_cara_w.max_font_height ); font_cara_w.center_put( INFO_X1+5, y, INFO_X2-5, y+8+font_cara_w.max_font_height, nation_array[brush_player_recno]->nation_name() ); } y+=30; // ------- treasure, food, reputation --------// button_cash_up.create_text( INFO_X1+140, y, INFO_X1+150, y+9, "+" ); button_cash_down.create_text( INFO_X1+140, y+10, INFO_X1+150, y+19, "-" ); button_food_up.create_text( INFO_X1+140, y+22, INFO_X1+150, y+31, "+" ); button_food_down.create_text( INFO_X1+140, y+32, INFO_X1+150, y+41, "-" ); button_reput_up.create_text( INFO_X1+140, y+44, INFO_X1+150, y+53, "+" ); button_reput_down.create_text( INFO_X1+140, y+54, INFO_X1+150, y+63, "-" ); button_live_up.create_text( INFO_X1+140, y+66, INFO_X1+150, y+75, "+" ); button_live_down.create_text( INFO_X1+140, y+76, INFO_X1+150, y+85, "-" ); // button_adjustment[0].create_text( INFO_X1+152, y, INFO_X1+214, y+18, text_editor.str_fine_coarse(0) ); // "Fine" ); // button_adjustment[1].create_text( INFO_X1+152, y+20, INFO_X1+214, y+38, text_editor.str_fine_coarse(1) ); // "Medium" ); // button_adjustment[2].create_text( INFO_X1+152, y+40, INFO_X1+214, y+58, text_editor.str_fine_coarse(2) ); // "Coarse" ); if( !nation_array.is_deleted(brush_player_recno) ) { vga_buffer.bar( INFO_X1+15, y, INFO_X2-10, y+66, V_BLACK ); Nation *nationPtr = nation_array[brush_player_recno]; // -------- treasure --------// font_whbl.put( INFO_X1+15, y, text_editor.str_player_treasure() ); //"Treasure" ); font_whbl.right_put( INFO_X1+140-4, y, m.format( (int)nationPtr->cash, 2) ); button_cash_up.paint(); button_cash_down.paint(); // --------- food ----------// font_whbl.put( INFO_X1+15, y+22, text_editor.str_player_food() ); // "Food" ); font_whbl.right_put( INFO_X1+140-4, y+22, m.format((int)nationPtr->food) ); button_food_up.paint(); button_food_down.paint(); // --------- reputation -------// font_whbl.put( INFO_X1+15, y+44, text_editor.str_player_reputation() ); // "Reputation" ); font_whbl.right_put( INFO_X1+140-4, y+44, m.format( (int)nationPtr->reputation) ); button_reput_up.paint(); button_reput_down.paint(); // --------- live points ---------// font_whbl.put( INFO_X1+15, y+66, text_editor.str_player_live_points() ); // "Life Points" ); font_whbl.right_put( INFO_X1+140-4, y+66, m.format( (int)nationPtr->live_points) ); button_live_up.paint(); button_live_down.paint(); } y += 87; button_adjustment[0].create_text( INFO_X1+147, y+18, INFO_X1+216, y+38, text_editor.str_fine_coarse(0) ); // "Fine" ); button_adjustment[1].create_text( INFO_X1+76, y+18, INFO_X1+145, y+38, text_editor.str_fine_coarse(1) ); // "Medium" ); button_adjustment[2].create_text( INFO_X1+5, y+18, INFO_X1+74, y+38, text_editor.str_fine_coarse(2) ); // "Coarse" ); font_whbl.put( INFO_X1+15, y, text_editor.str_adjustment() ); button_adjustment.paint(); // ------- player type --------// // button_player_type[0].create_text( INFO_X1+50, y, INFO_X1+100, y+18, "Either" ); // button_player_type[1].create_text( INFO_X1+50, y, INFO_X1+100, y+18, "Computer" ); if( !nation_array.is_deleted(brush_player_recno) ) { // button_player_type.paint( nation_array[brush_player_recno]->is_ai() ); } }