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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
function popup_and_wait_ok(message)
args = {MESSAGE=message}
notif_response = nil
show_notification("GenericAlertOK", args, "notif_response")
while not notif_response do
sleep(0.2)
end
local response = notif_response
return response
end
function demo_environment()
popup_and_wait_ok("Change Environment")
run_ui_command("World.EnvSettings", "midnight")
sleep(2)
run_ui_command("World.EnvSettings", "sunrise")
sleep(2)
run_ui_command("World.EnvSettings", "noon")
sleep(2)
end
function demo_rez()
for x=-1,1,1 do
for y=-1,1,1 do
rez_prim2({x,y,-1},1)
end
end
end
function demo_avatar()
popup_and_wait_ok("Change Avatar")
local dest = {10,10,0}
move_by(dest, "autopilot_response")
while not autopilot_response do
sleep(0.2)
end
local response = autopilot_response
if response == 1 then
sleep(1)
demo_rez()
sleep(2)
end
wear_by_name("Greg")
run_ui_command("Avatar.ResetSelfSkeletonAndAnimations")
sleep(8)
wear_by_name("Petrol Sue")
sleep(8)
run_ui_command("Self.ToggleSitStand")
sleep(2)
run_ui_command("Self.ToggleSitStand")
sleep(2)
--run_ui_command("View.ZoomOut")
run_ui_command("EditShape")
sleep(6)
close_floater("appearance")
end
function demo_ui()
-- adding items to 'Build' menu
-- popup_and_wait_ok("Extend UI")
popup_and_wait_ok("UI interaction")
open_floater("inventory")
open_floater("preferences")
open_floater("nearby_chat")
nearby_chat_send("Hello World!")
sleep(5)
close_all_floaters()
notif_response = nil
args = {MESSAGE="Customize the UI now?"}
show_notification("GenericAlertYesCancel", args, "notif_response")
while not notif_response do
sleep(0.2)
end
if notif_response ~= 0 then
popup_and_wait_ok("Exiting")
return
end
menu_name = "BuildTools"
add_menu_separator(menu_name)
params = {name="user_sit",
label="Sit!"}
params["function"]="Self.ToggleSitStand"
add_menu_item(menu_name, params)
params = {name="user_midnight",label="Set night",parameter="midnight"}
params["function"] = "World.EnvSettings"
add_menu_item(menu_name, params)
-- adding new custom menu
new_menu_name = "user_menu"
params = {name=new_menu_name,label="My Secret Menu",tear_off="true"}
add_menu(params)
-- adding new item to the new menu
params = {name="user_debug",label="Console",
parameter="debug"}
params["function"] = "Advanced.ToggleConsole"
add_menu_item(new_menu_name, params)
-- adding new branch
new_branch = "user_floaters"
params = {name=new_branch, label="Open Floater",tear_off="true"}
add_branch(new_menu_name, params)
-- adding items to the branch
params = {name="user_permissions",label="Default permissions",
parameter="perms_default"}
params["function"] = "Floater.ToggleOrBringToFront"
add_menu_item(new_branch, params)
params = {name="user_beacons",label="Beacons",
parameter="beacons"}
params["function"] = "Floater.ToggleOrBringToFront"
add_menu_item(new_branch, params)
sleep(5)
end
function call_once_func()
demo_environment()
demo_avatar()
demo_ui()
end
|