Ever wanted a color besides lightblue in your popups? well I sure did!
Usage: /popup2 <text> <color> (grey|green|lightblue|blue|white|yellow|red|pink)
Example: /popup2 "Hello my name is ${Me.Name}" yellow
Changes
--
Added pink
Added a default color of yellow
Usage: /popup2 <text> <color> (grey|green|lightblue|blue|white|yellow|red|pink)
Example: /popup2 "Hello my name is ${Me.Name}" yellow
Changes
--
Added pink
Added a default color of yellow
Code:
//Plugin by Unity0110
#include "../MQ2Plugin.h"
PreSetup("MQ2Popup");
VOID Popup2(PSPAWNINFO, PCHAR);
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2Popup");
AddCommand("/popup2",Popup2);
WriteChatColor("Usage: /popup2 <text> <color> (grey|green|lightblue|blue|white|yellow|red|pink)");
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2Popup");
RemoveCommand("/popup2");
}
VOID DisplayOverlayText2(PCHAR szText, DWORD dwColor)
{
if (!pTextOverlay) {
WriteChatColor(szText,dwColor);
return;
}
pTextOverlay->DisplayText(szText, dwColor, 10, 255, 100, 100, 3000);
}
VOID Popup2(PSPAWNINFO pChar, PCHAR szLine)
{
char color[MAX_STRING];
char text[MAX_STRING];
GetArg(color,szLine,2);
GetArg(text,szLine,1);
if(!stricmp(color,"grey")) DisplayOverlayText2(text, CONCOLOR_GREY);
else if (!stricmp(color,"green")) DisplayOverlayText2(text, CONCOLOR_GREEN);
else if (!stricmp(color,"lightblue")) DisplayOverlayText2(text, CONCOLOR_LIGHTBLUE);
else if (!stricmp(color,"blue")) DisplayOverlayText2(text, CONCOLOR_BLUE);
else if (!stricmp(color,"white")) DisplayOverlayText2(text, CONCOLOR_WHITE);
else if (!stricmp(color,"yellow")) DisplayOverlayText2(text, CONCOLOR_YELLOW);
else if (!stricmp(color,"red")) DisplayOverlayText2(text, CONCOLOR_RED);
else if (!stricmp(color,"pink")) DisplayOverlayText2(text, 5);
else if (!stricmp(color,"")) DisplayOverlayText2(text, CONCOLOR_YELLOW);
else WriteChatColor("That is not a valid color! Usage: /popup2 <text> <color> (grey|green|lightblue|blue|white|yellow|red|pink)");
}