Page 1 of 1

Buff Duration Time Display

Posted: Thu Dec 25, 2003 10:47 pm
by Bad Karma
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

Posted: Fri Dec 26, 2003 12:15 am
by Grumpy
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.