Skip to content

Commit

Permalink
Close sleep dialog with ESC key
Browse files Browse the repository at this point in the history
  • Loading branch information
YKhovanskikh committed Nov 8, 2015
1 parent bff0dc5 commit 7dce40d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions res/gamedata/scripts/ui_sleep_dialog.script
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ function sleep_dialog:OnMessageBoxOk()
db.actor:give_info_portion("tutorial_sleep")
disable_info("sleep_active")
end

function sleep_dialog:OnKeyboard(dik, keyboard_action)
CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
if dik == DIK_keys.DIK_ESCAPE then
self:HideDialog()
db.actor:give_info_portion("tutorial_sleep")
disable_info("sleep_active")
end
end
end
--------------------------------------------------------------------------------
function dream_callback()
level.add_cam_effector("camera_effects\\sleep.anm", 10, false, "ui_sleep_dialog.dream_callback2")
Expand Down

0 comments on commit 7dce40d

Please sign in to comment.