Thread Tools Display Modes
03-06-10, 01:31 PM   #1
hairy_palms
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 25
Map Error

Ive been using 1 Line of Lua to scale my worldmap, and it works fine, but it errors out if i try and open the map while in combat, not sure why combat would change the world map frame code is

Code:
WorldMapFrame:HookScript("OnShow", function(self) self:SetScale(0.7) end)
and i just get an "Interface Action Failed Because of an Addon"
any ideas whats wrong from lua pros around here?
  Reply With Quote
03-06-10, 02:41 PM   #2
Ravendwyr
A Flamescale Wyrmkin
 
Ravendwyr's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 139
Try using this:
Code:
WorldMapFrame:SetScale(0.7)
Will that help?
__________________
Twitter | GitHub
  Reply With Quote
03-06-10, 03:11 PM   #3
hairy_palms
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 25
just that on its own doesnt work at all, without hooking into the worldmaps onshow event.
if i change it to

Code:
WorldMapFrame:HookScript("OnShow", function() WorldMapFrame:SetScale(0.7) end)
its the same result as before, as im just calling the worldmapframe a different way.
  Reply With Quote
03-06-10, 03:20 PM   #4
Ravendwyr
A Flamescale Wyrmkin
 
Ravendwyr's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 139
How about this:
Code:
WorldMapFrame:HookScript("OnShow", function()
  if not InCombatLockdown() then
    WorldMapFrame:SetScale(0.7)
  end
end)
By using this, changing the scale will only happen when out of combat, but there is a chance that it will be full size in combat.
My WoW account is frozen at the moment so I can't test this.
__________________
Twitter | GitHub
  Reply With Quote
03-06-10, 03:29 PM   #5
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
This is what I used to use before I quit WoW, it might still work

Code:
UIPanelWindows["WorldMapFrame"] = nil
hooksecurefunc(WorldMapFrame, "Show", function(self)
	self:SetScale(0.75)
	self:EnableKeyboard(false)
	BlackoutWorld:Hide()
	WorldMapFrame:EnableMouse(false)
end)
  Reply With Quote
03-06-10, 04:17 PM   #6
hairy_palms
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 25
By using this, changing the scale will only happen when out of combat, but there is a chance that it will be full size in combat.
My WoW account is frozen at the moment so I can't test this
thats what happens with my current code, full size in combat scaled out of combat
This is what I used to use before I quit WoW, it might still work
Code:
hooksecurefunc(WorldMapFrame, "Show", function(self)
	self:SetScale(0.75)
end)
gave the same result, scaling out of combat and not scaling in combat
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Map Error


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