How about people start making custom UI's for MQ?

Forum for posting custom UIs, portions of UIs, and HUD stuff using MQ's enhancements.

Moderator: MacroQuest Developers

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

How about people start making custom UI's for MQ?

Post by Plazmic » Fri Nov 07, 2003 10:44 pm

We need to get a standard on what Label EQType's are used for what.
And we need a new section of the readme.txt detailing these...
New forum for UIs: http://macroquest2.com/phpBB2/viewforum.php?f=27


UI file usage: If you don't know how to create a Label, learn or ask someone that does.. Current EQType's are in source or at http://macroquest2.com/phpBB2/viewtopic.php?t=3879


Offset (load from INI):
DWORD EQADDR_EQLABELS
GetLabelFromEQ=004F903B

Function below, add HookLabels(TRUE) with the rest of the HookXXX(TRUE); do the same for FALSE.

Code: Select all

// *************************************************************************** 
// Function:    GetLabelFromEQ_Detour 
// Description: Our UI label Hook 
// *************************************************************************** 
struct _ID_PMP
	{ DWORD ID;PCHAR PMP; }
Id_PMP[] = {
	// 1000-1999: $char() 
      {1000,   "$char(mana,cur)"}, 
      {1001,   "$char(mana,max)"}, 
      {1002,   "$char(state)"}, 
     {1003,   "$char(speed)"}, 
     {1004,   "$char(heading)"}, 
     {1005,   "$char(x)"}, 
     {1006,   "$char(y)"}, 
     {1007,   "$char(z)"}, 
     {1008,   "$char(dar)"}, 
     {1009,   "$char(cash)"}, 
     {1010,   "$char(cash,bank)"}, 
     {1011,   "$char(plat,bank)"}, 
     {1012,   "$char(plat,shared)"}, 
     {1013,   "$char(gold,bank)"}, 
     {1014,   "$char(silver,bank)"}, 
     {1015,   "$char(copper,bank)"}, 

      // 2000-2999: $target() 
      {2000,   "$target(level)"}, 
      {2001,   "$target(class)"}, 
      {2002,   "$target(race)"}, 
      {2003,   "$target(distance)"}, 
      {2004,   "$target(lastattacked)"}, 
      {2005,   "$target(state)"}, 
     {2006,   "$target(x)"}, 
     {2007,   "$target(y)"}, 
     {2008,   "$target(z)"}, 
     {2009,   "$target(heading)"}, 
     {2010,   "$target(speed)"}, 

      // 3000-3999: misc 
      {3000,   "$zone()"}, 
      {3001,   "$zone(zem)"}, 
      {3002,   "$zone(bound)"}, 
     {3003,   "$time()"}, 
     {3004,   "$time(h)"}, 
     {3005,   "$time(m)"}, 
     {3006,   "$time(s)"}, 
     {3007,   "$date()"}, 
     {3008,   "$date(y)"}, 
     {3009,   "$date(m)"}, 
     {3010,   "$date(d)"}, 
     {3011,   "$gm"}, 
     {3012,   "$freeinv(space)"},

	 // 9999: custom (ToolTipReference)
	  {9999,   "BrokenParser" },

	{-1,NULL}
};

class CLabel {
public:
	VOID Draw_Trampoline(VOID);
	VOID Draw_Detour(VOID)
	{
		PCSIDLWND pThisLabel = NULL;
		__asm mov [pThisLabel], ecx;
		Draw_Trampoline();

		CHAR Buffer[MAX_STRING] = {0};
		BOOL Found=FALSE;
		DWORD index;

		if (pThisLabel->SlotID==9999) {
			if (!pThisLabel->XMLToolTip) {
				strcpy(Buffer,"BadCustom");
				Found=TRUE;
			} else {
				strcpy(Buffer,&pThisLabel->XMLToolTip->Text[0]);
				ParseMacroParameter((*EQADDR_CHAR_INFO)->pSpawn,Buffer);
				Found=TRUE;
			}
		} else if (pThisLabel->SlotID>114) {
			for (index=0;Id_PMP[index].ID>0 && !Found;index++) {
				if (Id_PMP[index].ID==pThisLabel->SlotID) {
					strcpy(Buffer,Id_PMP[index].PMP);
					ParseMacroParameter((*EQADDR_CHAR_INFO)->pSpawn,Buffer);
					Found=TRUE;
				}
			}
		}
		if (Found) SetCXStr(&(pThisLabel->WindowText),Buffer);
	}
};


