mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-09 23:47:46 +00:00
Return control to the menu after the cutscene finishes
This commit is contained in:
parent
ebd9fcc842
commit
c292033960
1 changed files with 10 additions and 6 deletions
|
@ -5,17 +5,21 @@ SCENE_SHOW_MENU = 00000
|
||||||
SCENE_PLAY_CUTSCENE = 00001
|
SCENE_PLAY_CUTSCENE = 00001
|
||||||
|
|
||||||
function onTalk(target, player)
|
function onTalk(target, player)
|
||||||
-- you cannot consult, which is good because we don't know how to implement this anyway
|
|
||||||
player:play_scene(target, EVENT_ID, SCENE_SHOW_MENU, 8192, {0})
|
player:play_scene(target, EVENT_ID, SCENE_SHOW_MENU, 8192, {0})
|
||||||
end
|
end
|
||||||
|
|
||||||
function onReturn(scene, results, player)
|
function onReturn(scene, results, player)
|
||||||
-- A result of zero means the user exited the menu without playing anything.
|
local NO_SCENE <const> = 0
|
||||||
if scene == 0 and results[1] ~= 0 then
|
local decision <const> = results[1]
|
||||||
|
|
||||||
|
if scene == SCENE_SHOW_MENU and decision ~= NO_SCENE then
|
||||||
-- TODO: we need to switch the player into viewingcutscene online status (on the Rust side?)
|
-- TODO: we need to switch the player into viewingcutscene online status (on the Rust side?)
|
||||||
player:play_scene(player.id, EVENT_ID, SCENE_PLAY_CUTSCENE, SET_BASE, results)
|
player:play_scene(player.id, EVENT_ID, SCENE_PLAY_CUTSCENE, SET_BASE, results)
|
||||||
return
|
elseif scene == SCENE_PLAY_CUTSCENE then
|
||||||
-- TODO: we cannot nest cutscenes right now, but control should return back to the UEJ menu when a cutscene finishes
|
--[[ TODO: How can we make it fade back in smoothly after the cutscene finishes?
|
||||||
|
Could it be related to ActorControl(ViewingCutscene)? ]]
|
||||||
|
player:play_scene(player.id, EVENT_ID, SCENE_SHOW_MENU, 8192, {1})
|
||||||
|
else
|
||||||
|
player:finish_event(EVENT_ID)
|
||||||
end
|
end
|
||||||
player:finish_event(EVENT_ID)
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue