Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

PlugIn Development Help


Bedrich Schindler
 Share

Recommended Posts

Bedrich Schindler
Posted
Posted

Hello,

 

I have programmed two EuroScope plugins for VACC-CZ, but I having troubles with tag item coloring. I know, how to change color of tag item which is registered in my plugin:

 

const int TAG_ITEM_EXT_VERTICAL_SPEED_IDENTIFICATOR = 1;

CExtendedTAGS::CExtendedTAGS() : EuroScopePlugIn::CPlugIn
(  
	EuroScopePlugIn::COMPATIBILITY_CODE,
	MY_PLUGIN_NAME,
	MY_PLUGIN_VERSION,
	MY_PLUGIN_DEVELOPER,
	MY_PLUGIN_COPYRIGHT
)
{
RegisterTagItemType("Extended Vertical Speed Identificator", TAG_ITEM_EXT_VERTICAL_SPEED_IDENTIFICATOR);
}

void CExtendedTAGS::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan,
EuroScopePlugIn::CRadarTarget RadarTarget,
int ItemCode,
int TagData,
char sItemString[16],
int * pColorCode,
COLORREF * pRGB,
double * pFontSize)
{
switch (ItemCode)
{
	case TAG_ITEM_EXT_VERTICAL_SPEED_IDENTIFICATOR:

		*pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED;
		*pRGB = RGB(255, 255, 0);

		if (RadarTarget.GetVerticalSpeed() < -99)
		{
			strcpy(sItemString, "|"); // VSI - Arrow up

			break;
		}
		if (RadarTarget.GetVerticalSpeed() >= -99 && RadarTarget.GetVerticalSpeed() <= 99)
		{
			strcpy(sItemString, "="); // VSI - Equals

			break;
		}

		if (RadarTarget.GetVerticalSpeed() > 99)
		{
			strcpy(sItemString, "^"); // VSI - Arrow down

			break;
		}

		break;
}
}

 

But I want to change color of all text in tag, because I want to simulate behavior of real EC2000 - blinking all text in tag on handoff. But if I write code for color change right inside OnGetTagItem, it changes colors only of tag items which are registered in my plugin:

 

const int TAG_ITEM_EXT_VERTICAL_SPEED_IDENTIFICATOR = 1;
const int TAG_ITEM_EXT_GROUND_SPEED = 2;
const int TAG_ITEM_NON_RVSM_INDICATOR = 3;
const int TAG_ITEM_CALLSIGN_SQUAWK = 4;
const int TAG_ITEM_EXT_SECTOR_ENTRY_AND_TEMPORARY_ALTITUDE = 5;
const int TAG_ITEM_AIRCRAFT_TYPE_AND_CATEGORY = 6;
const int TAG_ITEM_NEXT_FREQUENCY = 7;

CExtendedTAGS::CExtendedTAGS() : EuroScopePlugIn::CPlugIn
(  
	EuroScopePlugIn::COMPATIBILITY_CODE,
	MY_PLUGIN_NAME,
	MY_PLUGIN_VERSION,
	MY_PLUGIN_DEVELOPER,
	MY_PLUGIN_COPYRIGHT
)
{
RegisterTagItemType("Extended Vertical Speed Identificator", TAG_ITEM_EXT_VERTICAL_SPEED_IDENTIFICATOR);
RegisterTagItemType("Extended Ground Speed", TAG_ITEM_EXT_GROUND_SPEED);
RegisterTagItemType("Extended Non-RVSM Indicator", TAG_ITEM_NON_RVSM_INDICATOR);
RegisterTagItemType("Extended Callsign/Squawk", TAG_ITEM_CALLSIGN_SQUAWK);
RegisterTagItemType("Extended Sector Entry and Temporary Altitude", TAG_ITEM_EXT_SECTOR_ENTRY_AND_TEMPORARY_ALTITUDE);
RegisterTagItemType("Extended Aircraft Type and Category", TAG_ITEM_AIRCRAFT_TYPE_AND_CATEGORY);
RegisterTagItemType("Extended Next Frequency", TAG_ITEM_NEXT_FREQUENCY);
}

void CExtendedTAGS::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan,
EuroScopePlugIn::CRadarTarget RadarTarget,
int ItemCode,
int TagData,
char sItemString[16],
int * pColorCode,
COLORREF * pRGB,
double * pFontSize)
{
*pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED;
*pRGB = RGB(255, 255, 0);

       // ... 360 is colored by code bellow
}

TAG.png

 

I know that it might be caused because CExtendedTAGS cl[Mod - Happy Thoughts] is inherited from EuroScopePlugIn::CPlugIn, nevertheless I don't know ho to implement it correctly - I'm web programmer and I have done several application in C# (and other languages), but in C++ I have done only two "simple" plugins.

 

Thanks for understanding and help.

Bedřich Schindler

IT Director

VACC-CZ

Link to comment
Share on other sites

Bedrich Schindler
Posted
Posted

Any idea?

Bedřich Schindler

IT Director

VACC-CZ

Link to comment
Share on other sites

Pierre Ferran
Posted
Posted

From what I understand, only the colors of the tag items from your plugin are changing, which is how it is supposed to be.

 

You can't change EuroScope's default tag items from a plugin, you have to recreate them yourself.

Link to comment
Share on other sites

 Share