Thread Tools Display Modes
11-01-10, 08:00 AM   #1
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
little lua help

Guys, here's my UI. I need names of timer and calendar buttons to make it black as other. Anyone help? Tried calendar button, timer, timer texture, etc etc.

http://img213.imageshack.us/img213/6...0110165435.jpg
  Reply With Quote
11-01-10, 08:05 AM   #2
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
Type /fstack in game, mouse over them to get their names.
__________________

Twitter: @IonMaul | Windows Live: [email protected] | Google Talk: [email protected]
  Reply With Quote
11-01-10, 08:06 AM   #3
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
Originally Posted by lorti View Post
Guys, here's my UI. I need names of timer and calendar buttons to make it black as other. Anyone help? Tried calendar button, timer, timer texture, etc etc.

http://img213.imageshack.us/img213/6...0110165435.jpg
Привет, вот

select(1, TimeManagerClockButton:GetRegions()):SetVertexColor(.1,.1,.1)
select(1, GameTimeFrame:GetRegions()):SetVertexColor(.1,.1,.1)
  Reply With Quote
11-01-10, 08:28 AM   #4
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
for i,v in pairs({
MainMenuBarTexture0,
MainMenuBarTexture1,
MainMenuBarTexture2,
MainMenuBarTexture3,
MainMenuBarLeftEndCap,
MainMenuBarRightEndCap,
MainMenuMaxLevelBar0,
MainMenuMaxLevelBar1,
MainMenuMaxLevelBar2,
MainMenuMaxLevelBar3,
TimeManagerClockButton,
GetTimeFrame,
PlayerFrameTexture,
}) do
v:SetVertexColor(.35,.35,.35)
end

Tried to add their names here, but it didnt work. Tried to type
select(1, TimeManagerClockButton:GetRegions()):SetVertexColor(.1,.1,.1)
select(1, GameTimeFrame:GetRegions()):SetVertexColor(.1,.1,.1) too, didnt work either. What do I do wrong?

Last edited by lorti : 11-01-10 at 08:30 AM.
  Reply With Quote
11-01-10, 08:45 AM   #5
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
Originally Posted by lorti View Post
for i,v in pairs({
MainMenuBarTexture0,
MainMenuBarTexture1,
MainMenuBarTexture2,
MainMenuBarTexture3,
MainMenuBarLeftEndCap,
MainMenuBarRightEndCap,
MainMenuMaxLevelBar0,
MainMenuMaxLevelBar1,
MainMenuMaxLevelBar2,
MainMenuMaxLevelBar3,
TimeManagerClockButton,
GetTimeFrame,
PlayerFrameTexture,
}) do
v:SetVertexColor(.35,.35,.35)
end

Tried to add their names here, but it didnt work. Tried to type
select(1, TimeManagerClockButton:GetRegions()):SetVertexColor(.1,.1,.1)
select(1, GameTimeFrame:GetRegions()):SetVertexColor(.1,.1,.1) too, didnt work either. What do I do wrong?
попробуй так:
пишу с работы, проверить не могу никак
lua Code:
  1. for i,v in pairs({
  2.     MainMenuBarTexture0,
  3.     MainMenuBarTexture1,
  4.     MainMenuBarTexture2,
  5.     MainMenuBarTexture3,
  6.     MainMenuBarLeftEndCap,
  7.     MainMenuBarRightEndCap,
  8.     MainMenuMaxLevelBar0,
  9.     MainMenuMaxLevelBar1,
  10.     MainMenuMaxLevelBar2,
  11.     MainMenuMaxLevelBar3,
  12.     TimeManagerClockButton,
  13.     GetTimeFrame,
  14.     PlayerFrameTexture,
  15.     select(1, TimeManagerClockButton:GetRegions()),
  16.     select(1, GameTimeFrame:GetRegions()),
  17. }) do
  18.     v:SetVertexColor(.35,.35,.35)
  19. end
  Reply With Quote
