WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Extracting default blizz UI (https://www.wowinterface.com/forums/showthread.php?t=59738)

LordMcLordus 12-17-23 04:34 PM

Extracting default blizz UI
 
Can't find anything with the search tool on these forums so I'm asking here; I have some basic Lua and XML down; picked up the WoW programming book, but a lot of links are broken or dated. The WoW Interface Tool doesn't exist anymore, and the console commands "exportInterfaceFiles code" or "exportInterfaceFiles art" don't seem to be working

Fizzlemizz 12-17-23 04:38 PM

To Export
You have to make changes to the game launch settings to be able to export and you have to be at the character select screen, not actually in-game to run the export.

LordMcLordus 12-17-23 04:40 PM

Thank you so much for fast response. I'll do that now, I'm super excited to get into this!!

Fizzlemizz 12-17-23 04:46 PM

The site linked has the best and latest API information.

Have Fun!

LordMcLordus 12-17-23 06:47 PM

If you linked a site I cannot see it

Do you know any online validator/checker for .xml against the W3C standard or whatever? Forgive me I am not a coder and this language can be difficult to grasp. I would just like to look at the default blizzard UI xml (with Visual Studio) and try to piece together from there, then I'll start making the Bag addon that's in the book (which is very helpful by the way for anyone reading despite some outdated information)

Fizzlemizz 12-17-23 07:14 PM

The site linked in my OP to the extract information. The documentation has moved from WowPedia to Wiki.gg.

There is nothing specific to wow for vaildating XML. For VS try this. It should have links to all the required bits.

You'll want to install BugGrabber and BugSack for in-game debugging (they work together).

LordMcLordus 12-17-23 11:01 PM

thank you!

LordMcLordus 12-18-23 04:17 AM

3 Attachment(s)
I'm trying to get this red square to appear in the center of the screen per the book, but not working...is there something wrong with this syntax?

Xrystal 12-18-23 07:06 AM

That looks like visual studio code and they do have a wow api extension available.

I just installed the extension on my newly installed visual studio code ( for unity coding ) and it seems to work but it still seems to have some issues as it reported a few errors which as far as I know aren't a problem ( but I could be wrong ) . Ah .. the errors I am seeing is because it isn't fully set up yet .. ``

Last updated last week so quite recent. With the following known issues.

-- Frame templates are not completely supported, only BackdropTemplate (#15)
-- The Classic (TBC) API is not supported (#13)


** Rereads the post and realises you weren't asking for something like that screen but regarding the code inside *slaps head*

Fizzlemizz 12-18-23 09:07 AM

In RedSquareTest you have
Code:

<Layer setAllPopints="tue" color=...
A Layer describes the DrawLayer it's children will apear in in the parent frame.

The actual square would have to be a
Code:

<Texture ...
element with a size and anchor to place it within the frame.

The same with the CreateFrame version. It would require

Code:

RedSquareTest.Texture = RedSquareTest:CreateTexture(nil, "BACKGROUND")
RedSquareTest.Texture:SetAllPoints()
RedSquareTest.Texture:SetColorTexture(1, 0, 0)

As an aside, where you are using frame = ... you should use local frame = ... (unless you are re-using a previously created local) otherwise you are creating the varable as a global which (if using simple variable names) could overwrite a global from another addon or the Blizzard UI (they all share the same global table and Blizzard will use simple or "meaningful" names for global variables and they use a LOT ot them).
If you need to create globals, make them unique and identifiable by adding something like the name/acronym of your addon (same goes for frame/region names as these are also added to the global table).

As an aside aside. You can use either XML or CreateFrame (in lua code) you don't need both (unless you are creating a virutal or an intrinsic which require XML). There is no real benefit from using one over the other apart from preference.

As an aside aside...aside. Where you use
Code:

local frame = CreateFrame(...)
You can then refer to the frame using frame (while it is in scope) rather than the frame's name. Not every frame/texture/fontstring etc. needs a name).

LordMcLordus 12-18-23 11:18 AM

thank you so much for being active in this thread and helping me through this, it will take me a few minutes to read all that but stay tuned!

LordMcLordus 12-18-23 01:26 PM

Do you have a preferred method for viewing the image texture files (like the ones included in the extracted art folder?) The addon Texbrowser (mentioned in the book) doesn't seem to exist anymore, so I have no idea if there is a more categorical/up to date source to which to view this info

Fizzlemizz 12-18-23 01:43 PM

You could try TextureAtlasViewer

If you want to convert from/to .blp/.png then
BLPNGConverter
and/or
BLP2PNG

There's also wow.tools but it's not being maintained these days so...

There also the game (if you know an element through something like /fstack you can often find the associated texture in the code files).

I'm sure there's others.

The game also accepts .png files these days so you're not limited to just .tga or .blp if you're creating your own.

Kanegasi 12-18-23 03:49 PM

https://wago.tools is the spiritual successor to wow.tools. There's also this page on wow.tools directing you to alternatives.

Fizzlemizz 12-18-23 04:15 PM

BugSack should be giving you an error because you're missing the end tag for <ui ... as the last thing in the code you posted.

Code:

</Ui>
XML right ;)

Btw, best to post code as code not images as images are impossible to properly test in-game.

LordMcLordus 12-21-23 07:09 PM

what is wrong with this? I'm trying to use CreateTexture and Texture functions but it keeps returning a nil value

Code:

frame=CreateFrame("Frame", "BagBuddy", UIParent)
BagBuddy:SetWidth(384)
BagBuddy:SetHeight(512)
BagBuddy:SetPoint("CENTER", UIParent, "CENTER")
BagBuddy:SetFrameStrata("HIGH")
BagBuddy:SetFrameLevel(5)
BagBuddy:SetToplevel(true)

BagBuddy.texture1=BagBuddy:createTexture("Interface\\BankFrame\\UI-BankFrame-TopLeft")
BagBuddy.texture2=createTexture("Interface\\BankFrame\\UI-BankFrame-TopRight")
BagBuddy.texture3=createTexture("Interface\\BankFrame\\UI-BankFrame-BotLeft")
BagBuddy.texture4=createTexture("Interface\\BankFrame\\UI-BankFrame-BotRight")

function BagBuddy_OnLoad(self)
  SetPortraitToTexture(self.portrait,"Interface\\Icons\\INV_Misc_EngGizmos_30")
end

BagBuddy.title = BagBuddy:CreateFontString("BagBuddy_Title",
"OVERLAY", "GameFontNormal")
BagBuddy.title:SetPoint("TOP", 0, -18)
BagBuddy.title:SetText("BagBuddy")


LordMcLordus 12-21-23 07:18 PM

I also have to ask, this is a most inneficient way to learn...the book has a ton of .xml examples but like you posted earlier, it is impossible to verify to know if the code is working or not...I'm not even sure how to get the visual studio interpreter/debugger thing to work correctly, so I just have to resort to the in-game .lua addon

in addition to these even the most mild syntax causes tremendous confusion. How in the world do people learn this?!?!

Fizzlemizz 12-21-23 07:55 PM

Code:

frame=CreateFrame("Frame", "BagBuddy", UIParent)
In the .XML example the frame would
Code:

inherit="SomeTemplate"
When using CreateFrame, the 4th argument is used to specify the templates the frame should enherit. Because you didn't include the template, you only created a base "blank" frame.

You seem to be trying to "re-create" the template in .lua which is doable but you would need to follow ALL the frames/regions and attributes of the template (notably, the .portrait texture at least is missing so SetPortraitToTexture() will fail).

Pretty much every attribute used in XML has an equivalent method to use with .lua code (usually [frame]:Setxxx()). The Wiki and game UI code is the best resource along with other addons. Templates are a bit different (like the frame name) because they have to be applied when the frame is created.

With createTexture(), this just created a base "blank" texture. You would need too

Code:

BagBuddy.texture1=BagBuddy:CreateTexture() -- Create the texure
BagBuddy.texture1:SetTexture("Interface\\BankFrame\\UI-BankFrame-TopLeft") -- Set it to show
BagBuddy.texture1:SetSize(xx, xx) -- give it a size
BagBuddy.texture1:SetPoint("TOPLEFT")-- Anchor to something (it's parent by default)

You can use multiple anchors instead of sizing. The same approach goes for any widget (FontStrings...).

Lua is case sensitive so while an XML attibute will use camel case, .lua Set methods don't xxx:SetSomeAttribute()

Also, should use:
Lua Code:
  1. local frame=CreateFrame("Frame", "BagBuddy", UIParent)
Where the local declaration prevents cluttering up the global table especially with such a common name for a variable such as frame.

Quote:

How in the world do people learn this?!?!
Time and practice and not assuming that just because it's for a game, it's going to or should be "easy". Not trying to be mean, many people (especially if comming from other programming languages) make this assumption.


All times are GMT -6. The time now is 07:28 AM.

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