Skip to content

Commit d4a6f03

Browse files
committed
Add documentation for extracting global frame names from XML
1 parent 7ec760e commit d4a6f03

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

generator/FUTURE_CHANGES.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Extract Frame/Button/etc names as globals
2+
Parse all the XMLs and extract the name of frames.
3+
All frames are global if they have a name.
4+
Basically anything that contains the regex 'name="(\w.*?)"' is a global.
5+
```xml
6+
<Frame name="WorldMapFrame" inherits="WorldMapFrameTemplate" parent="UIParent" ignoreParentScale="true" frameBuffer="true">
7+
```
8+
9+
We take the "type" `Frame` and the name `WorldMapFrame`
10+
11+
```lua
12+
---@meta _
13+
14+
---@class WorldMapFrame : Frame
15+
local WorldMapFrame = {}
16+
```
17+
18+
Bonus:
19+
20+
We should create a inheritence tree to look for any `mixin=".*?"`
21+
22+
For example:
23+
```xml
24+
<Frame name="WorldMapFrame" inherits="WorldMapFrameTemplate" parent="UIParent" ignoreParentScale="true" frameBuffer="true"> <!-- This is a real frame that inherits a virtual frame -->
25+
26+
<Frame name="WorldMapFrameTemplate" inherits="MapCanvasFrameTemplate" mixin="WorldMapMixin" virtual="true"> <!-- This is virtual so it is not actually a frame but can be used as a template so "not a global" -->
27+
<!-- PS. the "inherits can contain mulitple frames for example `inherits="Template1, Template2"`
28+
```
29+
30+
```lua
31+
---@meta _
32+
33+
---@class WorldMapFrame : Frame, WorldMapMixin
34+
local WorldMapFrame = {}
35+
36+
```
37+
38+
It should be fully recursive parsing all trees and mixing them into one big inheritance if they exist.
39+
40+
```lua
41+
---@meta _
42+
43+
---@class ExampleFrame : Frame, Mixin1, MixinFromAnotherTemplate, Mixin4
44+
local ExampleFrame = {}
45+
46+
```

0 commit comments

Comments
 (0)