Skip to content

Commit 7dce40d

Browse files
committed
Close sleep dialog with ESC key
1 parent bff0dc5 commit 7dce40d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

res/gamedata/scripts/ui_sleep_dialog.script

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ function sleep_dialog:OnMessageBoxOk()
128128
db.actor:give_info_portion("tutorial_sleep")
129129
disable_info("sleep_active")
130130
end
131+
132+
function sleep_dialog:OnKeyboard(dik, keyboard_action)
133+
CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
134+
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
135+
if dik == DIK_keys.DIK_ESCAPE then
136+
self:HideDialog()
137+
db.actor:give_info_portion("tutorial_sleep")
138+
disable_info("sleep_active")
139+
end
140+
end
141+
end
131142
--------------------------------------------------------------------------------
132143
function dream_callback()
133144
level.add_cam_effector("camera_effects\\sleep.anm", 10, false, "ui_sleep_dialog.dream_callback2")

0 commit comments

Comments
 (0)