11-01-10, 08:58 AM   #6
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
Ok it completely broke the addon.
  Reply With Quote
11-01-10, 09:37 AM   #7
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
Anyone else pls?
  Reply With Quote
11-01-10, 11:00 AM   #8
Aesh
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2009
Posts: 11
Try this
for i,v in pairs({
MainMenuBarTexture0,
MainMenuBarTexture1,
MainMenuBarTexture2,
MainMenuBarTexture3,
MainMenuBarLeftEndCap,
MainMenuBarRightEndCap,
MainMenuMaxLevelBar0,
MainMenuMaxLevelBar1,
MainMenuMaxLevelBar2,
MainMenuMaxLevelBar3,
TimeManagerClockButton,
GetTimeFrame,
PlayerFrameTexture,
ClockBorder, -- oops i forget commas
UICalendarButton,
}) do
v:SetVertexColor(.35,.35,.35)
end

or maybe UICalendarButtonBorder not sure

Last edited by Aesh : 11-01-10 at 11:08 AM.
  Reply With Quote
11-01-10, 11:32 AM   #9
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
Nope.

10characters.
  Reply With Quote
11-01-10, 12:57 PM   #10
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
Okay I just tried

Code:
for i,v in pairs({
                MainMenuBarTexture0,
                MainMenuBarTexture1,
                MainMenuBarTexture2,
                MainMenuBarTexture3,
                MainMenuBarLeftEndCap,
                MainMenuBarRightEndCap,
                MainMenuMaxLevelBar0,
                MainMenuMaxLevelBar1,
		MainMenuMaxLevelBar2,
		MainMenuMaxLevelBar3,
		TimeManagerClockButton,
		GameTimeFrame,
		PlayerFrameTexture,
             }) do
                v:SetVertexColor(.35,.35,.35)
             end
And got lua-error

Message: Interface\AddOns\rActionButtonStyler\config.lua:34: attempt to call method 'SetVertexColor' (a nil value)
Time: 11/01/10 21:53:19
Count: 1
Stack: Interface\AddOns\rActionButtonStyler\config.lua:34: in main chunk

Locals: addon = "rActionButtonStyler"
ns = <table> {
}
cfg = <unnamed> {
0 = <userdata>
}
(for generator) = <function> defined =[C]:-1
(for state) = <table> {
1 = MainMenuBarTexture0 {
}
2 = MainMenuBarTexture1 {
}
3 = MainMenuBarTexture2 {
}
4 = MainMenuBarTexture3 {
}
5 = MainMenuBarLeftEndCap {
}
6 = MainMenuBarRightEndCap {
}
7 = MainMenuMaxLevelBar0 {
}
8 = MainMenuMaxLevelBar1 {
}
9 = MainMenuMaxLevelBar2 {
}
10 = MainMenuMaxLevelBar3 {
}
12 = GameTimeFrame {
}
13 = PlayerFrameTexture {
}
}
(for control) = 12
i = 12
v = GameTimeFrame {
0 = <userdata>
timeOfDay = 1191
flashTimer = 0
pendingCalendarInvites = 0
hour = 19
}
(*temporary) = nil
(*temporary) = GameTimeFrame {
0 = <userdata>
timeOfDay = 1191
flashTimer = 0
pendingCalendarInvites = 0
hour = 19
}
(*temporary) = 0.35
(*temporary) = 0.35
(*temporary) = 0.35
(*temporary) = "attempt to call method 'SetVertexColor' (a nil value)"
If I remove red it works fine (changes color of main bar, player frame). How can I fix that?

Last edited by lorti : 11-01-10 at 01:00 PM.
  Reply With Quote
11-01-10, 03:13 PM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by Wildbreath View Post
Привет, вот

select(1, TimeManagerClockButton:GetRegions()):SetVertexColor(.1,.1,.1)
select(1, GameTimeFrame:GetRegions()):SetVertexColor(.1,.1,.1)
select() does not do what you think it does.

