MQ2Popup

unity0110

Lifetimer
Joined
Mar 23, 2007
Messages
594
Reaction score
0
Points
0
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

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)");
	}
 

Attachments

  • MQ2Popup.dll
    110.5 KB · Views: 2
Im not in game right now, but if you use this do you need to modify any thing you already have set to use a popup to include a color, or is default color used if no other color is specified? also i thought default was yellow but im probably mistaken.
 
Cool. but the MQ2MMOPopup that I did does any color you want. ;-)

It's in the distro.

htw
 
this is just for text, not mob spawns, unless i'm mistaken as to what MQ2MMOPopup does
 
guess your macroquest FAQ needs updated, it says
MQ2MMOPopup
- Notifys you when new mobs spawn.

Commands:
/mmopopup - Lists commands.
/mpop - Lists commands.
 
guess your macroquest FAQ needs updated, it says
MQ2MMOPopup
- Notifys you when new mobs spawn.

Commands:
/mmopopup - Lists commands.
/mpop - Lists commands.

Thanks for pointing that out. I updated the FAQ with the accurate information:

Code:
MQ2MMOPopup
- Adds a command to allow you to show a popup on screen in any color, and control the display time, fade delay, etc.

Code:

Usage: mmopopup text [color] [[transparency] [fadein] [fadeout] [hold]] 

Default values are used if not supplied.
color = Color number 0 through 345 (see EQData.h) (default 0)
transparency = 1 through 100 (percent) (default 100)
fadein = Time to 'fade in', in milliseconds (default 50)
fadeout = Time to 'fade out', in milliseconds (default 500)
hold = Time to 'hold message on screen', in milliseconds (default 3000)

Alias command: /mpop

Using /mmopopup or /mpop without arguments shows usage.

htw
 
even better, now that i got a little bit better idea how to use this i think ill try it out some.
 
Either way. Nice work from both of you.

Thanks!
 
Could this be used like audio triggers?

ie...

Code:
#event feign  "has fallen to the ground"

Sub Main
:loop
/doevents
/goto :loop
/return 

Sub Event_feign
   /popup Stand Up!
/return
 
Could this be used like audio triggers?

ie...

Code:
#event feign  "has fallen to the ground"

Sub Main
:loop
/doevents
/goto :loop
/return 

Sub Event_feign
   /popup Stand Up!
/return
yes. You can play sounds also if you wished (MQ2CustomSound, MQ2PlaySound).

htw