Пример #1
0
void TalkRes::player_reply(int talkMsgRecno)
{
	//------- set the reply choices --------//

	err_when( is_talk_msg_deleted(talkMsgRecno) );

	TalkMsg* talkMsg = get_talk_msg(talkMsgRecno);

	if( nation_array.is_deleted(talkMsg->from_nation_recno) )
		return;

	init_conversion(talkMsg->from_nation_recno);

	talk_choice_count    = 0;
	cur_choice_id 		   = 0;
	reply_talk_msg_recno = talkMsgRecno;

	//--------- add talk choices ---------//

	static String msgStr, msgStr2;

	msgStr = talkMsg->msg_str(nation_array.player_recno);		// make a static copy of it.
	choice_question = msgStr;

	//---- see if this message has a second line -----//

	msgStr2 = talkMsg->msg_str(nation_array.player_recno, 0, 1);		// 1-display the second line of the question

	if( msgStr!=msgStr2 )
		choice_question_second_line = msgStr2;
	else
		choice_question_second_line = NULL;

	//--------- add choices to the question ---------//

	if( talkMsg->can_accept() )			// whether the replier can accept the request or demand of the message
		add_talk_choice( text_talk.str_accept_(), 1 ); // "Accept.", 1 );

	add_talk_choice( text_talk.str_reject_(), 0 ); // "Reject.", 0 );

	//--- switch to the nation report mode and go to the diplomacy mode ---//

	info.init_player_reply( talkMsg->from_nation_recno );

	save_view_mode = sys.view_mode;

	sys.set_view_mode(MODE_NATION);
}
Пример #2
0
//------ Begin of function News::diplomacy -----//
//
// Diplomatic messages from other nations.
//
// short_para1 = the recno of TalkMsg in talk_res.talk_msg_array.
//
void News::diplomacy()
{
	err_when( talk_res.is_talk_msg_deleted(short_para1) );

	TalkMsg* talkMsgPtr = talk_res.get_talk_msg(short_para1);

	str = talkMsgPtr->msg_str(nation_array.player_recno);
}
Пример #3
0
//-------- Begin of static function put_talk_msg_rec --------//
//
static void put_talk_msg_rec(int recNo, int x1, int y, int refreshFlag)
{
	TalkMsgDisp* talkMsgDisp = (TalkMsgDisp*) info.talk_msg_disp_array.get(recNo);
	TalkMsg*		 talkMsg = talk_res.get_talk_msg(talkMsgDisp->recno);

	int x=x1, isTo;

	x+=3;
	y+=2;

	if( !talkMsgDisp->is_reply )		// if not a replying message
		isTo = talkMsg->from_nation_recno == info.viewing_nation_recno;	// you send a message to a nation
	else
		isTo = talkMsg->from_nation_recno != info.viewing_nation_recno;

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

//	char* str1;
//	if( isTo )
//		str1 = translate.process("To");
//	else
//		str1 = translate.process("From");
//	font_bld.put( x , y, str1 );
//	x += font_bld.text_width(str1)+5;

	x = font_bld.put( x, y, isTo?text_reports.str_send_to():text_reports.str_send_from() );
	x += 5;

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

	if( talkMsg->from_nation_recno == info.viewing_nation_recno )
		nation_array[talkMsg->to_nation_recno]->disp_nation_color(x, y+2);
	else
		nation_array[talkMsg->from_nation_recno]->disp_nation_color(x, y+2);

	x+=18;

	String str;
//	str = translate.process("on ");
//	if( talkMsgDisp->is_reply )
//		str += date.date_str(talkMsg->reply_date);
//	else
//		str += date.date_str(talkMsg->date);
//	str += " :";
//	font_bld.put( x , y, str );

	if( talkMsgDisp->is_reply )
		str = date.date_str(talkMsg->reply_date);
	else
		str = date.date_str(talkMsg->date);
	font_bld.put( x, y, text_reports.str_on_date((char *)str) );

	font_bld.put( x1, y+13, talkMsg->msg_str(info.viewing_nation_recno, talkMsgDisp->is_reply), 0, browse_talk_msg.ix2 );
}