11-28-10, 04:23 PM | #1 |
Hiding Actionbutton borders?
I'm almost finished with a little addon to add a custom vehicle bar wherever you'd like it anchored and I've got a small graphical issue I'd like gone. I'm sure this is an easy fix but I'd really like to hide the borders around the action buttons. I'm fairly certain its not the icons themselves as they should be border free (replacement icons).
Ideas? |
|
11-28-10, 04:46 PM | #2 | |
and try this VehicleMenuBarActionButton1.Border:Hide() see if that gets rid of it. Then of course do that for all the buttons... |
||
11-28-10, 04:55 PM | #3 |
Only sissys need the leave button
trying that gives this error: attempt to index field 'Border' (a nil value) |
|
11-28-10, 05:03 PM | #4 |
try it without the . in there so it reads VehicleMenuBarActionButton1Border:Hide()
and leave buttons are a must. just ask all the people stuck in turkey day chairs because the addon or interface they are using failed to think about the leave button. |
|
11-28-10, 05:09 PM | #5 |
I guess all those people didn't try the whole right click on yourself and choose the leave option? Silly people
I have leave vehicle keybound anyway. Sadly no period doesn't work either. I've also tried SetBackdropBorderColor(0, 0, 0, 0) which doesn't work |
|
11-28-10, 05:09 PM | #6 |
you also want to hide... VehicleMenuBarActionButton1NormalTexture:Hide()
The no period is working. You just dont notice the border texture. Do the normal texture and its gone. You can remove the highlight and pushed textures but i dont remember how to remove none named textures... or maybe you couldnt? i think i found a way i just dont remember it now. Unfortunately the highlight and pushed textures do not have names. edit- it just hit me... you might be able to overwrite the xml texture setting with lua texture setting so if you do VehicleMenuBarActionButton1HighlightTexture:SetTexture(nil) or VehicleMenuBarActionButton1.HighlightTexture:SetTexture(nil) you could also sub nil with your own texture... or a blank one if nil does not work... Last edited by Grimsin : 11-28-10 at 05:43 PM. |
|
11-28-10, 05:44 PM | #7 |
Yep, thats working... sortof. They are initially hidden, but on use the border is coming back I tried unregistering the borders from events with:
Code:
local buttonborder, buttontexture for i = 1, VEHICLE_MAX_ACTIONBUTTONS do buttonborder = _G["VehicleMenuBarActionButton"..i.."Border"] buttontexture = _G["VehicleMenuBarActionButton"..i.."NormalTexture"] buttonborder:SetScript("OnEvent", nil) buttontexture:SetScript("OnEvent", nil) buttonborder:Hide() buttontexture:Hide() end attempt to call method 'SetScript' (a nil value) I might just move those frames offscreen and be done with it ghetto style. Last edited by maltese : 11-28-10 at 05:54 PM. |
|
11-28-10, 06:05 PM | #8 |
no no dont do that.
what you need to do is... yourframe:hide() yourframe.show = yourframe:hide() this will keep it always hidden there is a better way to do it actually but requires a bunch of other stuff be setup... like here is my do nothing function take over and hide function local function DoNothing() end local function HideFrame(reference) local frame = type(reference) == 'string' and _G[reference] or reference if type(frame) ~= 'table' then return end frame.Show = DoNothing frame:Hide() end then to actually hide your frame you do HideFrame("yourframe") then you can just do that HideFrame("yourframe") for each button instead of having to write out the .show = :hide part for each button and youll never see it again. Unregistering events from the frame will cause you a ton of problems. Oh yea and on a final note... what your doing will cause an extreme amount of taint. You will most likely never notice it but just letting you know its happening. -- to do this with out so much taint you would have to write a bunch of secure code to move the buttons and the frame around. Add that leave button and ill be downloading your addon Last edited by Grimsin : 11-28-10 at 06:10 PM. |
|
11-28-10, 06:32 PM | #9 |
Code:
local function DoNothing() end local function HideFrame(frame) if type(frame) == "string" then frame = _G[frame] end if type(frame) == "table" and frame.Show then frame.Show = DoNothing frame:Hide() end end Code:
HideFrame(Minimap) HideFrame("Minimap") |
|
11-28-10, 08:25 PM | #10 |
I'll see about adding that leave vehicle button in. Couple people in my guild like it as well but all said "where's the leave button"
EDIT: Just a heads up, both of the above code segments hide the border frames, but as soon as I use the ability the border comes right back. Last edited by maltese : 11-28-10 at 09:31 PM. |
|
11-29-10, 12:14 AM | #11 |
Simply ":Hide"ing frame would server nothing, and redefining Show directly is not very good as well.
Try frame:SetScript("OnShow", frame.Hide); frame:Hide(); Even if it would not work for you, this is the preferred way of doing this thing. P.S. Try to override the OnUpdate handler as well. |
|
11-29-10, 01:08 AM | #12 | |
oh and as another note to the whole re-setting bliz's set scripts... it will more then likely break other addons. |
||
11-29-10, 02:36 AM | #13 | |
Your post sounds just like i'm overriging global OnShow for all frames with single command... ... ............ go figure my reaction. |
||
11-29-10, 05:35 AM | #14 | |
I'll hopefully have the vehicle exit button working sometime on tuesday. I wont have a chance to work on it today. |
||
11-29-10, 08:26 AM | #15 | |
Also note that if you really need to change/add those scripts you do hookscript or hooksecurefunc. OR you go to the bliz setscript you want to modify you copy the entire thing paste it into your code and then modify it. That way you maintain any other functionality within it. This also means any other functions used within that script that are not global will have to be cut and pasted as well. and quite frankly if you are not going to rebuild from scratch the vehiclemenubar then frame adjustments and button positioning should be done in secure code. The vehiclemenubar is tied into the frame animation system pretty heavily, you will taint the living hell out of it if you do not use secure code. it WILL cause funny problems down the road. Like getting no buttons or bar at all when entering/exiting a vehicle. Even worse glitchs while in combat. Last edited by Grimsin : 11-29-10 at 08:43 AM. |
||
11-29-10, 08:27 AM | #16 | |
|
||
11-29-10, 08:46 AM | #17 |
Oh and you should put this line at the top of your file... not that it really helps as much as one would hope.. it does help a lil with the tainting issues.
UIPARENT_MANAGED_FRAME_POSITIONS['VehicleMenuBar'] = nil here is what my vehicle code looks like, all my code does is modify the graphics and scale as well as allow for positioning without AS much taint. You can see the 3 functions at the bottom, those seem to be the main controllers for bliz frames and buttons. If you hook your frame changes to it things should work just fine. Also note that the way it lays out the frames changes based on if it is a vehicle with angle/pitch button and meter or not. edit - The reason for this is because bliz reused texture names but not textures on the vehic bar so if you hide TextureblahblahblahA on the nonpitch it may be a different piece of the bar then TextureblahblahblahA on the pitch enabled vehic bar, but all having same frame and texture names. lua Code:
This is my frame hider code, you can see a lot of vehiclemenubar frames listed. Note that you should not unregister any events for any of the vehic bar frames. lua Code:
oh and i guess you need to see the core functions to or some of this may not make sense... lua Code:
Last edited by Grimsin : 11-29-10 at 03:34 PM. |
|
11-30-10, 07:52 AM | #18 |
Aye, what you posted did infact hide the borders on entering a vehicle but the issue arises when you actually use the ability. The border for that ability pops back instantly. I'm looking at the code you posted for secure headers. I should have the vehicle exit button implemented today.
As for taint issues, you'll have to excuse my newbness here. My knowledge of lua is extremely limited and I've learned mostly everything from looking at code over the years and researching wowwiki's API pages. I've done some searches on the topic of taint and turned up discussion about moving actionbars when in combat. I do know that with some of the first iterations of the code I tried I did run into a LOT of errors when getting into a vehicle in combat with wow giving the error "Interface action failed because of an Addon". I'm assuming thats what you are referring to. I worked around that by moving all the positioning code around to move the frames during the PLAYER_ENTERING_WORLD event and haven't that issue since, even when entering a vehicle in combat. I'm just setting the Alpha to 0 when you are not actually in a vehicle and since the vehicle bar isn't there anyway, you wont have issues with buttons being invisible but click able. Now if you are saying that taint is still occurring even though I'm not moving anything in combat, then I guess this entire addon would have to be rewritten using secure code, which I guess I could do but I'll have to read up on the subject. Furthermore I think the only time there would actually be an issue is if you DC'd in the middle of a boss fight that required vehicles and logging back in would break the functionality of the mod (since I move everything at login). I guess its time to look at your code and read up to see if its actually something I can fix. EDIT: On reflection of the very sort period of time I worked on adding the vehicle exit button the other night I noticed that the button was displayed correctly but was not clickable at all. I realize now a couple things: 1: I'm fairly certain that the vehicle action bar that I'm displaying isn't clickable either. I didn't test that because I used keybindings to test to see if the cooldown frame was working. 2: All this addon is doing (I think) is moving the graphics of the buttons to the defined anchor and not the actual button itself. 3: This explains why I'm not getting the errors anymore when getting into and out of combat (since I'm not moving the buttons themselves) 4: If I wanted the actual buttons moved I'd have to completely rewrite the addon to use secure functions like you suggested. 5: The taint issue you are talking about is going to affect my other addon as well (I think its limited to DCing and relogging in combat, but what do I know ) 6: All of the clicking issues could be the taint you are describing and I just have no clue what I'm talking about (likely) 7: I'm a piss poor coder I'll try to test this today and figure out what exactly is going on and see if its an easy fix. If not then I'm tempted to just leave it as is with the understanding that this addon is just for the graphical display of the vehicle bar for reference and know that it will not fit the needs of 99.9999% of people that use addons. Minus the unconfirmed issues with errors on reloading in combat it fits all the needs I have for it and I'm really just not good enough of a coder to provide full feature addons like the pros here. Last edited by maltese : 11-30-10 at 08:26 AM. |
|
11-30-10, 10:41 AM | #19 |
Taint sucks lemme tell ya. what taint is, hmm well basically its a small error that happens any time you move or do anything tied into any part of the secure bliz code.? It is most noticeable when it comes to combat but it does happen at other times. Often times taint is not a big deal, like moving simple frames and such. When it becomes a bigger deal though is when it comes to action buttons. Or adjusting frames tied into the animation system like the pet bar, stance change bars, and the vehicle bar most notably.
The thing about most taint is you can ignore it. When its really a problem is when it actually pops that msg about action blocked. Then it stops game play and something definitely did not work. If you turn taint logging off which i think by default it is off then most taint will never be an issue. As far as when you do the layout, so the frame is not movable once the game loads? Want to post your code? ill take a look, i know a little bit about secure code. With my code the bar is movable via my frame moving system and the buttons are still click-able. Biggest glitches i have is getting in and out of vehicles while in combat. I jump out of siege a lot to deal with people chasing me. .. My code does not use secure code just secure function hooks, the buttons do not have to have secure code to be moved... although secure code is better lol. It might be easiest to modify the bliz frame like i was rather then rebuild one. At the same time if you rebuild the frame all together and use some secure code for the buttons you would get away from all the taint issues. Here are some secure chunks out of GrimUI. This is a secure method to toggle the backpack so it does not taint when using the inventory in combat. lua Code:
this chunk here toggles the combatlog on/off as well as a bank of buttons. lua Code:
this is the button creation you either are dealing with button id 121-132 or they made something else for vehics but i think it is the same buttons for posses so... if you try to remake the buttons i would go with id 121-132 This is the chunk that was originaly from Giest although heavily modified now. Notice it is not really secure code just the option to show hide it needed to be to avoid in combat problems. lua Code:
|
|
11-30-10, 10:46 AM | #20 |
Oh also might wanna take a look at some of the other actionbar addons that have something that deals with the vehicle bar like macaroon has a vehicle bar replacement but all it replaces is the action buttons it does not deal with the health/power stuff. It does deal with the leave button as well as pitch buttons. His code is pretty complex though hehe ive looked a few times and get overwhelmed real quick.
|
|
WoWInterface » Developer Discussions » Lua/XML Help » Hiding Actionbutton borders? |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|