View Single Post
03-25-19, 07:27 PM   #9
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Hi,

thanks so much for your answer.

I have tried your code and it doesn't give any errors when the player enters world ...and the bars are at 0.8 ...
Lua Code:
  1. 5:  hooksecurefunc(MultiBarRight, "SetScale", function(self, scale)
  2. 6:     if scale ~= 0.8 then self:SetScale(0.8) end
  3. 7:  end)
  4.  
  5. 9:  hooksecurefunc(MultiBarLeft, "SetScale", function(self, scale)
  6. 10: if scale ~= 0.8 then self:SetScale(0.8) end
  7. 11:end)

But when I finish the quest BeachHead (which is vehicle exit) I got:

Lua Code:
  1. 1x [ADDON_ACTION_BLOCKED] AddOn 'gmActionBars' tried to call the protected function 'UNKNOWN()'.
  2. !BugGrabber\BugGrabber.lua:519: in function <!BugGrabber\BugGrabber.lua:519>
  3. [C]: ?
  4. [C]: in function `SetScale'
  5. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  6. [C]: in function `SetScale'
  7. FrameXML\MultiActionBars.lua:85: in function `MultiActionBar_Update'
  8. FrameXML\ActionBarController.lua:169: in function `ValidateActionBarTransition'
  9. FrameXML\ActionBarController.lua:137: in function `ActionBarController_UpdateAll'
  10. FrameXML\ActionBarController.lua:62: in function <FrameXML\ActionBarController.lua:51>
  11.  
  12. Locals:
  13. InCombatSkipped

And the MultiBarRight is to 1.0 scale again (I don't use the MultiBarLeft)

The FrameXML\MultiActionBars.lua:85

Lua Code:
  1. local scale = 1;
  2. if ( contentHeight > availableSpace ) then
  3.     scale = availableSpace / contentHeight;
  4. end
  5.         MultiBarRight:SetScale(scale);    --> line 85
  6. if ( showLeft ) then
  7.         MultiBarLeft:SetScale(scale);
  8. end

I really don't understand why is not possible in an easy way to set scale to a value different from 1

P.s.
The other thing I don't understand is why if I call this code instead:

Lua Code:
  1. hooksecurefunc(MultiBarRight, "SetScale", function(self, scale)
  2.      self:SetScale(0.8)
  3. end)

which basically do the same thing of the code above it fired a lot of errors like:

Lua Code:
  1. 7x C stack overflow
  2. [C]: in function `SetScale'
  3. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  4. [C]: in function `SetScale'
  5. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  6. [C]: in function `SetScale'
  7. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  8. [C]: in function `SetScale'
  9. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  10. [C]: in function `SetScale'
  11. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  12. [C]: in function `SetScale'
  13. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  14. ...
  15. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  16. [C]: in function `SetScale'
  17. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  18. [C]: in function `SetScale'
  19. gmActionBars\core.lua:6: in function <gmActionBars\core.lua:5>
  20. [C]: in function `SetScale'
  21. FrameXML\MultiActionBars.lua:85: in function `MultiActionBar_Update'
  22. FrameXML\InterfaceOptionsPanels.lua:1184: in function `InterfaceOptions_UpdateMultiActionBars'
  23. [string "*:OnLoad"]:4: in function `setFunc'
  24. FrameXML\InterfaceOptionsPanels.lua:1154: in function <FrameXML\InterfaceOptionsPanels.lua:1147>
  25.  
  26. Locals:
  27. (*temporary) = MultiBarRight {
  28.  0 = <userdata>
  29.  SetScale = <function> defined =[C]:-1
  30.  slideOut = <unnamed> {
  31.  }
  32. }
  33. (*temporary) = 0.800000
  34. (*temporary) = <function> defined =[C]:-1
  35. (*temporary) = MultiBarRight {
  36.  0 = <userdata>
  37.  SetScale = <function> defined =[C]:-1
  38.  slideOut = <unnamed> {
  39.  }
  40. }
  41. (*temporary) = 0.800000
  42.  = <function> defined =[C]:-1
  43.  = <function> defined @gmActionBars\core.lua:5
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.

Last edited by gmarco : 03-25-19 at 07:33 PM.
  Reply With Quote