Skip to content

Commit 1387792

Browse files
committed
Fix PlayerLocation, ItemLocation, TransmogLocation
1 parent 022bf61 commit 1387792

File tree

9 files changed

+72
-18
lines changed

9 files changed

+72
-18
lines changed

Annotations/Interface/Blizzard_FrameXML/TransmogUtil.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ TransmogPendingInfoMixin = {}
99
---@param category number
1010
function TransmogPendingInfoMixin:Init(pendingType, transmogID, category) end
1111

12+
---@class TransmogLocationType
13+
---@field slotID? InventorySlots
14+
---@field type? Enum.TransmogType
15+
---@field modification? Enum.TransmogModification
16+
1217
---[Documentation](https://warcraft.wiki.gg/wiki/TransmogLocationMixin)
13-
---@class TransmogLocationMixin
18+
---@class TransmogLocationMixin : TransmogLocationType
1419
TransmogLocationMixin = {}
1520

1621
---@param slotID number

Annotations/Interface/Blizzard_ObjectAPI/ItemLocation.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
---@meta _
22
ItemLocation = {}
33

4-
---@class ItemLocationMixin
4+
---@class ItemLocationType
5+
---@field equipmentSlotIndex? number
6+
---@field bagID? number
7+
---@field slotIndex? number
8+
9+
---@class ItemLocationMixin : ItemLocationType
510
---[Documentation](https://warcraft.wiki.gg/wiki/ItemLocationMixin)
611
ItemLocationMixin = {}
712

Annotations/Interface/Blizzard_ObjectAPI/PlayerLocation.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---@meta _
22
PlayerLocation = {}
33

4+
---@class PlayerLocationType
5+
---@field unit? string
6+
---@field chatLineID? number
7+
---@field guid? string
8+
49
---[Documentation](https://warcraft.wiki.gg/wiki/PlayerLocationMixin)
5-
---@class PlayerLocationMixin
10+
---@class PlayerLocationMixin : PlayerLocationType
611
PlayerLocationMixin = {}
712

813
---@param guid string

Annotations/Interface/Blizzard_SharedXML/Color.lua

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---@meta _
2+
3+
---@class ColorType
4+
---@field r number
5+
---@field g number
6+
---@field b number
7+
---@field a? number
8+
29
---[FrameXML](https://www.townlong-yak.com/framexml/go/ColorMixin)
3-
---@class ColorMixin
4-
---@field r number|nil
5-
---@field g number|nil
6-
---@field b number|nil
7-
---@field a number|nil
10+
---@class ColorMixin : ColorType
811
ColorMixin = {}
912

1013
---[FrameXML](https://www.townlong-yak.com/framexml/go/CreateColor)

Annotations/Interface/Blizzard_SharedXML/Vector2D.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---@meta _
2+
3+
---@class Vector2DType
4+
---@field x number
5+
---@field y number
6+
27
---[FrameXML](https://www.townlong-yak.com/framexml/go/Vector2DMixin)
3-
---@class Vector2DMixin
4-
---@field x number|nil
5-
---@field y number|nil
8+
---@class Vector2DMixin : Vector2DType
69
Vector2DMixin = {}
710

811
---[FrameXML](https://www.townlong-yak.com/framexml/go/CreateVector2D)

Annotations/Interface/Blizzard_SharedXML/Vector3D.lua

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---@meta _
2+
3+
---@class Vector3DType
4+
---@field x number
5+
---@field y number
6+
---@field z number
7+
28
---[FrameXML](https://www.townlong-yak.com/framexml/go/Vector3DMixin)
3-
---@class Vector3DMixin
4-
---@field x number|nil
5-
---@field y number|nil
6-
---@field z number|nil
9+
---@class Vector3DMixin : Vector3DType
710
Vector3DMixin = {}
811

912
---[FrameXML](https://www.townlong-yak.com/framexml/go/CreateVector3D)

Annotations/Type/Mixin.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
---@alias colorRGB ColorMixin
66
---@alias colorRGBA ColorMixin
77
---@alias EmptiableItemLocation ItemLocationMixin
8-
---@alias ItemLocation ItemLocationMixin
8+
---@alias ItemLocation ItemLocationType
99
---@alias ItemTransmogInfo ItemTransmogInfoMixin
10-
---@alias PlayerLocation PlayerLocationMixin
10+
---@alias PlayerLocation PlayerLocationType
1111
---@alias ReportInfo ReportInfoMixin
12-
---@alias TransmogLocation TransmogLocationMixin
12+
---@alias TransmogLocation TransmogLocationType
1313
---@alias TransmogPendingInfo TransmogPendingInfoMixin
1414
---@alias vector2 Vector2DMixin
1515
---@alias vector3 Vector3DMixin

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## [0.18.0] - 2024-12-10
4+
- Fixed PlayerLocation, ItemLocation and TransmogLocation types to not require the whole mixin
5+
36
## [0.17.9] - 2024-11-28
47
- Added Blizzard_Menu annotations (by Numy)
58

@@ -159,6 +162,7 @@ To avoid loading for Lua projects not related to World of Warcraft, all settings
159162
- PR [#123](https://github.com/Ketho/vscode-wow-api/pull/123) Make childGroups optional in AceConfig.OptionsTable
160163
- PR [#120](https://github.com/Ketho/vscode-wow-api/pull/120) Add definition for tostringall()
161164

165+
[0.18.0]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.18.0
162166
[0.17.9]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.9
163167
[0.17.8]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.8
164168
[0.17.7]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.7

LuaScripts/Tests/Mixins.lua

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
-- PlayerLocation
2+
local playerLoc = PlayerLocation:CreateFromUnit("player")
3+
local class1 = C_PlayerInfo.GetClass({unit = "player"})
4+
local class2 = C_PlayerInfo.GetClass(playerLoc)
5+
6+
-- ItemLocation
7+
local itemLoc = ItemLocation:CreateFromEquipmentSlot(1)
8+
local name1 = C_Item.GetItemName(itemLoc)
9+
local name2 = C_Item.GetItemName({equipmentSlotIndex = 1})
10+
11+
-- TransmogLocation
12+
local TransmogUtil = {}
13+
---@type TransmogLocation
14+
local transmogLoc = TransmogUtil.CreateTransmogLocation("HEADSLOT", Enum.TransmogType.Appearance, Enum.TransmogModification.Main)
15+
local slotInfo1 = C_Transmog.GetSlotInfo(transmogLoc)
16+
local slotInfo2 = C_Transmog.GetSlotInfo({slotID=1, type=0, modification=0})
17+
18+
-- todo: differentiate between a mixin as argument or as return
19+
20+
-- vector2, vector3
21+
-- local pos1, pos3 = C_Map.GetWorldPosFromMapPos(37, CreateVector2D(.5, 1))
22+
-- local pos2 = C_Map.GetWorldPosFromMapPos(37, {x = .5, y = 1})
23+
24+
-- colorRGB, colorRGBA
25+
-- local tex = CreateFrame("Frame"):CreateTexture()
26+
-- tex:SetGradient("HORIZONTAL", {r=1, g=1, b=0, a=1}, {r=0, g=0, b=1, a=1})

0 commit comments

Comments
 (0)