Exemplo n.º 1
0
//--------- Begin of function Info::disp_rank ---------//
//
void Info::disp_rank(int refreshFlag)
{
	set_rank_data(1);		// 1-only set those nations that have contact with us

	int x=NATION_BROWSE_X1+9;
	int y=NATION_BROWSE_Y1+3;

	vga_back.d3_panel_up(NATION_BROWSE_X1, NATION_BROWSE_Y1, NATION_BROWSE_X2, NATION_BROWSE_Y1+32 );

	font_san.put( x	 , y+7, _("Kingdom") );
	font_san.put( x+180, y+7, _("Population") );
	font_san.put( x+264, y+7, _("Military") );
	font_san.put( x+332, y+7, _("Economy") );
	font_san.put( x+406, y+7, _("Reputation") );
	// TRANSLATORS: Part of "Fryhtan Battling"
	font_san.put( x+484, y  , _("Fryhtan") );
	// TRANSLATORS: Part of "Fryhtan Battling"
	font_san.put( x+484, y+13, _("Battling") );

	if( refreshFlag == INFO_REPAINT )
	{
		browse_nation.init( NATION_BROWSE_X1, NATION_BROWSE_Y1+34, NATION_BROWSE_X2, NATION_BROWSE_Y2,
								  0, 22, nation_filter(), put_nation_rec, 1 );

		browse_nation.open(browse_nation_recno);
	}
	else
	{
		browse_nation.paint();
		browse_nation.open(browse_nation_recno, nation_filter());
	}

	//----- display score -------//

	disp_score();

	//------ display goal -------//

	if( !game.game_has_ended )	// if the ending screen has already appeared once, don't display the goal
	{
		disp_goal();
		y = NATION_GOAL_Y2+6;
	}
	else
	{
		y = NATION_GOAL_Y1;
	}

	//----- display total playing time -----//

	disp_play_time(y);
}
Exemplo n.º 2
0
//--------- Begin of function Info::disp_spy ---------//
//
void Info::disp_spy(int refreshFlag)
{
	//------- Display the spy report -------//

	int x=SPY_BROWSE_X1+9;
	int y=SPY_BROWSE_Y1+4;

	vga_back.d3_panel_up(SPY_BROWSE_X1, SPY_BROWSE_Y1, SPY_BROWSE_X2, SPY_BROWSE_Y1+20 );

#if(defined(FRENCH))
	font_san.put( x	 , y, "Spy Name" );
	font_san.put( x+155, y, "Cloak" );
	font_san.put( x+205, y, "Location" );
	font_san.put( x+320, y, "Skill" );
	font_san.put( x+384, y, "Loyalty" );
	font_san.put( x+448, y, "Action" );
#else
	// German and US
	font_san.put( x	 , y, "Spy Name" );
	font_san.put( x+155, y, "Cloak" );
	font_san.put( x+205, y, "Location" );
	font_san.put( x+330, y, "Skill" );
	font_san.put( x+370, y, "Loyalty" );
	font_san.put( x+435, y, "Action" );
#endif

	if( refreshFlag == INFO_REPAINT )
	{
		browse_spy.init( SPY_BROWSE_X1, SPY_BROWSE_Y1+22, SPY_BROWSE_X2, SPY_BROWSE_Y2-20,
								 0, 21, spy_filter(), put_spy_rec, 1 );

		browse_spy.open(browse_spy_recno);
	}
	else
	{
		browse_spy.paint();
		browse_spy.open(browse_spy_recno, spy_filter());
	}

	//--------- Display total ------------//

	disp_total();
}
Exemplo n.º 3
0
//--------- Begin of function Info::disp_news_log ---------//
//
void Info::disp_news_log(int refreshFlag)
{
	int x=NEWS_BROWSE_X1+9;
	int y=NEWS_BROWSE_Y1+4;

	if( refreshFlag == INFO_REPAINT )
	{
		browse_news.init( NEWS_BROWSE_X1, NEWS_BROWSE_Y1, NEWS_BROWSE_X2, NEWS_BROWSE_Y2,
								0, 32, news_array.size(), put_news_rec, 1 );

		browse_news.open(browse_news_recno);
	}
	else
	{
		browse_news.paint();
		browse_news.open(browse_news_recno, news_array.size());
	}

	//------- display button ---------//

	image_icon.put_back(ZOOM_X2-27, ZOOM_Y2-23, "NEWS_LOG");	// news log report
}
Exemplo n.º 4
0
// ----- 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);

}
Exemplo n.º 5
0
//--------- Begin of function Info::disp_economy ---------//
//
void Info::disp_economy(int refreshFlag)
{
	//------- display the income report -------//

	int x=INCOME_BROWSE_X1+9;
	int y=INCOME_BROWSE_Y1+4;

	vga_back.d3_panel_up(INCOME_BROWSE_X1, INCOME_BROWSE_Y1, INCOME_BROWSE_X2, INCOME_BROWSE_Y1+20 );

	font_san.put( x	 , y, "Income Item" );
	font_san.put( x+350, y, "Yearly Income" );

	int incomeCount;		// only display the cheat income if it amount is > 0

	if( nation_array[info.viewing_nation_recno]->income_365days(INCOME_CHEAT) > 0 &&
		 (sys.testing_session || info.viewing_nation_recno == nation_array.player_recno) )		// only display cheat amount in debug mode or cheat amount of the player's kingdom, do not display cheat amount on AI kingdoms
	{
		incomeCount = INCOME_TYPE_COUNT;
	}
	else
		incomeCount = INCOME_TYPE_COUNT-1;

	if( refreshFlag == INFO_REPAINT )
	{
		browse_income.init( INCOME_BROWSE_X1, INCOME_BROWSE_Y1+22, INCOME_BROWSE_X2, INCOME_BROWSE_Y2-20,
								0, 16, incomeCount, put_income_rec, 1 );

		browse_income.open(browse_income_recno);		// if refreshFlag is INFO_UPDATE, keep the original top_rec_no of the browser
	}
	else
	{
		browse_income.paint();
		browse_income.open(browse_income_recno, incomeCount);
	}

	//------- display the expense report -------//

	x=EXPENSE_BROWSE_X1+9;
	y=EXPENSE_BROWSE_Y1+4;

	vga_back.d3_panel_up(EXPENSE_BROWSE_X1, EXPENSE_BROWSE_Y1, EXPENSE_BROWSE_X2, EXPENSE_BROWSE_Y1+20 );

	font_san.put( x	 , y, "Expense Item" );
	font_san.put( x+350, y, "Yearly Expense" );

	if( refreshFlag == INFO_REPAINT )
	{
		browse_expense.init( EXPENSE_BROWSE_X1, EXPENSE_BROWSE_Y1+22, EXPENSE_BROWSE_X2, EXPENSE_BROWSE_Y2-20,
							0, 16, EXPENSE_TYPE_COUNT, put_expense_rec, 1 );

		browse_expense.open(browse_expense_recno);		// if refreshFlag is INFO_UPDATE, keep the original top_rec_no of the browser
	}
	else
	{
		browse_expense.paint();
		browse_expense.open(browse_expense_recno, EXPENSE_TYPE_COUNT);		// if refreshFlag is INFO_UPDATE, keep the original top_rec_no of the browser
	}

	//--------- display total ----------//

	disp_total();
}
Exemplo n.º 6
0
//--------- Begin of static function disp_talk_msg_sent ---------//
//
static void disp_talk_msg_sent(int refreshFlag)
{
	//--- filter out talk messages sent by this nation and sort them by date ---//

	TalkMsg* 	talkMsg;
	TalkMsgDisp talkMsgDisp;

	static short lastNationRecno=0;
	int nationRecno = nation_filter(info.browse_nation_recno);

	if( lastNationRecno != nationRecno )
	{
		info.browse_talk_msg_recno = 1;		// reset the browser recno of the viewing nation has been changed
		lastNationRecno = nationRecno;
	}

	//--------------------------------------------//

	info.talk_msg_disp_array.zap();

	for( short i=1 ; i<=talk_res.talk_msg_count() ; i++ )
	{
		if( talk_res.is_talk_msg_deleted(i) )
			continue;

		talkMsg = talk_res.get_talk_msg(i);

		if( !talkMsg->is_valid_to_disp() )		// don't link it out, otherwise it may cause multiplayer sync problem. 
			continue;

		if( talkMsg->from_nation_recno == nationRecno ||
			 talkMsg->to_nation_recno == nationRecno )
		{
			if( talkMsg->from_nation_recno == info.viewing_nation_recno ||
				 talkMsg->to_nation_recno == info.viewing_nation_recno )
			{
				if( !nation_array.is_deleted(talkMsg->from_nation_recno) &&
					 !nation_array.is_deleted(talkMsg->to_nation_recno) )
				{
					talkMsgDisp.recno = i;
					talkMsgDisp.date  = talkMsg->date;
					talkMsgDisp.is_reply = 0;

					info.talk_msg_disp_array.linkin(&talkMsgDisp);

					if( talkMsg->reply_date )
					{
						talkMsgDisp.recno = i;
						talkMsgDisp.date  = talkMsg->reply_date;
						talkMsgDisp.is_reply = 1;

						info.talk_msg_disp_array.linkin(&talkMsgDisp);
					}
				}
			}
		}
	}

	if( info.talk_msg_disp_array.size() > 0 )
		info.talk_msg_disp_array.quick_sort(sort_talk_msg);

	//----- display a browser of the talk msg sent -----//

	if( refreshFlag == INFO_REPAINT || !browse_talk_msg.init_flag )
	{
		browse_talk_msg.init( REPORT_DET_X1, REPORT_DET_Y1, REPORT_DET_X2, REPORT_DET_Y2,
									 0, 30, info.talk_msg_disp_array.size(), put_talk_msg_rec, 1 );

		browse_talk_msg.open(info.browse_talk_msg_recno);
	}
	else
	{
		browse_talk_msg.paint();
		browse_talk_msg.open(info.browse_talk_msg_recno, info.talk_msg_disp_array.size());
	}

	info.browse_talk_msg_recno = browse_talk_msg.recno();
}
Exemplo n.º 7
0
//--------- Begin of function Info::disp_nation ---------//
//
// <int> refreshFlag - INFO_REPAINT - the user has just switched
//												  to this report.
//							  INFO_UPDATE  - the report is already in this mode,
//												  just keep displaying and updating.
//
void Info::disp_nation(int refreshFlag)
{
	//--------- Create nation income and expenses browsers -------//

	int x=REPORT_BROWSE_X1+9, y=REPORT_BROWSE_Y1+4;

	vga_back.d3_panel_up(REPORT_BROWSE_X1, REPORT_BROWSE_Y1, REPORT_BROWSE_X2, REPORT_BROWSE_Y1+33 );

	font_san.put( x	 , y+7, "Kingdom" );

	font_san.put( x+185, y+7, "Reputation" );
	font_san.put( x+275, y+7, "Status" );


#if(defined(SPANISH))
	font_san.put( x+335, y   , "Allow" );
	font_san.put( x+335, y+13, "Attack" );

	font_san.put( x+395, y,    "Acuerdo" );
	font_san.put( x+395, y+13, "Comerc." );

	font_san.put( x+468, y   , "Cantidad" );
	font_san.put( x+468, y+13, "Comerciada" );
#elif(defined(FRENCH))
	font_san.put( x+335, y   , "Allow" );
	font_san.put( x+335, y+13, "Attack" );

	font_san.put( x+395, y,    "Accord" );
	font_san.put( x+395, y+13, "Commercial" );

	font_san.put( x+473, y   , "Montant" );
	font_san.put( x+473, y+13, "Commercial" );
#elif(defined(GERMAN))
	font_san.put( x+345, y   , "Allow" );
	font_san.put( x+343, y+13, "Attack" );

	font_san.put( x+405, y   , "Handels-" );
	font_san.put( x+405, y+13, "Vertrag" );

	font_san.put( x+465, y   , "Handels-" );
	font_san.put( x+465, y+13, "Betrag" );
#else
	font_san.put( x+345, y   , "Allow" );
	font_san.put( x+343, y+13, "Attack" );

	font_san.put( x+405, y   , "Trade" );
	font_san.put( x+405, y+13, "Treaty" );

	font_san.put( x+465, y   , "Trade" );
	font_san.put( x+465, y+13, "Amount" );
#endif


	if( refreshFlag == INFO_REPAINT )
	{
		browse_nation.init( REPORT_BROWSE_X1, REPORT_BROWSE_Y1+35, REPORT_BROWSE_X2, REPORT_BROWSE_Y2,
								  0, 20, nation_filter(), put_nation_rec, 1 );

		browse_nation.open(browse_nation_recno);
	}
	else
	{
		browse_nation.paint();
		browse_nation.open(browse_nation_recno, nation_filter());
	}

	browse_nation_recno = browse_nation.recno();

	//------- disp report buttons --------//

	disp_button();

	//--------- display detail info --------//

	if( refreshFlag==INFO_REPAINT )
	{
		info.last_talk_nation_recno = 0;
		browse_talk_msg_recno = 1;
	}

	disp_detail(refreshFlag);
}
Exemplo n.º 8
0
//--------- Begin of function Info::disp_nation ---------//
//
// <int> refreshFlag - INFO_REPAINT - the user has just switched
//												  to this report.
//							  INFO_UPDATE  - the report is already in this mode,
//												  just keep displaying and updating.
//
void Info::disp_nation(int refreshFlag)
{
	int hideNationBrowse = nation_report_mode == NATION_REPORT_CHAT
		&& hide_nation_browse;

	//--------- Create nation income and expenses browsers -------//

	if( !hideNationBrowse )
	{
		int x=REPORT_BROWSE_X1+9, y=REPORT_BROWSE_Y1+4;

		vga_back.d3_panel_up(REPORT_BROWSE_X1, REPORT_BROWSE_Y1, REPORT_BROWSE_X2, REPORT_BROWSE_Y1+33 );

		font_bld.put( x	 , y+7, text_reports.str_nat_kingdom()); // "Kingdom" );
#if(defined(CHINESE))
		font_bld.right_put( x+235 +3, y+7, text_reports.str_nat_reputation()); // "Reputation" );
		font_bld.put( x+265 -6, y+7, text_reports.str_nat_status()); // "Status" );
#else
		font_bld.right_put( x+235, y+7, text_reports.str_nat_reputation());
		font_bld.put( x+265, y+7, text_reports.str_nat_status()); // "Status" );
#endif

#if(defined(CHINESE))
		font_bld.put_paragraph( x+343-8, y+7, x+405, y+28+7, text_reports.str_nat_allow_attack(), 0 );
#else
	#if(defined(GERMAN))
		#define X_SHIFT -5
	#else
		#define X_SHIFT 0
	#endif
		font_bld.put_paragraph( x+343+X_SHIFT, y, x+405+X_SHIFT, y+28, text_reports.str_nat_allow_attack(), 0 );
	#undef X_SHIFT
#endif

		//SXM
#if(defined(CHINESE))
		font_bld.put_paragraph( x+405 -16, y+7, x+465, y+28+7, text_reports.str_nat_trade_treaty(), 0 );
		font_bld.put_paragraph( x+465 -14, y+7, x+525, y+28+7, text_reports.str_nat_trade_amount(), 0 );
#else
	//	font_bld.put( x+405, y   , "Trade" );
	//	font_bld.put( x+405, y+13, "Treaty" );
		font_bld.put_paragraph( x+405, y, x+465, y+28, text_reports.str_nat_trade_treaty(), 0 );
	//	font_bld.put( x+465, y   , "Trade" );
	//	font_bld.put( x+465, y+13, "Amount" );
		font_bld.put_paragraph( x+465, y, x+525, y+28, text_reports.str_nat_trade_amount(), 0 );
#endif
		//SXM
	}

	if( refreshFlag == INFO_REPAINT )
	{
		browse_nation.init( REPORT_BROWSE_X1, REPORT_BROWSE_Y1+35, REPORT_BROWSE_X2, REPORT_BROWSE_Y2,
								  0, 20, info.nation_filter(), put_nation_rec, 1 );

		if( !hideNationBrowse )
			browse_nation.open(browse_nation_recno);
	}
	else
	{
		if( !hideNationBrowse )
		{
			browse_nation.paint();
			browse_nation.open(browse_nation_recno, nation_filter());
		}
	}

	if( !hideNationBrowse )
		browse_nation_recno = browse_nation.recno();
	else
	{
		int nCount;
		if( browse_nation_recno > (nCount = nation_filter()) )
			browse_nation_recno = nCount;		// avoid browse_nation_recno too large
	}


	//------- disp report buttons --------//

	disp_button();

	//--------- display detail info --------//

	if( refreshFlag==INFO_REPAINT )
	{
		info.last_talk_nation_recno = 0;
		browse_talk_msg_recno = 1;
	}

	disp_detail(refreshFlag);
}
Exemplo n.º 9
0
//--------- Begin of function Info::disp_town ---------//
//
void Info::disp_town(int refreshFlag)
{
	int x=TOWN_BROWSE_X1+9;
	int y=TOWN_BROWSE_Y1+4;

	vga_back.d3_panel_up(TOWN_BROWSE_X1, TOWN_BROWSE_Y1, TOWN_BROWSE_X2, TOWN_BROWSE_Y1+20 );

	font_san.put( x	 , y, _("Village") );
	font_san.put( x+150, y, _("Villagers") );
	font_san.put( x+225, y, _("Peasants") );
	font_san.put( x+295, y, _("Loyalty") );
	font_san.put( x+355, y, _("Races") );

	if( refreshFlag == INFO_REPAINT )
	{
		browse_town.init( TOWN_BROWSE_X1, TOWN_BROWSE_Y1+22, TOWN_BROWSE_X2, TOWN_BROWSE_Y2-20,
								0, 21, town_filter(), put_town_rec, 1 );

		browse_town.open(browse_town_recno);
	}
	else
	{
		browse_town.paint();
		browse_town.open(browse_town_recno, town_filter());
	}

	//------- Display the firm report -------//

	calc_firm_total();

	x=FIRM_BROWSE_X1+9;
	y=FIRM_BROWSE_Y1+4;

	vga_back.d3_panel_up(FIRM_BROWSE_X1, FIRM_BROWSE_Y1, FIRM_BROWSE_X2, FIRM_BROWSE_Y1+20 );

	font_san.put( x	 , y, _("Structure") );
	font_san.put( x+140, y, _("Unit Cost") );
#if(defined(FRENCH))
	font_san.put( x+237, y, "No. of Structures" );
#else
	font_san.put( x+217, y, _("No. of Structures") );
#endif
	font_san.put( x+340, y, _("Yearly Expense") );
	font_san.put( x+450, y, _("Yearly Income") );

	if( refreshFlag == INFO_REPAINT )
	{
		browse_firm.init( FIRM_BROWSE_X1, FIRM_BROWSE_Y1+22, FIRM_BROWSE_X2, FIRM_BROWSE_Y2-20,
								0, 16, firm_filter(), put_firm_rec, 1 );

		browse_firm.open(browse_firm_recno);
	}
	else
	{
		browse_firm.paint();
		browse_firm.open(browse_firm_recno, firm_filter());
	}

	//--------- Display total ------------//

	disp_total();
}
Exemplo n.º 10
0
//--------- Begin of function Info::disp_military ---------//
//
void Info::disp_military(int refreshFlag)
{
	//------- Display the Troop report -------//

	int x=TROOP_BROWSE_X1+9;
	int y=TROOP_BROWSE_Y1+4;

	vga_back.d3_panel_up(TROOP_BROWSE_X1, TROOP_BROWSE_Y1, TROOP_BROWSE_X2, TROOP_BROWSE_Y1+33 );

	#if(defined(FRENCH))
		font_san.put( x	 , y+7 , "Commander" );
		font_san.put( x+170, y+7,  "Leadership" );
		font_san.put( x+275, y+7,  "Loyalty" );
		font_san.put( x+350, y,    "Points" );
		font_san.put( x+350, y+13, "de vie" );
		font_san.put( x+410, y+7,  "Garnison" );
		font_san.put( x+480, y+7, "Status" );
	#elif(defined(GERMAN))
		font_san.put( x	 , y+7 , "Commander" );
		font_san.put( x+210, y+7 , "Leadership" );
		font_san.put( x+275, y+7 , "Loyalty" );
		font_san.put( x+342, y+7 , "Hit Points" );
		font_san.put( x+406, y   , "Commanded" );
		font_san.put( x+415, y+13, "Soldiers" );
		font_san.put( x+485, y+7 , "Status" );
	#else
		font_san.put( x	 , y+7 , "Commander" );
		font_san.put( x+200, y+7 , "Leadership" );
		font_san.put( x+285, y+7 , "Loyalty" );
		font_san.put( x+342, y+7 , "Hit Points" );
		font_san.put( x+406, y   , "Commanded" );
		font_san.put( x+423, y+13, "Soldiers" );
		font_san.put( x+490, y+7 , "Status" );
	#endif

	if( refreshFlag == INFO_REPAINT )
	{
		browse_troop.init( TROOP_BROWSE_X1, TROOP_BROWSE_Y1+35, TROOP_BROWSE_X2, TROOP_BROWSE_Y2-20,
								 0, 22, troop_filter(), put_troop_rec, 1 );

		browse_troop.open(browse_troop_recno);
	}
	else
	{
		browse_troop.paint();
		browse_troop.open(browse_troop_recno, troop_filter());
	}

	disp_troop_total();

	//------- Display the unit report -------//

	x=UNIT_BROWSE_X1+9;
	y=UNIT_BROWSE_Y1+4;

	vga_back.d3_panel_up(UNIT_BROWSE_X1, UNIT_BROWSE_Y1, UNIT_BROWSE_X2, UNIT_BROWSE_Y1+20 );

	font_san.put( x	 , y, "Unit Type" );
	font_san.put( x+300, y, "No. of Units" );

	if( refreshFlag == INFO_REPAINT )
	{
		browse_unit.init( UNIT_BROWSE_X1, UNIT_BROWSE_Y1+22, UNIT_BROWSE_X2, UNIT_BROWSE_Y2-20,
								0, 16, unit_filter(), put_unit_rec, 1 );

		browse_unit.open(browse_unit_recno);
	}
	else
	{
		browse_unit.paint();
		browse_unit.open(browse_unit_recno, unit_filter());
	}

	disp_unit_total();
}
Exemplo n.º 11
0
// ----- 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() );
	}
}