Quantcast [HELP] Positioning Minimap > Blizz Bar Error - WoWInterface
Thread Tools Display Modes
07-26-18, 08:55 AM   #1
Zenjaa
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 10
Post [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!?

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.
  Reply With Quote
07-26-18, 07:50 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,210
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
__________________
  Reply With Quote
07-26-18, 07:54 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,541
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?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-26-18, 08:10 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,210
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.
__________________
  Reply With Quote
07-26-18, 11:37 PM   #5
Zenjaa
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 10
Originally Posted by Xrystal View Post
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.
  Reply With Quote
07-26-18, 11:37 PM   #6
Zenjaa
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 10
Originally Posted by Seerah View Post
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.
  Reply With Quote
07-27-18, 03:21 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,719
I move the whole cluster with rMinimap too.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
07-27-18, 07:33 AM   #8
Zenjaa
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 10
Originally Posted by zork View Post
I move the whole cluster with rMinimap too.
Without issues? Even if you position the map at the bottomright?
  Reply With Quote
07-27-18, 08:05 AM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,541
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.)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh


Last edited by Seerah : 07-27-18 at 08:15 AM.
  Reply With Quote
07-27-18, 08:16 AM   #10
Zenjaa
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 10
Originally Posted by Seerah View Post
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.
  Reply With Quote
07-27-18, 09:58 AM   #11
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,210
Originally Posted by Seerah View Post
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.
__________________

Last edited by Xrystal : 07-27-18 at 10:01 AM.
  Reply With Quote
07-27-18, 11:23 AM   #12
Zenjaa
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 10
Originally Posted by Seerah View Post
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.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » [HELP] Positioning Minimap > Blizz Bar Error

Thread Tools
Display Modes

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