WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   [HELP] Positioning Minimap > Blizz Bar Error (https://www.wowinterface.com/forums/showthread.php?t=56445)

Zenjaa 07-26-18 08:55 AM

[HELP] Positioning Minimap > Blizz Bar Error
 
Hello.
Maybe someone can help me out with a somewhat weird issue.

I'm using my own Minimap addon which works completely fine except for a positioning issue.

This is the part of the addon which positions the minimap, which works fine.

Code:

local cfg = {
  scale = 1,
  point = { "TOPRIGHT", UIParent, "TOPRIGHT", -25, -2},
}

BUT...
as soon as I try to position the map in the bottomright corner the following error occurs:
Code:

74x FrameXML\MultiActionBars.lua:85: MultiBarRight:SetScale(): Scale must be > 0
[C]: in function `SetScale'
FrameXML\MultiActionBars.lua:85: in function `MultiActionBar_Update'
FrameXML\InterfaceOptionsPanels.lua:1184: in function `InterfaceOptions_UpdateMultiActionBars'
[string "*:OnLoad"]:4: in function `setFunc'
FrameXML\InterfaceOptionsPanels.lua:1154: in function <FrameXML\InterfaceOptionsPanels.lua:1147>

Locals:
(*temporary) = MultiBarRight {
 0 = <userdata>
 slideOut = <unnamed> {
 }
}
(*temporary) = -0.22465210264293


Apparently the blizz code is scaling the actionbars (right bars/multibars 4/5) if I move the minimap somewhere near the area where they are!? :confused:

Can anybody tell me why this is happening and what steps to take lua-wise to get rid of this behavior?
Any help would be greatly appreciated.

Xrystal 07-26-18 07:50 PM

I had the same problem with nUI as it moves the minimap from the top corner and recreates the action bars in another location.

The only solution to the problem I could find was to turn off the show right action bars options in the game menu. Because these two button bars are connected to the minimap and any adjustment to the minimap will affect its connected frames.

This works for nUI as we reuse those buttons elsewhere. I did try automatically turning off those options in code but no joy.

I believe the following relates to those options but adjusting those values in nUI didn't help.

https://www.townlong-yak.com/framexm...Controller.lua
Lua Code:
  1. if ( SHOW_MULTI_ACTIONBAR_3 ) then
  2.         BeginActionBarTransition(MultiBarRight, nil);
  3.       end
  4.       if ( SHOW_MULTI_ACTIONBAR_4 ) then
  5.         BeginActionBarTransition(MultiBarLeft, nil);
  6.       end

Seerah 07-26-18 07:54 PM

It sounds as if the action bars might be anchored to the minimap, though I don't have the code in front of me to look.

Are you guys moving just the minimap itself, or the entire MinimapCluster?

Xrystal 07-26-18 08:10 PM

nUI moves the whole minimap cluster from what I recall.

The frame at the bottom of this file seems to be what we had problems with ..

https://www.townlong-yak.com/framexm...ActionBars.xml

And the MultiActionBar_Update funciton in the following

https://www.townlong-yak.com/framexm...ActionBars.lua

However, neither point to the minimap as being connected, so maybe a misleading thought on the problem.

Zenjaa 07-26-18 11:37 PM

Quote:

Originally Posted by Xrystal (Post 329053)
I had the same problem with nUI as it moves the minimap from the top corner and recreates the action bars in another location.

The only solution to the problem I could find was to turn off the show right action bars options in the game menu. Because these two button bars are connected to the minimap and any adjustment to the minimap will affect its connected frames.

This works for nUI as we reuse those buttons elsewhere. I did try automatically turning off those options in code but no joy.

I believe the following relates to those options but adjusting those values in nUI didn't help.

https://www.townlong-yak.com/framexm...Controller.lua
Lua Code:
  1. if ( SHOW_MULTI_ACTIONBAR_3 ) then
  2.         BeginActionBarTransition(MultiBarRight, nil);
  3.       end
  4.       if ( SHOW_MULTI_ACTIONBAR_4 ) then
  5.         BeginActionBarTransition(MultiBarLeft, nil);
  6.       end

Yeah, I ended up doing this too. Using a bar mod and manually disabling the right bars in the blizzard options fixed the lua error for me as well.

Zenjaa 07-26-18 11:37 PM

Quote:

Originally Posted by Seerah (Post 329055)
It sounds as if the action bars might be anchored to the minimap, though I don't have the code in front of me to look.

Are you guys moving just the minimap itself, or the entire MinimapCluster?

I am also moving the entire cluster like Xrystal.

zork 07-27-18 03:21 AM

I move the whole cluster with rMinimap too.

Zenjaa 07-27-18 07:33 AM

Quote:

Originally Posted by zork (Post 329078)
I move the whole cluster with rMinimap too.

Without issues? Even if you position the map at the bottomright?

Seerah 07-27-18 08:05 AM

My apologies, I meant to say that it sounded like it was anchored to the MinimapCluster.

The update function in MultiActionBars.lua does indeed show that the placement of the MinimapCluster has an effect on the size/scale of the 2 right action bars.

- line 63 gets the top limit for placement of these bars in relation to the bottom of the MinimapCluster frame
- line 66 gets the total available space for the action bars, between the top and bottom limits
-- (if the minimap cluster is below the bottom limit, this difference will be a negative value)
- lines 72 and 82 check to see if the available space is less than the constant height set for the bars
-- (since it's negative, it will be)
- line 83 then sets the scale variable to be the available space divided by the height of the bars
-- (again, since available space is negative, then scale ends up being negative)
***then you get your scale must be > 0 error

Solution: Only move the Minimap and any other frames you wish to relocate. This is what PocketPlot does.

(edit: Yes, you also have to move MinimapBorderTop and MinimapZoneTextButton, for example. But, this is still the best course of action anyway, IMO. There are other UI elements anchored to the MinimapCluster that you may not wish to move, or may be off-screen if a user moves their minimap to the bottom of the screen.)

Zenjaa 07-27-18 08:16 AM

Quote:

Originally Posted by Seerah (Post 329081)
My apologies, I meant to say that it sounded like it was anchored to the MinimapCluster.

The update function in MultiActionBars.lua does indeed show that the placement of the MinimapCluster has an effect on the size/scale of the 2 right action bars.

- line 63 gets the top limit for placement of these bars in relation to the bottom of the MinimapCluster frame
- line 66 gets the total available space for the action bars, between the top and bottom limits
-- (if the minimap cluster is below the bottom limit, this difference will be a negative value)
- lines 72 and 82 check to see if the available space is less than the constant height set for the bars
-- (since it's negative, it will be)
- line 83 then sets the scale variable to be the available space divided by the height of the bars
-- (again, since available space is negative, then scale ends up being negative)
***then you get your scale must be > 0 error

Solution: Only move the Minimap and any other frames you wish to relocate. This is what PocketPlot does.

(edit: Yes, you also have to move MinimapBorderTop and MinimapZoneTextButton, for example. But, this is still the best course of action anyway, IMO. There are other UI elements anchored to the MinimapCluster that you may not wish to move, or may be off-screen if a user moves their minimap to the bottom of the screen.)

thanks a lot for investigating. will see if I can make it work when I get back home this evening.

Xrystal 07-27-18 09:58 AM

Quote:

Originally Posted by Seerah (Post 329081)
Solution: Only move the Minimap and any other frames you wish to relocate. This is what PocketPlot does.

(edit: Yes, you also have to move MinimapBorderTop and MinimapZoneTextButton, for example. But, this is still the best course of action anyway, IMO. There are other UI elements anchored to the MinimapCluster that you may not wish to move, or may be off-screen if a user moves their minimap to the bottom of the screen.)

I might well do this as I work through my rewrite of nUI. There is too much that I could break by changing nUI in its current state. nUI has a similar problem with the main menu bar which Scott placed at the top when Blizzard had the pop up message downwards from the button, with it now going upwards.

Zenjaa 07-27-18 11:23 AM

Quote:

Originally Posted by Seerah (Post 329081)
My apologies, I meant to say that it sounded like it was anchored to the MinimapCluster.

The update function in MultiActionBars.lua does indeed show that the placement of the MinimapCluster has an effect on the size/scale of the 2 right action bars.

- line 63 gets the top limit for placement of these bars in relation to the bottom of the MinimapCluster frame
- line 66 gets the total available space for the action bars, between the top and bottom limits
-- (if the minimap cluster is below the bottom limit, this difference will be a negative value)
- lines 72 and 82 check to see if the available space is less than the constant height set for the bars
-- (since it's negative, it will be)
- line 83 then sets the scale variable to be the available space divided by the height of the bars
-- (again, since available space is negative, then scale ends up being negative)
***then you get your scale must be > 0 error

Solution: Only move the Minimap and any other frames you wish to relocate. This is what PocketPlot does.

(edit: Yes, you also have to move MinimapBorderTop and MinimapZoneTextButton, for example. But, this is still the best course of action anyway, IMO. There are other UI elements anchored to the MinimapCluster that you may not wish to move, or may be off-screen if a user moves their minimap to the bottom of the screen.)



I moved the minimap instead of the cluster and simply attached all objects I wanted to keep to the minimap, while hiding the stuff that I don't need.

No more erros, everything is working as it should. :)

Thank you again Seerah. This totally solved the issue. :banana:

Xrystal 09-22-18 06:59 AM

Move Minimap not MinimapCluster interactive problem
 
As the title said, did anyone find they had an interativity problem with the minimap after disconnecting it from the MinimapCluster frame and reparenting it ?

Since I did it with nUI the only interactivity I get is what nUI built in, as in mouse scrolling for zoom in/out.

I can't see anything in Blizzards minimap files to explain what section handles the display of quest poi tooltips on the minimap but for some reason something I did stopped it from working, but none of the nUI minimap code has code for tooltips. And the tooltips from the buttons around the map work fine, just the ones inside the minimap are failing.

What's strange is that my mini addon to test the separation code works fine...

And here I was hoping not to have rewrite the whole minimap code in nUI *sigh*


Edit:
Aha, found the problem...
Quote:

MinimapCluster:EnableMouse( false );
MinimapCluster:SetParent( frame );
MinimapCluster:SetFrameStrata( frame:GetFrameStrata() );
MinimapCluster:SetFrameLevel( frame:GetFrameLevel()+1 );

MinimapCluster:SetMovable( true );
MinimapCluster:StartMoving()
MinimapCluster:StopMovingOrSizing()

nUI_Movers:lockFrame( MinimapCluster, true, nil );
Just had to be removed rather than recoded as Minimap.


All times are GMT -6. The time now is 09:16 PM.

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