Buff Duration Time Display

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

Moderator: MacroQuest Developers

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Buff Duration Time Display

Post by Bad Karma » Thu Dec 25, 2003 10:47 pm

I'd like to mod the buff list to show duration remaining on buffs from scritcly mm:ss, to hh:mm:ss, but don't know what needs to be changed. I don't know jack about UIs or XML, but I'm 99.9% sure this is what needs to be changed:

Code: Select all

<TooltipReference>$char(buff,1,durationsecs)</TooltipReference>
The qeustion is, how?

Thanks

Grumpy
a hill giant
a hill giant
Posts: 167
Joined: Sun Nov 10, 2002 4:22 pm

Post by Grumpy » Fri Dec 26, 2003 12:15 am

In MQ2Parms.cpp:
Change:

Code: Select all

						} else if (!strncmp(szArg,",durationsecs)",14)) {
							int Secs=(pCharInfo->Buff[Buff-1].Duration+1)*6;
							int Mins=Secs/60;
							int Hours=Mins/60;
							Mins=Mins-Hours*60;
							Secs=Secs-Mins*60-Hours*3600;
							if (Hours > 0) 
								sprintf(szTemp,"%d:%02d:%02d",Hours,Mins,Secs);
							else
								sprintf(szTemp,"  %2d:%02d",Mins,Secs);
						} else if (!strncmp(szArg,",mod)",5)) {

to:

Code: Select all

						} else if (!strncmp(szArg,",durationsecs)",14)) {
							int Secs=(pCharInfo->Buff[Buff-1].Duration+1)*6;
							int Mins=Secs/60;
							int Hours=Mins/60;
							Secs=Secs-Mins*60-Hours*3600;
							if (Hours > 0) 
								sprintf(szTemp,"%d:%02d:%02d",Hours,Mins,Secs);
							else
								sprintf(szTemp,"  %02d:%02d",Mins,Secs);
						} else if (!strncmp(szArg,",mod)",5)) {
The Devs might want to add special code for the UI, as this will add leading spaces to the return string (which will look a tad funny on the commandline). Not tested, but should work, may require some fiddling to get it to line up right. (maybe not, if, as it looks like, the times are to the left of the icons).

Tested on my UI this morning (when I discovered I'd forgotten to subtract Hours*60 from minutes), and it works, it's ugly though, gonna fiddle with the XML to line the times up in a column, neater and easier to read.