<commit_before>//------------------------------------------------------------------------------
// Revenge Of The Cats: Ethernet
// Copyright (C) 2008, mEthLab Interactive
//------------------------------------------------------------------------------

addMessageCallback('MsgMenuText', handleMsgMenuText);

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

function handleMsgMenuText(%msgType, %msgString, %text)
{
	if(%text $= "")
		IngameMenuText.setText("");
	else
	{
		%newtext = IngameMenuText.getText() @ %text;

		while(true)
		{
			%p = strstr(%newtext, "@bind");
			if(%p == -1)
				break;

			%s = getSubStr(%newtext, %p, 7);
			%n = getSubStr(%s, 5, 2);
			%n = %n + 0; // interpet as numeric

			%cmd = $RemapCmd[%n];
			%temp = moveMap.getBinding( %cmd );
			%device = getField( %temp, 0 );
			%object = getField( %temp, 1 );
			%mapString = getMapDisplayName( %device, %object );

			%newtext = strreplace(%newtext, %s, %mapString);
		} 

		IngameMenuText.setText(%newtext);
	}
}

function MissionWindow::resizeIdeal(%this)
{
	%s  = %this.getParent().getExtent();
	%sw = getWord(%s, 0);
	%sh = getWord(%s, 1);
<commit_msg>Bugfix<commit_after>//------------------------------------------------------------------------------
// Revenge Of The Cats: Ethernet
// Copyright (C) 2008, mEthLab Interactive
//------------------------------------------------------------------------------

addMessageCallback('MsgMenuText', handleMsgMenuText);

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

function handleMsgMenuText(%msgType, %msgString, %text)
{
	if(%text $= "")
		IngameMenuText.setText("");
	else
	{
		%newtext = IngameMenuText.getText() @ %text;

		while(true)
		{
			%p = strstr(%newtext, "@bind");
			if(%p == -1)
				break;

			%s = getSubStr(%newtext, %p, 7);
			%n = getSubStr(%s, 5, 2);

			if(strlen(%n) != 2)
				break;

			%n = %n + 0; // interpet as numeric

			%cmd = $RemapCmd[%n];
			%temp = moveMap.getBinding( %cmd );
			%device = getField( %temp, 0 );
			%object = getField( %temp, 1 );
			%mapString = getMapDisplayName( %device, %object );

			%newtext = strreplace(%newtext, %s, %mapString);
		} 

		IngameMenuText.setText(%newtext);
	}
}

function MissionWindow::resizeIdeal(%this)
{
	%s  = %this.getParent().getExtent();
	%sw = getWord(%s, 0);
	%sh = getWord(%s, 1);

{'fraction_non_alphanumeric': 0.3531896915927334, 'fraction_numerical': 0.011406844106463879, 'mean_word_length': 1.7093821510297482, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6516421', 'n_tokens_mistral': 860, 'n_tokens_neox': 743, 'n_words': 155}