SLIC-Reference : EyePoint
CTP2 Bureau
The Modding
Knowledgebase
Apolyton CTP2 forums
Apolyton CTP2 archives
Source Code Project SVN

SLIC-Reference : : EyePoint  

Arguments: location|unit|city[, player, messageid] Type: void

Put an eyepoint on the message.

Adds an "eye" button to the current message pointing to the specified location or object. If player and messageid are passed, call that message when the eyepoint is clicked.

Source:

SFN_ERROR Slic_EyePoint::Call(SlicArgList *args)
{
	MapPoint point;
	BOOL res;
	Unit unit;

	
	

	if (args->Count() != 1 && args->Count() != 3)
		return SFN_ERROR_NUM_ARGS;

	res = args->GetPos(0, point);
	// Attempt to find a city or army always, so unit will have been filled 
	// when constructing the SlicEyePoint later.
	if (args->GetCity(0, unit) || args->GetUnit(0, unit))
	{ 
		if ((!res) && unit.IsValid())
		{
			point	= unit.RetPos();
			res		= true;
		}
	}

	if (!res)
	{
		return SFN_ERROR_TYPE_BUILTIN;
	}
	

	MBCHAR text[k_MAX_MSG_LEN];
	res = args->m_argValue[0].m_symbol->GetText(text, k_MAX_MSG_LEN);
	if(!res)
		text[0] = 0;

	DPRINTF(k_DBG_SLIC, ("Slic_EyePoint: (%d,%d,%d)\n",
						 point.x, point.y, 0));

	SlicEyePoint *ep = NULL;
	if (args->Count() > 1) {
		sint32 player;
		if(!args->GetPlayer(1, player))
			return SFN_ERROR_TYPE_ARGS;

		if(args->m_argValue[2].m_type != SA_TYPE_SEGMENT) {
			return SFN_ERROR_TYPE_ARGS;
		}
		if(!(args->m_argValue[2].m_segment)) {
			SlicSymbolData *sym = args->m_argValue[2].m_symbol;
			if(sym) {
				strcpy(g_missingSegment, sym->GetName());
			} else {
				strcpy(g_missingSegment, "???");
			}
			return SFN_ERROR_NOT_SEGMENT;
		}

		ep = new SlicEyePoint(point, text, 0, EYE_POINT_TYPE_GENERIC, unit, 
							  player, args->m_argValue[2].m_segment);
	} else {
		ep = new SlicEyePoint(point, text, 0, EYE_POINT_TYPE_GENERIC, unit, 
							  0, NULL);
	}
	g_slicEngine->GetContext()->AddEyePoint(ep);
		
	return SFN_ERROR_OK;
}

Information last updated by BureauBert on 23.11.2010

User Comments:

Using this form you may add your own observations concerning the above item, e.g. additional hints for usage, limitations, oddities etc. Please note this is not the place for asking questions or carrying out discussions about modding - please refer to the Apolyton CTP2 Modification Forum on that purpose.

Subject / Title*:
Text:*
(A maximum of characters left)
Your name:*
Your website (URL):

*) Required fields

Error including libraries: Can't locate config.cfg in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /home/www/ctp2.info/cgi-bin/comments.cgi line 4. Make sure they exist, permissions are set properly, and paths are set correctly.
  Administration
This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 82931 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote