Reply
Thread Tools Display Modes
Unread 06-01-10, 09:52 AM   #1
Phewx2
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 5
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?
Phewx2 is offline   Reply With Quote
Unread 06-01-10, 09:57 AM   #2
Xrystal
nUI User and Supporter
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,035
try removing the word script.

Did you set up a TOC for your addon and put it in an appropriate addon folder ?
__________________
Xrystal is offline   Reply With Quote
Unread 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: 317
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!
Ailae is offline   Reply With Quote
Unread 06-01-10, 10:09 AM   #4
Phewx2
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 5
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.
Phewx2 is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » if player_entering_world ?

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