Code:
function foo()
     return "a", "b", "c", "d"
end
select(1, foo())
>> "a", "b", "c", "d"
select(2, foo())
>> "b", "c", "d"
You may as well leave out the extra function call.
TimeManagerClockButton:GetRegions():SetVertexColor(.1,.1,.1)
__________________
"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
11-01-10, 03:15 PM   #12
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Edit: Forget my post
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
11-01-10, 03:48 PM   #13
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
Originally Posted by Seerah View Post
select() does not do what you think it does.

Code:
function foo()
     return "a", "b", "c", "d"
end
select(1, foo())
>> "a", "b", "c", "d"
select(2, foo())
>> "b", "c", "d"
You may as well leave out the extra function call.
TimeManagerClockButton:GetRegions():SetVertexColor(.1,.1,.1)
Hehe, thanks Seerah, it that i meant. I had a difficult day on job today and make this stupid mistakes

Lorti, сделай как она говорит

TimeManagerClockButton:GetRegions():SetVertexColor(.1,.1,.1)
GameTimeFrame:GetRegions():SetVertexColor(.1,.1,.1)

должно по идее работать
  Reply With Quote
11-01-10, 10:07 PM   #14
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Okies. At least lorti now knows how it works.
__________________
"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
11-02-10, 12:28 AM   #15
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
It doesn't work( Again same error as above.
  Reply With Quote
11-02-10, 01:34 AM   #16
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
Originally Posted by lorti View Post
It doesn't work( Again same error as above.
i hope, u call this function afrer event ADDON_LOADED fired (when blizzard TimeManager addon is loaded - check it)? Cause TimeManager frame textures load after addon is loaded

Simply copy-paste in top on every lua file isnt working ofc in this case

В общем тут просто копированием в начало LUA файла не обойдешься, тут надо ставить хук на эвент ADDON_LOADED на близовский аддон TimeManager и как он загрузится уже красить, иначе никак
  Reply With Quote
11-02-10, 02:29 AM   #17
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
How can I do it?
  Reply With Quote
11-02-10, 02:41 AM   #18
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
Originally Posted by lorti View Post
How can I do it?
lua Code:
  1. local ef=CreateFrame("Frame")
  2. ef:RegisterEvent("ADDON_LOADED")
  3. ef:SetScript("OnEvent", function(self, event, addon)
  4.     if(addon=="Blizzard_TimeManager") then
  5.         for i,v in pairs({
  6.             MainMenuBarTexture0, MainMenuBarTexture1, MainMenuBarTexture2, MainMenuBarTexture3, MainMenuBarTexture4,
  7.             MainMenuBarLeftEndCap, MainMenuBarRightEndCap,
  8.             MainMenuMaxLevelBar0, MainMenuMaxLevelBar1,
  9.             PlayerFrameTexture, TargetFrameTextureFrameTexture, PetFrameTextureFrameTexture, FocusFrameTextureFrameTexture, TargetFrameToTTextureFrameTexture, FocusFrameToTTextureFrameTexture,
  10.             MinimapBorder,
  11.             select(1, TimeManagerClockButton:GetRegions()), select(1, GameTimeFrame:GetRegions()),
  12.         }) do
  13.            v:SetVertexColor(.1, .1, .1)
  14.         end    
  15.         self:UnregisterEvent("ADDON_LOADED")
  16.         ef:SetScript("OnEvent", nil)
  17.     end
  18. end)
  Reply With Quote
11-02-10, 03:06 AM   #19
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
Finally it worked Thanks.
  Reply With Quote
11-02-10, 10:59 AM   #20
lorti
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 17
okay 1 more problem. I did almost everything I need, exept target and focus cast bars. Tried all var. of "TargetFrameSpellBarTexture", "TargetFrameSpellbar", "TargetFrameSpellBarBorder" etc. Any1?
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » little lua help


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