• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

MQ2CustomPopup

Joined
Sep 20, 2005
RedCents
1,793¢
I made a plugin out of popup modifications pms originally posted on the mq2 forums

I shortened the commands to /pc and /pcecho, and included a color list in help syntax output. This allows you to do text overlay popups in various colors and durations.

Rich (BB code):
// MQ2CustomPopup.cpp : Defines the entry point for the DLL application.

// Original code from pms
// Modified to standalone plugin form, shortened commands, and added color list - Sym 4/1/2012
// MQ2CustomPopup v1.0


#include "../MQ2Plugin.h"

void CustomPopup(char* szPopText, bool bPopOutput);
void PopupTextCustom(PSPAWNINFO pChar, char* szLine);
void PopupTextEcho(PSPAWNINFO pChar, char* szLine);

PreSetup("MQ2CustomPopup");

// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
    DebugSpewAlways("Initializing MQ2CustomPopup");

    //Add commands, MQ2Data items, hooks, etc.
    AddCommand("/pc",PopupTextCustom);
    AddCommand("/pcecho",PopupTextEcho);
}

// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
    DebugSpewAlways("Shutting down MQ2CustomPopup");

    //Remove commands, MQ2Data items, hooks, etc.
    RemoveCommand("/pc");
    RemoveCommand("/pcecho");
}


// /pc
void PopupTextCustom(PSPAWNINFO pChar, char* szLine)
{
    CustomPopup(szLine, false);
}

// /pcecho
void PopupTextEcho(PSPAWNINFO pChar, char* szLine)
{
    CustomPopup(szLine, true);
}


void CustomDisplayOverlayText(PCHAR szText, DWORD dwColor, DWORD dwTransparency, DWORD msFadeIn, DWORD msFadeOut, DWORD msHold)
{
    if (!pTextOverlay) {
        WriteChatColor(szText,dwColor);
        return;
    }
    DWORD dwAlpha = (DWORD)(dwTransparency*255/100);
    if (dwAlpha>255) dwAlpha=255;

    pTextOverlay->DisplayText(
        szText,
        dwColor,
        10, // Always 10 in eqgame.exe,
        // Doesn't seem to affect anything
        // (tried 0,1,10,20,100,500)
        dwAlpha,
        msFadeIn,
        msFadeOut,
        msHold);
}

void CustomPopup(char* szPopText, bool bPopOutput)
{
    int  iArgNum    = 1;
    int  iMsgColor  = CONCOLOR_LIGHTBLUE;
    int  iMsgTime   = 3000;
    char szCurArg[MAX_STRING]    = {0};
    char szPopupMsg[MAX_STRING]  = {0};
    char szErrorCust[MAX_STRING] = "\awUsage: /pc [\agcolor\ax] [\agdisplaytime\ax(in seconds)] [\agmessage\ax]";
    char szErrorEcho[MAX_STRING] = "\awUsage: /pcecho [\agcolor\ax] [\agdisplaytime\ax(in seconds)] [\agmessage\ax]";

    GetArg(szCurArg, szPopText, iArgNum++);
    if (!*szCurArg)
    {
        if (bPopOutput)
        {
            WriteChatf(szErrorEcho);
        }
        else
        {
            WriteChatf(szErrorCust);
        }
        WriteChatColor("Colors are:");
        WriteChatColor("1: Dark Gray", COLOR_DARKGREY);
        WriteChatColor("2: Light Green", CONCOLOR_GREEN);
        WriteChatColor("4: Dark Blue", CONCOLOR_BLUE);
        WriteChatColor("5: Purple", COLOR_PURPLE);
        WriteChatColor("6: Light Gray", CONCOLOR_GREY);
        WriteChatColor("10: White", CONCOLOR_WHITE);
        WriteChatColor("13: Red", CONCOLOR_RED);
        WriteChatf("\ag14: Bright Green\ax");
        WriteChatColor("15: Yellow", CONCOLOR_YELLOW);
        WriteChatColor("18: Cyan", CONCOLOR_LIGHTBLUE);
        WriteChatColor("20: Black", COLOR_DEFAULT);
        return;
    }
    else
    {
        if(isdigit(szCurArg[0]))
        {
            iMsgColor = atoi(szCurArg);
            GetArg(szCurArg, szPopText, iArgNum++);
            if(isdigit(szCurArg[0]))
            {
                iMsgTime = atoi(szCurArg) * 1000;
                sprintf(szPopupMsg, "%s", GetNextArg(szPopText, 2, FALSE, 0));
            }
            else
            {
                sprintf(szPopupMsg, "%s", GetNextArg(szPopText, 1, FALSE, 0));
            }
        }
        else
        {
            strcpy(szPopupMsg, szPopText);
        }
    }
    CustomDisplayOverlayText(szPopupMsg, iMsgColor, 100, 500, 500, iMsgTime);
    if (bPopOutput) WriteChatf("\ayPopup\aw:: %s", szPopupMsg);
}
 
Nice work Sym could you please include some examples for the actual macro commands so I can add this plugin to the compile and our commands/examples page.

Redcented
 
Sure. How's this.

MQ2CustomPopup - This plugin allows you to do popup text overlays in custom colors and display times

Syntax
Rich (BB code):
/pc [color] [display time in seconds] Text to display
/pcecho [color] [display time in seconds] Text to display


color and display time are optional, if ommitted normal /popup values are used
If you want a custom display time you must specify color. Color values are listed in the help syntax in game and below.

/pcecho works exactly the same as /pc and will /echo the text to the chat window in addition to doing the popup


Examples:

/pc
This will list help syntax and available colors. Available colors are:

1: Dark Gray
2: Light Green
4: Dark Blue
5: Purple
6: Light Gray
10: White
13: Red
14: Bright Green
15: Yellow
18: Cyan
20: Black



/pc Click your mask
This will do the standard popup color and duration with the text Click your mask



/pc 5 Click your mask
This will do the popup in the color purple for the standard duration with the text Click your mask



/pc 13 15 Click your mask
This will do the popup in the color red for 15 seconds with the text Click your mask
 
Awesome. I've started including popups in my macros, and different colors would be amazing. Thanks a bunch Maskoi for including it, and Sym for making it.
 
Worked perfectly. Thanks again.

Such a better tool for getting information across then /echo
 
MQ2CustomPopup

Users who are viewing this thread

Back
Top
Cart