Example #1
0
//--------- Begin of function Info::disp_trade ---------//
//
void Info::disp_trade()
{
	create_caravan_list();
//	create_ship_list();

	//-------- display the caravan browser --------//

	int x=CARAVAN_BROWSE_X1+9;
	int y=CARAVAN_BROWSE_Y1+4;

	vga_back.d3_panel_up(CARAVAN_BROWSE_X1, CARAVAN_BROWSE_Y1, CARAVAN_BROWSE_X2, CARAVAN_BROWSE_Y1+20 );

	font_bld.put( x	 , y, unit_res[UNIT_CARAVAN]->name ); // "Caravan" );
	font_bld.put( x+78 , y, text_unit.str_hit_points() ); // "Hit Points" );
	font_bld.put( x+160, y, text_reports.str_trade_stop(1) ); // "Stop 1" );
	font_bld.put( x+250, y, text_reports.str_trade_stop(2) ); // "Stop 2" );
	font_bld.put( x+340, y, text_reports.str_goods_carried() ); //"Goods Carried" );

	// ###### begin Gilbert 19/10 #######//
	browse_caravan.init( CARAVAN_BROWSE_X1, CARAVAN_BROWSE_Y1+22, CARAVAN_BROWSE_X2, CARAVAN_BROWSE_Y2-20,
								0, 18, report_array.size(), put_caravan_rec, 1 );
	// ###### end Gilbert 19/10 #######//

	browse_caravan.open(browse_caravan_recno);

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

	disp_total();
}
Example #2
0
//--------- Begin of function Info::disp_economy ---------//
//
void Info::disp_economy()
{
	//------- 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_bld.put( x	 , y, text_reports.str_income_item() ); // "Income Item" );
	font_bld.put( x+350, y, text_reports.str_yearly_income() ); // "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;

	// ####### begin Gilbert 19/10 ######//
	browse_income.init( INCOME_BROWSE_X1, INCOME_BROWSE_Y1+22, INCOME_BROWSE_X2, INCOME_BROWSE_Y2-20,
							0, 18, incomeCount, put_income_rec, 1 );
	// ####### begin Gilbert 19/10 ######//

	browse_income.open(browse_income_recno);

	//------- 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_bld.put( x	 , y, text_reports.str_expense_item() ); // "Expense Item" );
	font_bld.put( x+350, y, text_reports.str_yearly_expense() ); // "Yearly Expense" );

	// ####### begin Gilbert 19/10 ######//
	browse_expense.init( EXPENSE_BROWSE_X1, EXPENSE_BROWSE_Y1+22, EXPENSE_BROWSE_X2, EXPENSE_BROWSE_Y2-20,
						0, 18, EXPENSE_TYPE_COUNT, put_expense_rec, 1 );
	// ####### end Gilbert 19/10 ######//

	browse_expense.open(browse_expense_recno);

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

	disp_total();
}
Example #3
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();
}
Example #4
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();
}
Example #5
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();
}