-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutton_bagProt.ttslua
109 lines (101 loc) · 3.91 KB
/
button_bagProt.ttslua
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
-- print("included bbprot")
local bagprot = require("objectprot/bagProt")
--followup: replace harcoded createButton() params in menu funcs with ones generated from default config here. or even xml
button_bagprot = {
moduleName = "Button Bag",
button_backgroud = "White",
}
button_bagprot = bagprot:newProt(button_bagprot)
-- override all the things
function button_bagprot:startMenu()
self().createButton({
label="Setup (relative)", click_function="global_start_relative", function_owner=Global,
position={0,0.3,-2}, rotation={0,180,0}, height=350, width=1800,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
self().createButton({
label="Setup (absolute)", click_function="global_start_absolute", function_owner=Global,
position={0,0.3,-2.8}, rotation={0,180,0}, height=350, width=1800,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
end
function button_bagprot:actionMenu()
self().createButton({
label="Place", click_function="global_Place", function_owner=Global,
position={0,0.3,-2}, rotation={0,180,0}, height=350, width=800,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
self().createButton({
label="Recall", click_function="global_Recall", function_owner=Global,
position={0,0.3,-2.8}, rotation={0,180,0}, height=350, width=800,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
self().createButton({
label="Setup", click_function="global_Setup", function_owner=Global,
position={-2,0.3,0}, rotation={0,270,0}, height=350, width=800,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
end
function button_bagprot:setupMenu()
self().createButton({
label="Toggle Selected", click_function="global_sendSelected", function_owner=Global,
position={0,0.3,-2}, rotation={0,180,0}, height=350, width=1700,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
self().createButton({
label="Cancel", click_function="global_Cancel", function_owner=Global,
position={0,0.3,-2.8}, rotation={0,180,0}, height=350, width=1700,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
self().createButton({
label="Submit", click_function="global_Submit", function_owner=Global,
position={0,0.3,-3.6}, rotation={0,180,0}, height=350, width=1700,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
-- self:makeMenu("")
-- self:makeMenu("Reset")
-- self:makeMenu("")
self().createButton({
label="Reset", click_function="global_Reset", function_owner=Global,
position={2,0.3,0}, rotation={0,90,0}, height=350, width=800,
font_size=250, color={0,0,0}, font_color={1,1,1}
})
end
-- global shit goes below this line
local function quickadd_button_bag(player, obj) -- this hotkey function converts a dumb bag into a memory bag (with 3d buttons), and stores player's currently selected objects in itself.
obj.setGMNotes(button_bagprot.moduleName)
bagprot:newInstance(obj)
end
addHotkey("quick add button bag", quickadd_button_bag)
local buttonbag_instances = require("objectprot/mainProt").instanceList[button_bagprot.moduleName]
function global_start_relative(obj)
local bag = buttonbag_instances[obj.guid]
bag.isRelative = true
bag:Setup()
end
function global_start_absolute(obj)
local bag = buttonbag_instances[obj.guid]
bag.isRelative = false
bag:Setup()
end
function global_Setup(obj, player)
buttonbag_instances[obj.guid]:Setup(player)
end
function global_sendSelected(obj, player)
buttonbag_instances[obj.guid]:sendSelected(player)
end
function global_Cancel(obj, player)
buttonbag_instances[obj.guid]:Cancel(player)
end
function global_Submit(obj, player)
buttonbag_instances[obj.guid]:Submit(player)
end
function global_Reset(obj, player)
buttonbag_instances[obj.guid]:Reset(player)
end
function global_Place(obj, player)
buttonbag_instances[obj.guid]:Place(player)
end
function global_Recall(obj, player)
buttonbag_instances[obj.guid]:Recall(player)
end