Difficult-Rocket/mods/five_point/__init__.py

39 lines
1.1 KiB
Python
Raw Normal View History

2023-04-30 01:07:26 +08:00
from typing import Optional
from .main import FivePointRender
2023-05-01 21:23:22 +08:00
from libs.MCDR.version import Version
2023-04-30 01:07:26 +08:00
from Difficult_Rocket.api.mod import ModInfo
from Difficult_Rocket.main import Game
from Difficult_Rocket.client import ClientWindow
class FivePoint_mod(ModInfo):
mod_id = 'five_point'
name = '五子棋 mod'
version = Version('1.0.0.0')
writer = 'shenjackyuanjie'
info = "基于 DR SDK 的五子棋"
description = "左键黑棋,右键白棋,无限制 感谢我的两位同学激励我写出了这个mod"
DR_version = (Version("0.7.2.2"), Version("0.7.2.2"))
DR_Api_version = (Version("0.2.0.0"), Version("0.2.0.0"))
def on_load(self, game: Game, old_self: Optional["ModInfo"] = None):
...
def on_client_start(self, game: Game, client: ClientWindow):
print('五子棋 on clint start 加载开始')
client.add_sub_screen('Five_point', FivePointRender)
def on_unload(self, game: Game):
del game.client.window.screen_list['Five_point']
# 删除五子棋屏幕
mod_class = FivePoint_mod