...


// ***************************************************************************
// Function:    HookLabels
// Description: Hook UI labels
// ***************************************************************************
DETOUR_TRAMPOLINE_EMPTY(VOID CLabel::Draw_Trampoline(VOID));

VOID HookLabels(BOOL Patch)
{
   FunctionEntry("HookLabels()");
   void (CLabel::*pfDetour)(VOID) = CLabel::Draw_Detour;
   void (CLabel::*pfTrampoline)(VOID) = CLabel::Draw_Trampoline;

   DebugSpewAlways("HookLabels - %satching",(Patch)?"P":"Unp");
   if (Patch) {
      AddOurDetour(EQADDR_EQLABELS);

      DetourFunctionWithEmptyTrampoline(*(PBYTE*)&pfTrampoline,
         (PBYTE)EQADDR_EQLABELS,
         *(PBYTE*)&pfDetour);
   } else {
      DetourRemove(*(PBYTE*)&pfTrampoline,
         *(PBYTE*)&pfDetour);
   }

   FunctionExit("HookLabels()");
}
Last edited by Plazmic on Sat Nov 08, 2003 3:10 am, edited 6 times in total.
- Plazmic

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Nov 07, 2003 11:09 pm

Velly nife 8)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Fri Nov 07, 2003 11:11 pm

This thing was a bitch to get working... do all work before the EQ call or optimizations WILL fuck it up...
(and I found away around phpBB2 cuss filter ;)
- Plazmic

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Nov 07, 2003 11:20 pm

Going to CVS this in with minor changes
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Fri Nov 07, 2003 11:30 pm

Converting the curse words to HTML ASCII equiv?

BTW, the UI label addition rocks.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Nov 07, 2003 11:49 pm

CVS and ZIP updated, lets see this get going :)
Definitions of labels/etc are in eqlib.h please look at it
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Fri Nov 07, 2003 11:55 pm

I'll get to work on converting the appropriate stuff into the detours case statement.

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Sat Nov 08, 2003 12:03 am

Possible enhancement to this ...

What if the elements were dynamic? i.e.
In MacroQuest.ini

Code: Select all

[UI Labels]
1000=$char(mana,cur)
1001=$char(mana,max)

2000=$target(level)
2001=$target(class)
2002=$target(race)
2003=$target(distance)
2004=$target(lasthit)
Since the labels already defined are macroparser commands, this might not be too hard to do ... but I could be wrong.

It's an idea for easy expansion/customization.

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Sat Nov 08, 2003 12:11 am

I would recommend against that, honestly. Break it off into a seperate header file with #defines. But there really should be a standard that everyone uses.. Just my opinion.

*thump self*

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sat Nov 08, 2003 12:34 am

Yeah I was going to plop the defines in another header file but adding files to solutions/projects/makefiles/whatever is a pita ;)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Sat Nov 08, 2003 12:45 am

I've gone ahead and done that. I'll post a diff file for all this stuff once I finish making additions.

Preliminary List:
Character
DAR
x-y-z
heading
speed
cash,bank
plat,shared
plat/gold/gold/copper,bank

Target
x-y-z
heading
speed
state
type


Misc
Zone: ZEM
Zone: Bound
Time: Full, h-m-s
Date: Full, d-m-y

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sat Nov 08, 2003 1:03 am

The original code was more proof of concept ;)
I like the PMP idea...
Last edited by Plazmic on Sat Nov 08, 2003 1:28 am, edited 1 time in total.
- Plazmic

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Sat Nov 08, 2003 1:16 am

Good point. That's probably less of a pain then going in and writing case statements for everything we want. Saves me mucho typing :P

I'll toss the rest of it in and post a diff file. Very sexy stuff

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sat Nov 08, 2003 1:37 am

First UI test post was moved to the new forum
- Plazmic

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sat Nov 08, 2003 1:51 am

Next order of business is see if we can make our own xml type that uses strings instead of numbers, so we can just parse the string directly with PMP...
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0