Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-05-20, 12:31 PM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
focus frame display override not working properly

Has anyone noticed if there have been any recent changes in the API that would explain why this no longer hides the frame ? Thanks in advance for any clues that can shed a light on this.

Scott set up nUI to automatically hide the minimap if a focus was visible. I used to use it a lot in my raiding days so I know it used to work. But I have just had a report that it doesn't work and I can see it not working, but this code is still active and a debug code in this ifelse block shows it gets executed. I haven't touched anything with the focus frame but I have made some changes to the minimap 2 years ago with no complaints then and I can't see anything that would affect the showing/hiding of a frame.

Lua Code:
  1. local frame      = CreateFrame( "Frame", "nUI_MinimapManager", nUI_Dashboard.Anchor, "SecureHandlerStateTemplate" );
  2.        ..... other event code to handle ADDON_LOADED unchanged since at least BFA release  ...
  3.     elseif event == "PLAYER_ENTERING_WORLD" then
  4.         -- create the show/hide logic for the minimap frame... if we have a focus frame, then we hide the minimap
  5.         -- frame, otherwise, the minimap frame is visible
  6.         frame:SetAttribute( "unit", "focus" );
  7.         frame:SetAttribute( "_onstate-unitexists",
  8.             [[
  9.                 if UnitExists( "focus" )
  10.                 then self:Hide();
  11.                 else self:Show();
  12.                 end
  13.             ]]
  14.         );
  15.         -- we only need to do this once
  16.         frame:UnregisterEvent( "PLAYER_ENTERING_WORLD" );

The frame has been registered as a unit watch frame as follows, which is executed sometime after addon loaded event, which again, hasn't been touched by me in anyway, at least since BFA release:
Lua Code:
  1. frame.applySkin = function( skin )
  2.     local skin = skin and skin.Minimap or nUI_DefaultConfig.Minimap;
  3.     if skin and skin.enabled then
  4.         frame.applyOptions( skin.options );
  5.         frame.applyAnchor( skin.anchor );
  6.         RegisterUnitWatch( frame, true );
  7.     else
  8.         UnregisterUnitWatch( frame );
  9.         frame:SetScript( "OnUpdate", nil );
  10.         frame:SetAlpha( 0 );
  11.     end
  12. 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

Last edited by Xrystal : 03-05-20 at 12:49 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » focus frame display override not working properly


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