Back to Home

ESO Lua File v100017

ingame/housingeditor/furnitureclasses_shared.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
--
--[[ PlaceableFurnitureBase ]]--
--
ZO_PlaceableFurnitureBase = ZO_Object:Subclass()
function ZO_PlaceableFurnitureBase:New(...)
    local furniture = ZO_Object.New(self)
    furniture:Initialize(...)
    return furniture
end
function ZO_PlaceableFurnitureBase:Initialize(...)
    assert(false)  --must be overridden
end
function ZO_PlaceableFurnitureBase:Preview()
    assert(false)  --must be overridden
end
function ZO_PlaceableFurnitureBase:RequestRemove()
    assert(false)  --must be overridden
end
function ZO_PlaceableFurnitureBase:GetName()
    assert(false)  --must be overridden
end
function ZO_PlaceableFurnitureBase:GetIcon()
    assert(false)  --must be overridden
end
--
--[[ PlaceableFurnitureItem ]]--
--
ZO_PlaceableFurnitureItem = ZO_PlaceableFurnitureBase:Subclass()
function ZO_PlaceableFurnitureItem:New(...)
    return ZO_PlaceableFurnitureBase.New(self, ...)
end
function ZO_PlaceableFurnitureItem:Initialize(bagId, slotIndex)
    self.bagId = bagId
    self.slotIndex = slotIndex
    local slotData = SHARED_INVENTORY:GenerateSingleSlotData(bagId, slotIndex)
    if slotData and slotData.isPlaceableFurniture then
        self.name = slotData.name
        self.icon = slotData.iconFile
    end
end
function ZO_PlaceableFurnitureItem:Preview()
    HousingEditorPreviewItemFurniture(self.bagId, self.slotIndex)
end
function ZO_PlaceableFurnitureItem:GetName()
    return self.name
end
function ZO_PlaceableFurnitureItem:GetIcon()
    return self.icon
end
--
--[[ PlaceableFurnitureCollectible ]]--
--
ZO_PlaceableFurnitureCollectible = ZO_PlaceableFurnitureBase:Subclass()
function ZO_PlaceableFurnitureCollectible:New(...)
    return ZO_PlaceableFurnitureBase.New(self, ...)
end
function ZO_PlaceableFurnitureCollectible:Initialize(collectibleId)
    self.collectibleId = collectibleId
    local collData = COLLECTIONS_INVENTORY_SINGLETON:GetSingleCollectibleData(collectibleId, IsCollectibleCategoryPlaceableFurniture)
    if collData then
        self.name = collData.name
        self.icon = collData.iconFile
    end
end
function ZO_PlaceableFurnitureCollectible:Preview()
end
function ZO_PlaceableFurnitureCollectible:GetName()
    return self.name
end
function ZO_PlaceableFurnitureCollectible:GetIcon()
    return self.icon
end