Github copilot 的翻译(甚至这句话也是copilot翻译的)
copilot翻译的(当然,也有可能是Easy Translate翻译的)Github copilot for translate (lazy yes!)
copilot0.8.0.0 + DR_api 0.1.0.0 + DR_rs 0.2.7.0 + 15啊哈! mod 加载来啦!
啊啊啊啊啊 大重构 api
现在控制台是 真 多线程了
0.1.0.0ModInfo
on_load(game: Game, old_self: Optional[ModInfo]) -> bool
game: Game 对象 用于存储 DR SDK 的信息old_self: 旧的 ModInfo 对象, 可以用于从上次加载中恢复信息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: 关闭调用的来源0.2.7.0__init__.py
SR1Ship_rs 的 typing
namedescriptionlift_offtouch_groundimg_pos() -> Tuple[int, int, int, int]SR1Ship_rs
SR1Ship_rstypes::SR1PartData
get_box(&self, part_type: &SR1PartType) -> (f64, f64, f64, f64)types::SR1Ship
from_fileConsole_rs
game.config
DR_option & DR_runtime(long_version 15)
DR_rust 部分
DR_rust partclient 不会在 setup() 中调用 DR_runtime 的 find_mods() 方法
client will not call the find_mods() method of DR_runtime in setup()Difficult_Rocket.crash
write_options methodwrite_markdown_tablet method
Option().as_markdown()Difficult_Rocket.utils.new_thread
Diffiuclt_Rocket.utils.threadDifficult_Rocket.utils.thread
Threadsmain.toml
game.mods.path
Difficult_Rocket.mod.MODInfo -> Difficult_Rocket.api.mod.ModInfo
Difficult_Rocket.DR_runtime
mod_path: str 字段DR_Mod_List: List[Tuple[str, Version]] 字段load_mods() -> None 方法find_mods -> List[str] 方法
mod_path: str fieldDR_Mod_List: List[Tuple[str, Version]] fieldload_mods() -> None methodfind_mods -> List[str] methodutils.new_thread
Difficult_Rocket.api
Difficult_Rocket.api.types.Options ( Difficult_Rocket.utils.options.Options )
options -> _optionsoption_with_len(self) ->
List[Union[List[Tuple[str, Any, Any]], int, Any]]: -> Tuple[List[Tuple[str, Union[Any, Type], Type]], int, int, int]Difficult_Roocket.main.Game
Options 完全重构init mods init console init logger load_file
Optionsinit mods init console init logger load_fileDifficult_Rocket.command.api.CommandText
find -> re_findDifficult_Rocket.api.types.Options ( Difficult_Rocket.utils.options.Options )
as_markdown 方法
Options 类的所有字段as_markdown method
Options class in a human-readable Markdown formatDifficult_Rocket.command.api.CommandText
添加基于 str.find 的 find(text: str) -> bool 方法
Add method find(text: str) based on str.find
howto/translate.md
SUMMARY.md
howto/translate.mdhowto/game/readme.mdcontributors -> ContributingModInfo
on_load(game: Game, old_self: Optional[ModInfo]) -> bool
game: Game 对象 用于存储 DR SDK 的信息old_self: 旧的 ModInfo 对象, 可以用于从上次加载中恢复信息game: Game object used to store information about the DR SDKold_self: Old ModInfo object, can be used to restore information from the last load0.7.2.2 + DR_rs 0.2.6.1 + DR_api 0.0.2.0 + 14python::translate::Translate
Difficult_Rocket.utils.translate
Difficult_Rocket.utils.translate in Rusttypes::sr1::SR1PartData
SR1PartDataTraitRawPartData 和 SR1PartDataattr 的 Option<T>
SR1PartDataTraitRawPartData and SR1PartDataOption<T> of the field attrtypes::sr1::SR1PartDataAttr
None 选项
None optionSR1PartDataTrait
to_sr_part_datato_raw_part_data0.0.2.0api.screen 的变化
api.screenDR.py
os.curdiros.path.abspath(os.curdir)configs/dock1.xml
DisconnectedParts 部分DisconnectedParts partDifficult_Rocket.crash
write_cache 函数 -> write_cache 和 write_info_to_cachewrite_cache function -> write_cache and write_info_to_cachecrash 的)
crash)api.screen
BaseScreen
pyglet 提供的函数添加类型提示
pygletapi.screen
BaseScreen
window: "ClientWindow" 参数window: "ClientWindow" parametermain.env.version
pythonDRDR_rspygletpyglet_rsmods 路径不存在时 游戏会崩溃的 bug
mods path does not existWerFault.exe 会跳出来卡住程序的 bug
WerFault.exe will pop up and block the program when the game crashes / exits from the console0.7.2.1Difficult_Rocket.utils.translate
_
_ to all built-in fields0.7.2.0language_set_to: 设置到对应语言时输出
language_available: 可用的语言列表
client
config.save.startconfig.save.doneDifficult_Rocket.utils.translate
Tr
_language(@property) 字段_language(@property) fieldinit_translate
lang 参数lang parametergame.require_DR_rs
DR_rs 才能运行的部分
DR_rs to runlanguage
TranslateFileNotFound -> TranslateFileErrorlang <language>
lang 命令lang <language>
lang commandlang <language>0.7.1.5 + Build 1.2.1.0 + DR_rs 0.2.5.6~0.2.6.0 + DR_api 0.0.1.0client.sr1_render
setup.donesetup.use_timexml.loadingxml.load_donexml.load_timeship.loadship.load_timeship.infoship.render.doneserver.use_timeclient.setup.done -> client.setup.startwindow.setup.done -> window.setup.startserver.setup.done -> server.setup.startdsm.py
dsm.py
BaseScreen 的定义
BaseScreen
cargo fmt 了一遍
cargo fmt the whole projecttypes::sr1::SR1PartData
types::sr1::SR1PartAttr -> types::sr1::SR1PartTypeAttrtypes::sr1::SR1PartDataAttr
CenterCamera_rs 放回去了
CenterCamera_rs
CenterCamera_rs back
CenterCamera_rsDifficult_Rocket.client.render.sr1_ship
Camera_rs -> CenterCamera_rsfrom x import *
from x import * in the following files
Difficult_Rocket.api.exception.commandDifficult_Rocket.api.exception.loggerDifficult_Rocket.api.exception.threadingDifficult_Rocket.api.exception.unsupportDifficult_Rocket.client.__init__Difficult_Rocket.exception.languageDifficult_Rocket.utils.translatelibs.utils.loggerpyproject.toml 中 tool.ruff 的不必要规则忽略
tool.ruff of pyproject.toml0.7.1.4 + DR_rs 0.2.5.4/5SR1PartType 和 RawPartType 的数据转换方法
Rcs 字段 实际上检测的是 Tank 的问题SR1PartType and RawPartType
Rcs field is TankSR1PartType 和 RawPartType 的转换0.7.1.3 + DR_rs 0.2.5.3 + API 0.0.0.1 + 13没别的内容了
version.md 记录了 1.0.0.0 的 Semver++
version.md records the Semver++ of 1.0.0.0DR_rs V 0.2.5.30.2.5.2 -> 0.2.5.3
sr1_data.rs types.rs
pub 的结构体字段PartType -> RawPartTypePartList -> RawPartListtypes.rs 中多余的 PartTypes 方法Damage 实现了 to_damage 方法RawPartType 实现了 to_sr_part_type 方法
SR1PartTypeData 特征
RawPartType 和 SR1PartType 的互相转换sr1_data.rs 的各类数据结构做了向 types.rs 的转换
简直折磨人
public some forgotten pub fields
modify some struct name
PartType -> RawPartTypePartList -> RawPartListremove redundant PartTypes method in types.rs
implement to_damage method for Damage
implement to_sr_part_type method for RawPartType
add trait SR1PartTypeData
RawPartType and SR1PartType to each otheradd convert from sr1_data.rs to types.rs
DR_rs V 0.2.5.20.2.5.0 -> 0.2.5.2
sr1_data.rs
PartList.xml 了PartList 对象
PartList.xml completelyPartList object after parsingtypes.rs
PartTypes 使其匹配原始 PartList.xml 的数据内容Difficult_Rocket.client.fps.fps_log
FpsLogger
pyglet
Difficult_Rocket.api.__init__.
from .delivery import Delivery
from .delivery import Delivery.github/workflows/after_compile.py -> .github/workflows/post_compile.pylibs/Difficult_Rocket_rs/src/after_build.py -> libs/Difficult_Rocket_rs/src/post_build.pyDifficult_Rocket.crash.crash -> Difficult_Rocket.crashget_buf
test.pngClientWindow 启动参数的设置, 实装 ClientOption 的使用SR1PartData 的字段 type_ 重命名为 p_typeDR_RsSR1PartData 的位置
SR1PartData 添加了 connections: Option<Vec<(usize, usize)>> 的字段淦, 忘记步进版本号了(
Translate
毕竟加了一整个 DR_rs
libs.Difficult_Rocket_rs (DR_rs) 0.1.0.0
get_version_str
DR_rs 的版本号 可以用于检查我有没有忘记跑 after_build.pyVersion 对象 问就是懒得转换better_update_pats
SR1ShipRender.update_parts 的性能
PartDatas
PyObj 里 暗 渡 陈 仓 装 HashMap<uszie, SR1PartData>Camera_rs
sr1 的命令不大好使,改成 debug 了render
reset
Translates0.6 还得来几个版本号
stop
fps
log
min
max
default
render
sr1
delta
mouse
delta
CommandText 里的离谱代码tools.load_file 的逻辑(其实是几个版本之前的改动CommandText.match -> CommandText.re_matchmacosx 分支Translates 的优化
Tr 的优化
Translates 配套Difficult_Rocket_rs
pyo3Logger!Github Action 的自动 buildutils.translates 中的字体名称常量移动至 api.types.Fonts 中README-cn.md ( 合并到 README.md 中 )README.md 与 README-en.md 的内容统一requirement.txt 的内容 ( 使内容更加有条理性 )Toml 文件 ( 使其更加规范 )screen apipyglet 版本main.configloggernuitka.ymliconapi/Exp 改为文件夹 api/Exp/__init__.pyclient.load_fonts() 现在改为直接加载单独的 pyglet_load_fonts_folder()command/ 里的一大堆东西libs.MCDR 文件夹 (new_thread没有包含在内)
libs.MCDR folder (new_thread not included)争取12月内发一个release
行了,这都2022年了,我接着摸,等我考完试(20220110)再发
20220207 可算是发了,ruaaaa
Difficult_Rocket.py -> DR.py
Pycharm 检测模块时总是会把主文件检测成主程序,导致一些模块总是检测不到的问题
Difficult_Rocket.py -> DR.pyPycharm module detection problem
api/translate移动到根目录下
api/translate to root directoryclient.load_fonts()
client.load_fonts()tools.load_file() 的错误处理和 .config 文件的解析方式
.config 文件解析后会直接返回一个 ConfigParser 对象.config 文件返回的解析 .config 文件来修改 .config 文件
tools.load_file() error handling and .config file parsing method
.config file parsing after return ConfigParser object.config file return parsing .config file to modify .config filepyglet 添加 Ctrl+C 和 Ctrl+V 的快捷键解析
Ctrl+C and Ctrl+V shortcut for pygletpyglet 到 2.0dev13
pyglet to 2.0dev13log_tick 指令改为 fps log
log_tick change to fps logmaxfps 指令改为 fps max
maxfps change to fps maxminfps 指令改为 fps min
minfps change to fps min命令内容输出使用CommandText而不是str
CommandText.match来匹配命令内容CommandText instead of str
CommandText.match to match command content命令解析现在使用新的CommandText.match
CommandText.matchCascadia_Code
Cascadia_Codexmltodict pyperclip
xmltodict pyperclipjson5 pyglet pyperclip xmltodict 的协议
json5 pyglet pyperclip xmltodict LICENSE
HTMLLabel 的 HTMLformatedLabel
decode_text2HTML 工具(这也是咕咕咕的一大部分原因)HTMLformatedLabel Label based on HTMLLabel
decode_text2HTML tool (also a big reason why lazy)toml 和对应的 LICENSE.txt
toml and corresponding LICENSE.txtDifficult Rocket 只适用于 python3.8+
:= 的使用Difficult Rocket will only fit python3.8+
:=HarmonyOS_Sans
HarmonyOS_SansDifficult_Rocket.graphics.widgets.Parts
libs/fonts have HarmonyOS_Sans fonton_key_press and on_key_release and on_text
on_key_press 和 on_key_release 和 on_text 的处理方式game.config config filelang/en-us.json5 now up to date with lang/zh-CN.json5translate/Lang.翻译 same as Lang.langcommand/CommandLine to render command line@new_thread now can option if log this thread to crash or notstart.cmd witch could debug easierwindow
message.textcommand.texttext.motiontext.motion_selectsetup.use_time_nsfonts.foundgame.input_stopgame.command_stopgame.window_stopgame.stop_getgame.stopgame.endclient
setup.use_time_nst to call out a message window
/ to open command line/min_fps
/max_fps
/stop
/default
Difficult_Rocket_test_ prefixpyglet
pypy3.10 (well······ not success (because OpenGL, blame it))crash-report have more informationpyglet.app.run() use multiprocesslibs/ lib when using pyglet or json5tools.config() is tools.load_file()lang file have server``client and windowDEBUGGING to test or check game run stats
True it will always make a crash reportDifficult_Rocket.api.translate.Lang can be used to auto translate text in configs/lang/xxx.json5
translate.tr[xxx] to use translated info.format to format info's {}Lang will try to find translate in default language translatezh-CN)crash now have more information about multiprocessclientlogs/ is not found logger will info logger.mkdir0.5.2client.Client and server.Server only use net_mode optionapi.new_thread have no more extra line of testingconfigs/view.json5 now removedmouse.release and language to en-uslanguage to zh-CNtr.lang(xx, xx) that can solve error on getting item from lang file
tr[xxx] can also use but won't solve error when item not foundtr.lang(xx, xx)clienttools/format_bool now use more clever way to formaton_resize(self, width, height): in clientbin/crash/create_crash_reportbin/api/Exp.py some Exceptionbin/api/translate to create a translate class that can reload languagesys.path.append() andtry: import xxx except: from bin import xxx has been removedServer now use Dev to delivery message between thread(will be done in 0.6.0)_test_*.py for namescrash.py to handle and create crash report (not done)DragSprite (maybe will add in future pyglet update PR has been published)name_hanlder in configs.py(*args, **kwargs) to set upzh-cn -> zh-CNconfigs/main.config to configon_mouse_click function's debug message now use self.lang to debug message (witch is multi-language)logging.getLogger()[window_default] in configs/main.configPID and PPID info as INFOclient now change to ClientWindownew_thread.py link of stackoverflow have an extra 'find' in the middle REMOVEDnew_thread.py now can use @new_thread to get a threaded funREADME.md and README-cn.md change URL to file pathREADME.md and README-cn.md some label style changepyglet upgrade from 1.5.16 -> 1.5.18json5 upgrade from 0.9.5 -> 0.9.6tools.config() way of raise error change tools.report_file_error()tools.cb() change name to tools.format_bool()test_config_file.pytest_for_speed.pytest_logging_conf.pytest_speed_of_sprite.pybest3.8+(lang name)(actually is debugging)PS:
Va.b.c
a : Big Version (Big rewrite times) (now at DEMO making)
b : Middle Rewrite Times (Yes I've rewritten for 4 times)
c : normal updates
tools.name_handler() now use str.format to handler strDR/sys_value folder now move to DR/configs/sys_valuetools.name_handler() use bug(cause crashes){date} can be successful use in tools.name_handler() (if you define the format of date)xxxx-xx-xx xx-xx-xx DR.log but be {date} DR.log)pyglet 1.5.15json5 0.9.5PS: now I'm not sure witch lib will be import first
the local lib or the pip libs
So I'll add some other code to make sure that DR will first try to import pip libs
not the local libs (todo)