DR -> DR SDK #16

Merged
shenjackyuanjie merged 41 commits from feature/dr-sdk into main 2023-05-03 00:40:53 +08:00
4 changed files with 53 additions and 11 deletions
Showing only changes of commit da0b8c4a34 - Show all commits

View File

@ -5,7 +5,7 @@
# ------------------------------- # -------------------------------
# system function # system function
from typing import Tuple, List from typing import Tuple, List, Optional
# from libs # from libs
from MCDR.version import Version from MCDR.version import Version
@ -25,7 +25,6 @@ RequireVersion = Tuple[Version, Version]
ForceRequire = bool ForceRequire = bool
# TODO 完善中
class ModInfo(Options): class ModInfo(Options):
""" """
加载mod时候的参数 加载mod时候的参数
@ -52,8 +51,12 @@ class ModInfo(Options):
"""mod 配置""" """mod 配置"""
config: Options = Options() # mod 配置存储 config: Options = Options() # mod 配置存储
old_mod: Optional["ModInfo"] = None # 旧的mod实例
def on_load(self):
""" 加载时调用 """
print(f'Mod {self.mod_id} loaded')
""" def on_unload(self):
一些重置用函数 """ 卸载时调用 """
""" print(f'Mod {self.mod_id} unloaded')

20
biggit.ps1 Normal file
View File

@ -0,0 +1,20 @@
$objects = git verify-pack -v .git/objects/pack/pack-aba4bfc55979194c86dbd466c86e57d8199ae7ad.idx | Select-String -Pattern 'chain' -NotMatch | ForEach-Object {$_.Line} | Sort-Object -Property @{Expression={$_.Split(" ")[2]}; Ascending=$false} | Select-Object -First 50
Write-Output "All sizes are in kB. The pack column is the size of the object, compressed, inside the pack file."
$output = "size,pack,SHA,location"
foreach ($y in $objects) {
# extract the size in bytes
$size = [int]($y.Split(" ")[4]/1024)
# extract the compressed size in bytes
$compressedSize = [int]($y.Split(" ")[5]/1024)
# extract the SHA
$sha = $y.Split(" ")[0]
# find the objects location in the repository tree
$other = git rev-list --all --objects | Select-String $sha
$output += "`n${size},${compressedSize},${other}"
}
Write-Output $output | ConvertFrom-Csv -Delimiter "," | Format-Table
Pause

View File

@ -4,11 +4,31 @@
# All rights reserved # All rights reserved
# ------------------------------- # -------------------------------
from .sr1_ship import SR1ShipRender
from MCDR.version import Version from MCDR.version import Version
from Difficult_Rocket.api.mod import ModInfo from Difficult_Rocket.api.mod import ModInfo
from Difficult_Rocket.client import ClientWindow
INFO = ModInfo(
mod_id="Difficult_Rocket_mod", class DR_mod(ModInfo):
name="Difficult_Rocket_mod",
version=Version("0.7.2.0") mod_id = "Difficult_Rocket_mod"
) name = "Difficult Rocket mod"
version = Version("0.7.2.2")
writer = "shenjackyuanjie"
link = "shenjack.top"
description = "Difficult Rocket mod (where the game implement)"
info = "Difficult Rocket mod (where the game implement)"
# DR_version = # DR SDK 兼容版本
# 反正是内置 mod 跟着最新版本的 DR 走就行了
# DR_Api_version = # DR Api版本
# 同理 不管 API 版本 这东西要是不兼容了才是大问题
def on_load(self):
...
mod_class = DR_mod

View File

@ -20,7 +20,6 @@ from pyglet.text import Label
from pyglet.shapes import Line from pyglet.shapes import Line
from pyglet.sprite import Sprite from pyglet.sprite import Sprite
from pyglet.graphics import Batch, Group from pyglet.graphics import Batch, Group
from pyglet.image import load as load_image
# Difficult Rocket # Difficult Rocket
from Difficult_Rocket import DR_option from Difficult_Rocket import DR_option