add event type for on_close

This commit is contained in:
shenjack 2023-06-17 01:00:49 +08:00
parent 021ad2d5de
commit 45531c431b
3 changed files with 5 additions and 4 deletions

View File

@ -223,7 +223,7 @@ class ClientWindow(Window):
print("==========client stop. KeyboardInterrupt info==========") print("==========client stop. KeyboardInterrupt info==========")
traceback.print_exc() traceback.print_exc()
print("==========client stop. KeyboardInterrupt info end==========") print("==========client stop. KeyboardInterrupt info end==========")
self.dispatch_event("on_close") self.dispatch_event("on_close", 'input')
sys.exit(0) sys.exit(0)
@new_thread('window save_info') @new_thread('window save_info')
@ -388,7 +388,7 @@ class ClientWindow(Window):
if symbol == key.ESCAPE and not (modifiers & ~(key.MOD_NUMLOCK | if symbol == key.ESCAPE and not (modifiers & ~(key.MOD_NUMLOCK |
key.MOD_CAPSLOCK | key.MOD_CAPSLOCK |
key.MOD_SCROLLLOCK)): key.MOD_SCROLLLOCK)):
self.dispatch_event('on_close') self.dispatch_event('on_close', 'window')
if symbol == key.SLASH: if symbol == key.SLASH:
self.input_box._set_focus(True) self.input_box._set_focus(True)
self.logger.debug( self.logger.debug(

View File

@ -29,6 +29,7 @@ mod.load.info = "mod id: {} version: {}"
mod.load.faild.info = "Mod load failed: {} error info: {}" mod.load.faild.info = "Mod load failed: {} error info: {}"
mod.load.faild.no_mod_class = "Can't find Mod class" mod.load.faild.no_mod_class = "Can't find Mod class"
mod.load.done = "All Mod loaded" mod.load.done = "All Mod loaded"
mod.event.error = "Mod evenet {} caught error: {} Mod: {}"
[client] [client]
setup.start = "Client start loading" setup.start = "Client start loading"
@ -71,8 +72,8 @@ os.pid_is = "Server PID: {} PPID: {}"
[game] [game]
input = "console" input = "console"
command = "in game commands"
window = "window" window = "window"
command = "in game commands"
require_DR_rs = "require DR_rs module" require_DR_rs = "require DR_rs module"
[client.sr1_render] [client.sr1_render]

View File

@ -72,8 +72,8 @@ os.pid_is = "服务端 PID: {} PPID: {}"
[game] [game]
input = "控制台" input = "控制台"
command = "游戏内命令行"
window = "窗口" window = "窗口"
command = "游戏内命令行"
require_DR_rs = "需要 DR_rs 模块" require_DR_rs = "需要 DR_rs 模块"
[client.sr1_render] [client.sr1_render]