Example #1
0
//--------- Begin of function Info::detect_military ---------//
//
void Info::detect_military()
{
	//------- detect the troop report -------//

	if( browse_troop.detect() )
	{
		browse_troop_recno = browse_troop.recno();

		if( browse_troop.double_click )
		{
			Unit* unitPtr = unit_array[ troop_filter(browse_troop_recno) ];
			short xLoc, yLoc;

			if( unitPtr->get_cur_loc(xLoc, yLoc) )
			{
				world.go_loc(xLoc, yLoc, 1);
			}
		}
	}

	//------- detect the unit report -------//

	if( browse_unit.detect() )
	{
		browse_unit_recno = browse_unit.recno();
	}
}
Example #2
0
//--------- Begin of function Info::detect_trade ---------//
//
void Info::detect_trade()
{
	//-------- detect the caravan browser ---------//

	if( browse_caravan.detect() )
	{
		browse_caravan_recno = browse_caravan.recno();

		if( browse_caravan.double_click )
		{
			Unit* unitPtr = unit_array[ get_report_data(browse_caravan_recno) ];

			world.go_loc(unitPtr->next_x_loc(), unitPtr->next_y_loc(), 1);
		}
	}

	//-------- detect the ship browser ---------//

/*
	if( browse_ship.detect() )
	{
		browse_ship_recno = browse_ship.recno();

		if( browse_ship.double_click )
		{
			Unit* unitPtr = unit_array[ get_report_data2(browse_ship_recno) ];

			world.go_loc(unitPtr->next_x_loc(), unitPtr->next_y_loc(), 1);
		}
	}
*/
}
Example #3
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 #4
0
//--------- Begin of function Info::detect_economy ---------//
//
void Info::detect_economy()
{
	if( browse_income.detect() )
		browse_income_recno = browse_income.recno();

	if( browse_expense.detect() )
		browse_expense_recno = browse_expense.recno();
}
Example #5
0
//--------- Begin of function Info::detect_ai_action ---------//
//
void Info::detect_ai_action()
{
	if( browse_action.detect() )
		browse_ai_action_recno = browse_action.recno();

	if( browse_attack.detect() )
		browse_ai_attack_recno = browse_attack.recno();
}
Example #6
0
//--------- Begin of function Info::detect_news_log ---------//
//
void Info::detect_news_log()
{
	if( browse_news.detect() )
		browse_news_recno = browse_news.recno();

	//--------- detect button --------//

	if( mouse.single_click( ZOOM_X2-27, ZOOM_Y2-23, ZOOM_X2-27+14, ZOOM_Y2-23+14 ) )
		sys.set_view_mode(MODE_NORMAL);
}
Example #7
0
//--------- Begin of function Info::detect_rank ---------//
//
void Info::detect_rank()
{
	//------- detect nation browser ------//

	if( browse_nation.detect() )
	{
		browse_nation_recno = browse_nation.recno();
		return;
	}
}
Example #8
0
//--------- Begin of function FirmHarbor::disp_main_menu ---------//
//
void FirmHarbor::disp_main_menu(int refreshFlag)
{
	firm_harbor_ptr = this;

	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_harbor_info() )
		return;

	//-------- display browser -----------//

	if( refreshFlag == INFO_REPAINT )
	{
		browse_ship.init( SHIP_BROWSE_X1, SHIP_BROWSE_Y1, SHIP_BROWSE_X2, SHIP_BROWSE_Y2,
								0, 25, ship_count, put_ship_rec );

		browse_ship.open(1);

		put_det(INFO_REPAINT);
	}
	else
	{
		if( last_ship_count != ship_count )
		{
			last_ship_count = ship_count;
			info.disp();
		}
		else
			browse_ship.update();          // update only
	}

	last_ship_count = ship_count;

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

	if( !own_firm() )
		return;

	//-------- display buttons ---------//

	if( refreshFlag == INFO_REPAINT )
	{
		button_build.paint( SHIP_DET_X1, SHIP_DET_Y2+4, 'A', "MAKESHIP" );
		button_sail.paint ( SHIP_DET_X1+BUTTON_ACTION_WIDTH, SHIP_DET_Y2+4, 'A', "SAILOUT" );
	}

	if( ship_count > 0 )
		button_sail.enable();
	else
		button_sail.disable();

	//------ display the info of the ship under construction ------//

	disp_build_info(refreshFlag);
}
Example #9
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);
}
Example #10
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 #11
0
//--------- Begin of function FirmInn::put_info ---------//
//
void FirmInn::put_info(int refreshFlag)
{
	firm_inn_ptr = this;

	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_info() )
		return;

	//----------- display browser -----------//

	if( refreshFlag == INFO_REPAINT )
	{
		browse_hire.init( HIRE_BROWSE_X1, HIRE_BROWSE_Y1, HIRE_BROWSE_X2, HIRE_BROWSE_Y2,
								0, 25, inn_unit_count, put_hire_rec );

		browse_hire.open(1);
	}
	else
	{
		if( last_hire_count != inn_unit_count )
		{
			if( last_hire_count==0 || inn_unit_count==0 )		// repaint the whole area as the detail area needs to disappear
			{
				last_hire_count = inn_unit_count;
				info.disp();
				return;
			}

			last_hire_count = inn_unit_count;

			browse_hire.refresh(-1, inn_unit_count);

			if( last_hire_count==0 || inn_unit_count==0 )
				refreshFlag = INFO_REPAINT;
		}
		else
			browse_hire.update();          // update only
	}

	last_hire_count = inn_unit_count;

	put_det(refreshFlag);

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

	disp_spy_button(INFO_X1+BUTTON_ACTION_WIDTH, HIRE_DET_Y2+4, refreshFlag);
}
Example #12
0
//--------- Begin of function Info::init_player_reply ---------//
//
// This function is called by TalkRes::player_reply() when the
// player is going to reply to a diplomatic message from another
// nation.
//
// <int> talkToNationRecno - recno of the nation the player is
//									  going to talk to.
//
void Info::init_player_reply(int talkToNationRecno)
{
	nation_report_mode = NATION_REPORT_TALK;

	info.player_reply_mode = 1;

	//--- go to the nation in the browser which the player is going to talk to ---//

	int nationCount = nation_filter();

	int i;
	for( i=1 ; i<=nationCount ; i++ )
	{
		if( nation_filter(i) == talkToNationRecno )
		{
			browse_nation_recno = i;
			break;
		}
	}

	err_when( i>nationCount );

	//----- if currently it's in nation report mode -----//

	if( sys.view_mode == MODE_NATION )
		browse_nation.refresh(browse_nation_recno);
}
Example #13
0
//--------- Begin of static function disp_detail ---------//
//
static void disp_detail(int refreshFlag)
{
	if( browse_nation.recno()==0 )		// no records in the list
		return;

	switch( info.nation_report_mode )
	{
		case NATION_REPORT_INFO:
			disp_nation_info();
			break;

		case NATION_REPORT_TALK:
			disp_nation_talk();
			break;

		case NATION_REPORT_CHAT:
			disp_nation_chat(refreshFlag);
			break;

		case NATION_REPORT_TALK_LOG:
			disp_talk_msg_sent(refreshFlag);
			break;

		case NATION_REPORT_DEBUG:
			disp_debug_info();
			break;
	}
}
Example #14
0
//--------- Begin of function Info::disp_ai_action ---------//
//
void Info::disp_ai_action(int refreshFlag)
{
	cur_nation_ptr = nation_array[info.viewing_nation_recno];

	if( cur_nation_ptr->nation_type != NATION_AI )
		return;

   //------ display the queued action list -------//

	int x=ACTION_BROWSE_X1+9;
	int y=ACTION_BROWSE_Y1+4;

	vga_back.d3_panel_up(ACTION_BROWSE_X1, ACTION_BROWSE_Y1, ACTION_BROWSE_X2, ACTION_BROWSE_Y1+18 );

	font_san.put( x	 , y, "Action Mode" );
	font_san.put( x+120, y, "Action Para" );
	font_san.put( x+220, y, "Add Date" );
	font_san.put( x+320, y, "Instance" );
	font_san.put( x+390, y, "Processing" );
	font_san.put( x+470, y, "Processed" );

	browse_action.init( ACTION_BROWSE_X1, ACTION_BROWSE_Y1+20, ACTION_BROWSE_X2, ACTION_BROWSE_Y2,
							  0, 22, cur_nation_ptr->action_count(), put_action_rec, 1 );

	browse_action.open(browse_ai_action_recno );		// if refreshFlag is INFO_UPDATE, keep the original top_rec_no of the browser

	//------ display the queued action list -------//

	x=ATTACK_BROWSE_X1+9;
	y=ATTACK_BROWSE_Y1+4;

	vga_back.d3_panel_up(ATTACK_BROWSE_X1, ATTACK_BROWSE_Y1, ATTACK_BROWSE_X2, ATTACK_BROWSE_Y1+18 );

	font_san.put( x	 , y, "Firm recno" );
	font_san.put( x+120, y, "Combat level" );
	font_san.put( x+220, y, "Distance" );
	font_san.put( x+320, y, "Patrol Date" );

	browse_attack.init( ATTACK_BROWSE_X1, ATTACK_BROWSE_Y1+20, ATTACK_BROWSE_X2, ATTACK_BROWSE_Y2,
							  0, 22, cur_nation_ptr->attack_camp_count, put_attack_rec, 1 );

	browse_attack.open(browse_ai_attack_recno);		// if refreshFlag is INFO_UPDATE, keep the original top_rec_no of the browser

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

	disp_other_info();
}
Example #15
0
//--------- Begin of static function disp_debug_info ---------//
//
static void disp_debug_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];

	int x1=REPORT_DET_X1+6, x2=REPORT_DET_X1+160;
	int y=REPORT_DET_Y1+6;

	int refreshFlag = INFO_REPAINT;

	//------------ display AI info ----------//

	font_bld.put_field( x1, y    , "Food    ", x2, nationPtr->food_str() );
	font_bld.put_field( x1, y+=16, "Treasure", x2, nationPtr->cash_str() );
	font_bld.put_field( x1, y+=16, "Life points", x2, (int) nationPtr->live_points, 1 );
	font_bld.put_field( x1, y+=16, "ai_capture_enemy_town_recno", x2, nationPtr->ai_capture_enemy_town_recno, 1 );
	font_bld.put_field( x1, y+=16, "Surplus supply rating", x2, nationPtr->surplus_supply_rating() );
	y+=48;

	//--------- display AI preference ----------//

	x2 += 60;

	font_bld.put_field( x1, y+=16, "Unit Chase Distance"     , x2, nationPtr->pref_unit_chase_distance     , 1 );
	font_bld.put_field( x1, y+=16, "Military Development"	   , x2, nationPtr->pref_military_development	 , 1 );
	font_bld.put_field( x1, y+=16, "Economic Development"	   , x2, nationPtr->pref_economic_development	 , 1 );
	font_bld.put_field( x1, y+=16, "Increase Pop by Capture" , x2, nationPtr->pref_inc_pop_by_capture      , 1 );
	font_bld.put_field( x1, y+=16, "Increase Pop by Growth"  , x2, nationPtr->pref_inc_pop_by_growth   	 , 1 );
	font_bld.put_field( x1, y+=16, "Peacefulness" 		      , x2, nationPtr->pref_peacefulness        	 , 1 );
	font_bld.put_field( x1, y+=16, "Military Courage"    	   , x2, nationPtr->pref_military_courage    	 , 1 );
	font_bld.put_field( x1, y+=16, "Territorial Cohesiveness", x2, nationPtr->pref_territorial_cohesiveness, 1 );
	font_bld.put_field( x1, y+=16, "Trading Tendency"        , x2, nationPtr->pref_trading_tendency        , 1 );

	x1 += (REPORT_DET_X2-REPORT_DET_X1)/2;
	x2 += (REPORT_DET_X2-REPORT_DET_X1)/2;

	y=REPORT_DET_Y1+6;

	font_bld.put_field( x1, y    , "Allying Tendency"        , x2, nationPtr->pref_allying_tendency        , 1 );
	font_bld.put_field( x1, y+=16, "Honesty"                 , x2, nationPtr->pref_honesty                 , 1 );
	font_bld.put_field( x1, y+=16, "Town Defense"         	, x2, nationPtr->pref_town_defense			    , 1 );
	font_bld.put_field( x1, y+=16, "Citizen Loyalty Concern" , x2, nationPtr->pref_loyalty_concern  		 , 1 );
	font_bld.put_field( x1, y+=16, "Forgiveness"             , x2, nationPtr->pref_forgiveness      		 , 1 );
	font_bld.put_field( x1, y+=16, "Collect Tax Tendency"    , x2, nationPtr->pref_collect_tax      		 , 1 );
	font_bld.put_field( x1, y+=16, "Build Inn Tendency"      , x2, nationPtr->pref_hire_unit       		    , 1 );
	font_bld.put_field( x1, y+=16, "Use Weapon Tendency"     , x2, nationPtr->pref_use_weapon       		 , 1 );
	font_bld.put_field( x1, y+=16, "Keep Generals Tendency"  , x2, nationPtr->pref_keep_general            , 1 );
	font_bld.put_field( x1, y+=16, "Keep Skilled Units Tendency", x2, nationPtr->pref_keep_skilled_unit    , 1 );
	font_bld.put_field( x1, y+=16, "Attack Monster"          , x2, nationPtr->pref_attack_monster          , 1 );
	font_bld.put_field( x1, y+=16, "Use Spies"               , x2, nationPtr->pref_spy                     , 1 );
	font_bld.put_field( x1, y+=16, "Use Counter Spies"       , x2, nationPtr->pref_counter_spy             , 1 );
	font_bld.put_field( x1, y+=16, "Food Reserve"            , x2, nationPtr->pref_food_reserve            , 1 );
	font_bld.put_field( x1, y+=16, "Cash Reserve"            , x2, nationPtr->pref_cash_reserve            , 1 );
	font_bld.put_field( x1, y+=16, "Use Marine"              , x2, nationPtr->pref_use_marine              , 1 );
}
Example #16
0
//--------- Begin of function FirmHarbor::detect_main_menu ---------//
//
void FirmHarbor::detect_main_menu()
{
	firm_harbor_ptr = this;

	if( detect_basic_info() )
		return;

	if( !own_firm() )
		return;

	if( browse_ship.detect() )
		put_det(INFO_UPDATE);

	if( detect_det() )
		return;

	//------- detect the build button ---------//

	if( button_build.detect() )
	{
		harbor_menu_mode = HARBOR_MENU_BUILD;
		disable_refresh = 1;    // static var for disp_info() only
		info.disp();
		disable_refresh = 0;
	}

	//-------- detect the sail button ---------//

	if( button_sail.detect() && browse_ship.recno() > 0 )
		sail_ship( ship_recno_array[browse_ship.recno()-1], COMMAND_PLAYER );

	//---------- detect cancel build button -----------//
	if(build_unit_id)
	{
		if(button_cancel_build.detect())
		{
			if( !remote.is_enable() )
				cancel_build_unit();
			else
			{
				short *shortPtr = (short *)remote.new_send_queue_msg(MSG_F_HARBOR_SKIP_SHIP, sizeof(short));
				shortPtr[0] = firm_recno;
			}
		}
	}
}
Example #17
0
//--------- Begin of function Info::detect_spy ---------//
//
void Info::detect_spy()
{
	//------- detect the spy browser -------//

	if( browse_spy.detect() )
	{
		browse_spy_recno = browse_spy.recno();

		if( browse_spy.double_click )
		{
			Spy* spyPtr = spy_array[ spy_filter(browse_spy_recno) ];
			int  xLoc, yLoc;

			if( spyPtr->get_loc(xLoc, yLoc) )
				world.go_loc( xLoc, yLoc, 1 );
		}
	}
}
Example #18
0
//--------- Begin of static function detect_nation_info ---------//
//
static void detect_nation_info()
{
	int nationRecno = nation_filter(browse_nation.recno());

	Nation* viewingNation = nation_array[info.viewing_nation_recno];

	if( button_allow_attack.detect() >= 0 )
		viewingNation->set_relation_should_attack(nationRecno, button_allow_attack.button_pressed, COMMAND_PLAYER);
}
Example #19
0
//--------- Begin of function FirmInn::update_del_hire_list --------//
//
void FirmInn::update_del_hire_list()
{
	//------- existing units leave -------//

	for( int i=inn_unit_count ; i>0 && inn_unit_count>0 ; i-- )
	{
		if( !inn_unit_array[i-1].spy_recno && --inn_unit_array[i-1].stay_count==0 )
		{
			del_inn_unit(i);

			if( firm_recno == firm_array.selected_recno )
			{
				if( browse_hire.recno() > i && browse_hire.recno() > 1 )
					browse_hire.refresh( browse_hire.recno()-1, inn_unit_count );
			}
		}
	}
}
Example #20
0
//--------- Begin of function Info::detect_nation ---------//
//
void Info::detect_nation()
{
	//------- detect nation browser ------//

	if( browse_nation.detect() )
	{
		browse_nation_recno = browse_nation.recno();
		return;
	}

	//------- detect report buttons --------//

	if( detect_button() )
		return;

	//--------- detect detail info -------//

	detect_detail();
}
Example #21
0
// ----- begin of function ScenarioEditor::detect_monster_main ------//
//
void ScenarioEditor::detect_monster_main()
{
	// detect interface area
	int rc;

	if (!spinner_race_group.vbrowse_enable_flag)
	{
		rc = button_unit_or_struct.detect();
		if( rc >= 0 )
			unit_or_struct = rc;

		rc = button_player_recno.detect();
		if( rc >= 0 )
			brush_player_recno = rc;

		if( !unit_or_struct )
		{
			rc = vbrowse_unit_id.detect();
			// ###### begin gilbert 22/2 ########//
			//if( rc > 0 )
			//	monster_unit_id_browse_recno = rc;
			monster_unit_id_browse_recno = vbrowse_unit_id.recno();
			// ###### end gilbert 22/2 ########//
		}
		else
		{
			rc = vbrowse_firm_build.detect();
			// ###### begin Gilbert 22/2 #########//
			// if( rc > 0 )
			//		monster_firm_group_browse_recno = rc;
			monster_firm_group_browse_recno = vbrowse_firm_build.recno();
			// ###### end Gilbert 22/2 #########//
		}
	}

	//	rc = button_race_group.detect();
	rc = spinner_race_group.detect();
	if( rc >= 0 )
	{
		monster_race_filter = -rc;
		return;
	}
}
Example #22
0
//--------- Begin of function FirmInn::detect_info ---------//
//
void FirmInn::detect_info()
{
	firm_inn_ptr = this;

	if( detect_basic_info() )
		return;

	//-------- detect spy button ----------//

	if( !own_firm() )
	{
		detect_spy_button();
		return;
	}

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

	if( browse_hire.detect() )
	{
		put_det(INFO_UPDATE);
	}

	if( button_hire.detect('R') && inn_unit_count > 0 )
	{
		// ###### begin Gilbert 31/7 #######//
		se_res.far_sound(center_x, center_y, 1, 'S', 
			unit_res[inn_unit_array[browse_hire.recno()-1].unit_id]->sprite_id,
			"RDY" );
		// ###### end Gilbert 31/7 #######//
		if(remote.is_enable())
		{
			// packet structure : <firm recno>, <hire Id> <nation no>
			short *shortPtr=(short *)remote.new_send_queue_msg(MSG_F_INN_HIRE, 3*sizeof(short));
			shortPtr[0] = firm_recno;
			shortPtr[1] = browse_hire.recno();
			shortPtr[2] = nation_recno;
		}
		else
		{
			hire(browse_hire.recno());
		}
	}
}
Example #23
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 #24
0
static void disp_total()
{
	int x = SPY_BROWSE_X1+9;
	int y = SPY_BROWSE_Y2-16;

	vga_back.d3_panel_up(SPY_BROWSE_X1, SPY_BROWSE_Y2-18, SPY_BROWSE_X2, SPY_BROWSE_Y2 );

	String str;

	if( browse_spy.total_rec() > 1 )
		str = "Total Spies";
	else
		str = "Total Spy";

	str  = translate.process(str);
	str += ": ";
	str += browse_spy.total_rec();

	font_san.put( x, y, str );
}
Example #25
0
//--------- Begin of function Info::detect_town ---------//
//
void Info::detect_town()
{
   //------- detect the town browser -------//

	if( browse_town.detect() )
	{
		browse_town_recno = browse_town.recno();

		if( browse_town.double_click )
		{
			Town* townPtr = town_array[ town_filter(browse_town_recno) ];

			world.go_loc(townPtr->center_x, townPtr->center_y, 1);
		}
	}

	//------- detect the firm browser -------//

	if( browse_firm.detect() )
		browse_firm_recno = browse_firm.recno();
}
Example #26
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
}
Example #27
0
//--------- Begin of function Info::detect_nation ---------//
//
void Info::detect_nation()
{
	int hideNationBrowse = nation_report_mode == NATION_REPORT_CHAT
		&& hide_nation_browse;

	//------- detect nation browser ------//

	if( !hideNationBrowse && browse_nation.detect() )
	{
		browse_nation_recno = browse_nation.recno();
		return;
	}

	//------- detect report buttons --------//

	if( detect_button() )
		return;

	//--------- detect detail info -------//

	detect_detail();
}
Example #28
0
//--------- Begin of static function detect_detail ---------//
//
static void detect_detail()
{
	switch( info.nation_report_mode )
	{
		case NATION_REPORT_INFO:
			detect_nation_info();
			break;

		case NATION_REPORT_TALK:
			detect_nation_talk();
			break;

		case NATION_REPORT_CHAT:
			detect_nation_chat();
			break;

		case NATION_REPORT_TALK_LOG:
			if( browse_talk_msg.detect() )
				info.browse_talk_msg_recno = browse_talk_msg.recno();
			break;
	}
}
Example #29
0
//--------- Begin of function FirmInn::put_det ---------//
//
void FirmInn::put_det(int refreshFlag)
{
	if( browse_hire.none_record )
	{
		button_hire.reset();
		return;
	}

	//--------- display details ----------//

	InnUnit* innUnit = inn_unit_array+browse_hire.recno()-1;

	disp_unit_info(HIRE_DET_Y1, innUnit, refreshFlag );

	//------- paint buttons --------//

	if( own_firm() )
	{
		if( refreshFlag == INFO_REPAINT )
		{
			button_hire.paint( HIRE_DET_X1, HIRE_DET_Y2+4, 'A', "HIREUNIT" );
		}
		else
		{
			if( inn_unit_count > 0 &&
				 (~nation_array)->cash >= inn_unit_array[browse_hire.recno()-1].hire_cost )
			{
				button_hire.enable();
			}
			else
			{
				button_hire.disable();
			}
		}
	}
}
Example #30
0
//--------- 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);
	}
}