-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbag-peeker.lua
More file actions
44 lines (39 loc) · 857 Bytes
/
bag-peeker.lua
File metadata and controls
44 lines (39 loc) · 857 Bytes
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
local firstItem = ""
function onLoad()
self.createButton(
{
click_function = "none",
function_owner = self,
label = firstItem,
position = {0, 0.6, 2.9},
scale = {0.7, 0.7, 0.7},
width = 7200,
height = 800,
font_size = 600
}
)
getFirstItem()
end
function none()
end
function onObjectEnterContainer(bag, obj)
if bag == self then
getFirstItem()
end
end
function onObjectLeaveContainer(bag, obj)
if bag == self then
getFirstItem()
end
end
function getFirstItem()
local objs = self.getObjects()
if objs then
if objs[1] then
firstItem = objs[#objs].name
else
firstItem = ""
end
self.editButton({index = 0, label = firstItem})
end
end