WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   nUI: Plugin Support (https://www.wowinterface.com/forums/forumdisplay.php?f=94)
-   -   Battlefield Minimap and WatchFrame Loading Problems .. (https://www.wowinterface.com/forums/showthread.php?t=31980)

Xrystal 04-19-10 02:30 PM

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 :D Something along the lines of ..
WatchFrame Addon Loaded
BMM Paused
WatchFrame Addon process continues...
BMM Continued
Life goes on as planned :D

spiel2001 04-19-10 06:02 PM

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.

Xrystal 04-19-10 06:49 PM

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 :D

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


Xrystal 04-20-10 03:02 AM

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.


All times are GMT -6. The time now is 04:57 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI