Thread Tools Display Modes
04-19-10, 02:30 PM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Battlefield Minimap and WatchFrame Loading Problems ..

Scott, this error has been annoying the hell out of me but I finally figured out the cause .. here's the error I am getting :

Code:
[2010/04/19 21:19:37-2566-x1]: Interface\FrameXML\WatchFrame.lua:365: attempt to perform arithmetic on a nil value:
<in C code>: in function `WatchFrame_Update'
Interface\FrameXML\WatchFrame.lua:274: in function <Interface\FrameXML\WatchFrame.lua:230>:
<in C code>: in function `SetMapToCurrentZone'
...d_BattlefieldMinimap\Blizzard_BattlefieldMinimap.lua:58: in function <...d_BattlefieldMinimap\Blizzard_BattlefieldMinimap.lua:57>:
<in C code>: in function `Show'
...ault\InfoPanels\nUI_InfoPanel_BattlefieldMinimap.lua:294: in function `setEnabled':
...ault\InfoPanels\nUI_InfoPanel_BattlefieldMinimap.lua:207: in function `initPanel':
nUI-5.06.12 (Plus)\Integration\nUI_InfoPanel.lua:793: in function `applyScale'
nUI-5.06.12 (Plus)\Integration\nUI_InfoPanel.lua:908: in function `applyOptions'
nUI-5.06.12 (Plus)\Integration\nUI_InfoPanel.lua:937: in function `applySkin'
nUI-5.06.12 (Plus)\Main\nUI.lua:249: in function <Interface\AddOns\nUI\Main\nUI.lua:137>
Now, I can't remember if this problem existed before I customized the watchframe further, but it now ticks this error on every reload although it later corrects itself it seems as the watchframe still works as intended. This might also be the reason why the error only seems to trickle in when I want the watchframe in the infopanel.

However, if I alter the following code so that plugin.active is false in the BMM InfoPanel plugin the error doesn't occur. Although if I have it selected at the time it overloads the other frames until I toggle back through them.

Code:
local CombatHit = {};
local UnitInfo  = {};
local POIList   = {};
local plugin    = CreateFrame( "Frame", nUI_INFOPANEL_BMM, nUI_Dashboard.Anchor );
plugin.active   = false;
Now the question is this Scott. Is it possible for me to programmatically delay it from loading the BMM InfoPanel Map and thus not trigger the Map Update that triggers the WatchFrame Update before I have finished relocating it rofl Something along the lines of ..
WatchFrame Addon Loaded
BMM Paused
WatchFrame Addon process continues...
BMM Continued
Life goes on as planned
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
04-19-10, 06:02 PM   #2
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
It would be dirty pool, but you could cheat the info panel indexing system something like this...

Code:
-- assume your panel mode is nUI_INFOMODE_WATCHFRAME = 20

nUI_INFOMODE_WATCHFRAME = nUI_INFOMODE_BMM;
nUI_INFOMODE_BMM               = 20;
nUI_InfoPanels[nUI_INFOPANEL_WATCHFRAME].rotation = nUI_INFOMODE_WATCHFRAME;
nUI_InfoPanels[nUI_INFOPANEL_BMM].rotation = nUI_INFOMODE_BMM;
.

You would have to do this *before* the VARIABLES_LOADED event fires. This *should* cause nUI to process the panels in an order that causes your panel to process before the BMM panel.

If that doesn't work, then change the value of nUI_INFOPANEL_WATCHFRAME to be something that sorts before nUI_INFOPANEL_BMM and see if that doesn't fix it. Again, that would have to be before VARIABLES_LOADED fires.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
04-19-10, 06:49 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Yep that seemed to resolve the problem. Even future proofed it so that they will swap around so that the minimap is loaded after the watchframe regardless to what number you give it at a later date

Code:
local ipID = min(nUI_INFOMODE_BMM,23);
local bmmID = max(nUI_INFOMODE_BMM,23);
if ( SWF_WatchFrame and not SWF_InfoPanel ) then 
	SWF_InfoPanel = CreateInfoPanel(SWF_WatchFrame, ipID, "SWF_InfoPanel");
	nUI_INFOMODE_BMM               = bmmID;
	nUI_InfoPanels[nUI_INFOPANEL_BMM].rotation = bmmID;
	SWF_WatchFrame.OnShow();
end
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
04-20-10, 03:02 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Hmm, well that definitely solved the problem for the code being used at the moment but the new object orientated way I have been working on doesn't seem to trigger the error somehow. Will have to do further tests to make sure though but frames are either created during code loading or addonloading. In fact I just created 2 extra infopanels with 4 lines rofl. They're not functional much but it shows hope.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
 

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Plugin Support » Battlefield Minimap and WatchFrame Loading Problems ..


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off