DR -> DR SDK #16
@ -60,6 +60,14 @@ class ModInfo(Options):
|
||||
print(f'Mod {self.mod_id} loaded')
|
||||
return True
|
||||
|
||||
def on_client_start(self, game: Game, client: ClientWindow):
|
||||
""" 客户端启动时调用 """
|
||||
print(f'Mod {self.mod_id} client start')
|
||||
|
||||
def on_client_stop(self, game: Game, client: ClientWindow, source: str = 'window'):
|
||||
""" 客户端停止时调用 """
|
||||
print(f'Mod {self.mod_id} client stop')
|
||||
|
||||
def on_server_start(self, game: Game):
|
||||
""" 服务器启动时调用 """
|
||||
print(f'Mod {self.mod_id} server start')
|
||||
@ -68,10 +76,6 @@ class ModInfo(Options):
|
||||
""" 服务器停止时调用 """
|
||||
print(f'Mod {self.mod_id} server stop')
|
||||
|
||||
def on_client_start(self, game: Game, client: ClientWindow):
|
||||
""" 客户端启动时调用 """
|
||||
print(f'Mod {self.mod_id} client start')
|
||||
|
||||
def on_unload(self, game: Game):
|
||||
""" 卸载时调用 """
|
||||
print(f'Mod {self.mod_id} unloaded')
|
||||
|
@ -271,7 +271,6 @@ class ClientWindow(Window):
|
||||
for command in self.command_list:
|
||||
self.on_command(line.CommandText(command))
|
||||
self.command_list.pop(0)
|
||||
# self.logger.debug('on_draw call dt: {}'.format(dt))
|
||||
pyglet.gl.glClearColor(0.1, 0, 0, 0.0)
|
||||
self.clear()
|
||||
self.draw_update(float(self.SPF))
|
||||
@ -438,6 +437,7 @@ class ClientWindow(Window):
|
||||
|
||||
@_call_screen_before
|
||||
def on_close(self, source: str = 'window') -> None:
|
||||
self.game.dispatch_event('on_close', game=self.game, client=self, source=source)
|
||||
self.logger.info(tr().window.game.stop_get().format(tr().game[source]()))
|
||||
self.logger.info(tr().window.game.stop())
|
||||
self.fps_log.check_list = False
|
||||
|
@ -39,6 +39,10 @@
|
||||
- `on_client_start(game: Game, client: ClientWindow) -> None`
|
||||
- `game`: Game 对象 用于存储 DR SDK 的信息
|
||||
- `client`: ClientWindow 对象 用于传递客户端状态
|
||||
- `on_client_stop(game: Game, client: ClientWindow, source: str = 'window')`
|
||||
- `game`: Game 对象 用于存储 DR SDK 的信息
|
||||
- `client`: ClientWindow 对象 用于传递客户端状态
|
||||
- `source`: 关闭调用的来源
|
||||
|
||||
### DR_rs `0.2.7.0`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user