Thread Tools Display Modes
06-01-10, 09:52 AM   #1
Phewx2
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 10
if player_entering_world ?

Hello.

A short question...
I'd like to write a addon to scale my ui down when I enter the game.
I've written a .lua with this:

Code:
if 	PLAYER_ENTERING_WORLD then
	script UIParent:SetScale(0.5)
end
but it doesn't work :/
anything false?
  Reply With Quote
06-01-10, 09:57 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
try removing the word script.

Did you set up a TOC for your addon and put it in an appropriate addon folder ?
__________________


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
  Reply With Quote
06-01-10, 10:06 AM   #3
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
If that's the entirety of your code, it will never work.

Drycoded (meaning untested) it would be something like this:

Code:
local f = CreateFrame("Frame", nil, UIParent)
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(self, event)
	UIParent:SetScale(0.6)
	f:UnregisterAllEvents()
end)
and with all the other appropriate stuff Xrystal mentioned. I also doubt this is a very good way going about lowering the scale of your UI, does it even work?

I'd rather use SetCVar("UiScale", "0.6") though.
__________________
Oh, the simulated horror!
  Reply With Quote
06-01-10, 10:09 AM   #4
Phewx2
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 10
Originally Posted by Xrystal View Post
Did you set up a TOC for your addon and put it in an appropriate addon folder ?
Yes and the addon is shown in the ingame addon list. ^^

Without the word script it doesn't work. :/


Yay, with this piece of code it works thanks Ailae
I didn't think it would be so complicated.

http://www.wowinterface.com/download...8-UIScale.html

Last edited by Phewx2 : 12-06-11 at 03:14 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » if player_entering_world ?


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