WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Classic: Script into addon (https://www.wowinterface.com/forums/showthread.php?t=57570)

lurtex 10-03-19 01:30 AM

Classic: Script into addon
 
Hey

Im wondering if anyone can help me to convert some scripts into an addon so i dont have to manually run it every time i log on (works on retail but not on classic), and how to make the TargetFrameNameBackground transparent like my player frame:
https://gyazo.com/1446e21a2c71cb8b104fc8cf4c2bd2f9


/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==PlayerFrameHealthBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==TargetFrameHealthBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==PlayerFrameManaBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==TargetFrameManaBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)

Thank you

jeffy162 10-03-19 05:08 AM

You could paste them in to https://addon.bool.no/ , and it will spit out an addon for you. It's been a long time since I used it so I don't remember exactly what you have to do but I do remember that you have to edit the strings a little. I know that you have to take the "/run" off the beginning of each line, though. It'll even make a .toc file for you (but you might have to edit it a little bit to make it to your liking :o ).

But, it'll make you a serviceable addon.

Kanegasi 10-03-19 04:05 PM

The website jeffy linked is what I suggest using to create an addon out of your script (don't forget to remove the /runs as they suggested), but you also need to open the .toc file from the downloaded folder and change 80200 to 11302 so the addon can run without using the "load out of date addons" option.

As for making the target frame transparent, here you go:

Lua Code:
  1. hooksecurefunc("TargetFrame_CheckFaction",function(self)
  2.     self.nameBackground:SetVertexColor(0,0,0,0.5)
  3. end)

This will make the targetframe's name background the same color and alpha as the playerframe, but it will no longer show gray for tapped units or any other color.

Finally, about your "works in retail and not in classic" comment, what is that referring to? Your scripts? You need to make sure "numeric values" is selected in Esc > Interface Options > Display, which gives the frames the "### / ###" format you're trying to change.

lurtex 10-04-19 08:48 PM

Quote:

Originally Posted by Kanegasi (Post 334130)
The website jeffy linked is what I suggest using to create an addon out of your script (don't forget to remove the /runs as they suggested), but you also need to open the .toc file from the downloaded folder and change 80200 to 11302 so the addon can run without using the "load out of date addons" option.

As for making the target frame transparent, here you go:

Lua Code:
  1. hooksecurefunc("TargetFrame_CheckFaction",function(self)
  2.     self.nameBackground:SetVertexColor(0,0,0,0.5)
  3. end)

This will make the targetframe's name background the same color and alpha as the playerframe, but it will no longer show gray for tapped units or any other color.

Finally, about your "works in retail and not in classic" comment, what is that referring to? Your scripts? You need to make sure "numeric values" is selected in Esc > Interface Options > Display, which gives the frames the "### / ###" format you're trying to change.

Hey, thanks for the help!

Yea the color of tapped units might be a problem I realized. Is it possible to only works on players?

Thanks again


All times are GMT -6. The time now is 03:45 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI