-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvn.lua
More file actions
30 lines (27 loc) · 891 Bytes
/
vn.lua
File metadata and controls
30 lines (27 loc) · 891 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
local vn_scenes = ygGet("phq.vn-scenes")
function vnScene(wid, _eve, scene, dialogueWid)
wid = Entity.wrapp(wid)
if wid.isDialogue then
wid = main_widget
end
if yeGetInt(wid.in_subcontained) == 1 then
wid = Entity.wrapp(ywCntWidgetFather(wid))
end
local main = Entity.wrapp(main_widget)
if yeType(scene) == YSTRING then
scene = Entity.wrapp(yeGet(vn_scenes, yeGetString(scene)))
elseif yIsLuaString(scene) then
scene = Entity.wrapp(yeGet(vn_scenes, scene))
end
backToGame(wid)
if yIsNil(dialogueWid) then
dialogueWid = Entity.new_array()
end
dialogueWid["<type>"] = "dialogue"
dialogueWid.dialogue = scene
dialogueWid["text-speed"] = 30000
dialogueWid.background = "rgba: 255 255 255 255"
dialogueWid.endAction = Entity.new_func("backToGame")
ywPushNewWidget(main, dialogueWid)
return YEVE_ACTION
end