Beautycase borders on Grid2 units
So, I've been trying to find where Grid2 handles its healthbars so I can add !beautycase borders to them with its "createborderlight" function, but I can't find it. Anyone that can help me with this?
Or, if there's another way to skin the borders of the actual unitframes, not just the background frame, that would be great :) Thanks in advance! |
I've been trying to find something similar with "statusbar", or a createframe that creates the health statusbar, or just the background of each unit. Without luck, though.
|
Here is a standalone version of the code I use to apply borders to Grid. It's been a while since I looked at the internals of Grid2, but I don't think the basics of frame setup is that different. Maybe it will give you some clues, especially the parts I highlighted in gold. The parts highlighted in green are specific to my border code, so may need changes for use with Beautycase.
Code:
local function SkinGrid() |
Thanks for sharing Phanx! Really nice of you, I think I took water over my head on this one :o
I've moved back to Grid because I like it better, and trying to get your code to work. To be honest, LUA is still an unfamiliar thing for me so I don't really know what to do with this code. Could I please ask for your help? :) Here are the borders I'm trying to add btw; |
Quote:
Code:
## Interface: 40300 |
Hi again Phanx! Hope you don't mind me necroing this thread.
I've been playing around with this again lately and got it working a little bit, but I can't get it to skin all the units. I've used /fstack to find out the names of the frames for the actual units in grid, not the background frame, and tried to attach a beautycase border to them with the beautycase function, which looks like this when I'm using your code; Code:
local function Grid_AddBorder(f) The different frames appearing when hovering the first unit in my party/raid with /fstack is; 1. GridLayoutHeader1UnitButton1 2. GridLayoutHeader1 3. GridLayoutFrame Here's the full code as it looks right now, I have no way if it is efficient as it is now but at least it's partially working; Code:
local function SkinGrid() |
That's because only the first frame exists when the addons load (eg. one frame for yourself, since the game doesn't yet know you're in a group).
You need to figure out what Grid's equivalent of :RegisterFrame is, and adjust the code accordingly. This is the function that is called when a new frame is created, and adds all of the visible elements (such as the frame's backdrop) and indicators to the frame. |
Alright! I'll hunt through grid's Lua-files when I get the time. If I do and find myself still clueless, could I ask you for more help? I like it when I have to do stuff myself so I learn, but still a newbie :)
|
Isn't that the point of this forum? If you have a question, ask it. If you don't understand the answer, ask another question. If you need help with code, post the code and explain what you need help with. :confused:
|
Yeah, with the risk of feeling annoying :p You know, when someone explains something and you think you undertand, but it turns out you don't so you have to ask them to explain even more. It's a rare thing that's going on in this forum, where people are so helpful.
|
I found this line in "GridFrame.lua"
Code:
function GridFrame:RegisterFrame(frame) Code:
function GridFrame:RegisterFrame(frame) |
You should generally avoid modifying addon files directly. The only reason to do so would be if the function you need to modify is declared as a local, and cannot be accessed from outside the file.
Code:
hooksecurefunc(GridFrame, "RegisterFrame", function(frame) |
Alright. But where should I be putting that hooksecurefunc? I've tried adding it to the SkinGrid addon but can't get it to work.
Here's how the code looks now, but it doesn't do anything since I don't have anything in the Grid_AddBorder funcion. If you could point out where to add it that would be awesome :) lua Code:
|
Quote:
|
Thanks for the hints unlimit. I did what you said, but still there seems to be something I'm missing. To make it simple, I tried using this code;
Lua Code:
Sadly, that doesn't do anything. I'm not sure about how hooksecurefunc works, but I'm guessing out of the blue that this code is something like this; "When grid spawns a new frame, this hooksecurefunc 'senses' it and fires my Grid_AddBorder function, which is a command that tells !beautycase to add a border to the frame spawned by grid". Please, correct me if I'm wrong. Which I probably am :p |
Quote:
Also, I think half of the advice I gave you is also wrong. <.< Setting it as a dependency is right, but honestly I don't really know where to put the hooksecurefunc now that I look at the code? Possibly just: lua Code:
>.> I'm still learning here too. |
Using that code does not print the message, and gives this error;
Code:
Message: Interface\AddOns\!Beautycase\!Beautycase.lua:11: attempt to call method 'CreateTexture' (a nil value) Lua Code:
|
Gee Wizz. D: Errors left and right. Yeah, like I said, I'm not really sure. Phanx or someone else who actually knows what they're doing is going to look at that code and think: "Nice job retard Unlimit!" the next time they get the chance! >.<
|
I feel exactly the same way every time I get help on this forum but still have to crawl back for more :p
|
Well, here is one problem:
Quote:
Lua Code:
Comments beginning with "IMPORTANT:" indicate sections that may need to be changed depending on how !Beautycase and/or Grid2 work internally. The code should work as-is, but if something doesn't work, those are the sections you should check first. Not tested in-game, so may contain syntax errors. :) |
All times are GMT -6. The time now is 01:10 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI