diff --git a/CONTRIBUTING_zh.md b/CONTRIBUTING-zh.md similarity index 80% rename from CONTRIBUTING_zh.md rename to CONTRIBUTING-zh.md index 3d6370f..b6126f2 100644 --- a/CONTRIBUTING_zh.md +++ b/CONTRIBUTING-zh.md @@ -12,7 +12,7 @@ ## 代码风格 -请遵循我们的[代码风格指南](docs/code_style-zh.md)以保持代码的一致性。 +请遵循我们的[代码风格指南](docs/code-style-zh.md)以保持代码的一致性。 ## 提交更改 @@ -28,9 +28,9 @@ 对于你的代码,无论是GDScript还是Rust都需要编写适当的测试来覆盖你的代码,我们使用Github Action来运行测试 -[关于Rust的测试的指引](./docs/rust_test-zh.md) +[关于Rust的测试的指引](./docs/rust-test-zh.md) -我们会运行一些Godot场景来检查基本的错误,要运行的Godot场景被记录于```test_scene```中,在日常开发中,你可以通过运行```script/godot_test.py```来进行基础的测试 +我们会运行一些Godot场景来检查基本的错误,要运行的Godot场景被记录于`test_scene`中,在日常开发中,你可以通过运行`script/godot_test.py`来进行基础的测试 ## 版本控制 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9bacdee..cdc8fcc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ First, thank you for being interested in this project and willing to do some con ## Code Style -Please obey our [Code Style Guide](docs/code_style.md) to maintain code consistency +Please obey our [Code Style Guide](./docs/code-style.md) to maintain code consistency ## Commit Changes @@ -28,9 +28,9 @@ If you want to commit changes,please obey the following steps: For your code,you should write necessary tests to cover your code in both GDScript and Rust.We use Github Action to run the tests -[Rust Test Guide](./docs/rust_test.md) +[Rust Test Guide](./docs/rust-test.md) -We will run some Godot scenes to check basic errors.The scenes should be ran is recorded in ```test_scene```.In daily development,you can run ```script/godot_test.py```to conduct basic testing +We will run some Godot scenes to check basic errors.The scenes should be ran is recorded in `test_scene`.In daily development,you can run `script/godot_test.py`to conduct basic testing ## Version Control diff --git a/README_zh.md b/README-zh.md similarity index 65% rename from README_zh.md rename to README-zh.md index f38caf9..a76213e 100644 --- a/README_zh.md +++ b/README-zh.md @@ -11,17 +11,8 @@ ## 构建指南 -| 依赖 | -| :---------------- | -| Godot 4.3 | -| Gettext | -| Protobuf Compiler | -| Rust Compiler | - -接下来,你可以运行`cd script && python build.py`来构建extension(Debug和Release) - -最终,你可以启动godot编辑器来开发或导出游戏. +关于细节,请阅读[这里](./docs/build-guide-zh.md) ## 贡献 -如果你想做出任何贡献,请看[CONTRIBUTING.md](./CONTRIBUTING_zh.md) +如果你想做出任何贡献,请看[CONTRIBUTING.md](./CONTRIBUTING-zh.md) diff --git a/README.md b/README.md index a8614bc..b730e3e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Zenith -## [中文](./README_zh.md) +## [中文](./README-zh.md) ![Total Lines](https://tokei.rs/github/skyuoi/zenith) |Platform|Status| @@ -13,16 +13,7 @@ A indie fan game about undertale and terraria, developed in godot engine ## Build Guide -| dependencies | -| :---------------- | -| Godot 4.3 | -| Gettext | -| Protobuf Compiler | -| Rust Compiler | - -Then you can run `cd script && python build.py` to build the extension (both Debug and Release) - -Finally,you can start godot editor and develop or export the game. +For details,please see [this](./docs/build-guide.md) ## Contribution diff --git a/docs/build-guide-zh.md b/docs/build-guide-zh.md new file mode 100644 index 0000000..95ff852 --- /dev/null +++ b/docs/build-guide-zh.md @@ -0,0 +1,15 @@ +# 构建指南 + +| 依赖 | +| :---------------- | +| Godot 4.3 | +| Gettext | +| Protobuf Compiler | +| Rust Compiler | + +关于Protobuf Compiler,我们首先会在本地查找是否存在protoc,如果存在可用的编译器,我们会直接采用,对于某些特殊需求,例如protoc版本过低等,我们也提供了自动编译protoc的选项,该选项默认关闭,可以通过`cargo build --package proto --features protobuf_feature`来启用捆绑的protoc, +注意,该选项可能使你的构建目录增大,构建时间增长若干倍,仍然建议提前安装好protoc + +接下来,你可以运行`cd script && python build.py`来构建extension(Debug和Release) + +最终,你可以启动godot编辑器来开发或导出游戏. diff --git a/docs/build-guide.md b/docs/build-guide.md new file mode 100644 index 0000000..b812559 --- /dev/null +++ b/docs/build-guide.md @@ -0,0 +1,16 @@ +# Build Guide + +| dependencies | +| :---------------- | +| Godot 4.3 | +| Gettext | +| Protobuf Compiler | +| Rust Compiler | + +Regarding the Protobuf Compiler, we first check for the existence of a local protoc executable. If a usable compiler is found, it will be utilized directly. For certain special requirements, such as when the protoc version is too low, we also provide an option to +automatically compile a bundled protoc. This option is turned off by default and can be enabled by using cargo build --package proto --features protobuf_feature. Note that this option may significantly increase your build directory size and extend the build time by +several times. It is still recommended to install protoc in advance. + +Then you can run `cd script && python build.py` to build the extension (both Debug and Release) + +Finally,you can start godot editor and develop or export the game. diff --git a/docs/code_style-zh.md b/docs/code-style-zh.md similarity index 100% rename from docs/code_style-zh.md rename to docs/code-style-zh.md diff --git a/docs/code_style.md b/docs/code-style.md similarity index 100% rename from docs/code_style.md rename to docs/code-style.md diff --git a/docs/rust_test-zh.md b/docs/rust-test-zh.md similarity index 100% rename from docs/rust_test-zh.md rename to docs/rust-test-zh.md diff --git a/docs/rust_test.md b/docs/rust-test.md similarity index 100% rename from docs/rust_test.md rename to docs/rust-test.md diff --git a/gdrust/proto/build.rs b/gdrust/proto/build.rs index 45782f8..c95b4fc 100644 --- a/gdrust/proto/build.rs +++ b/gdrust/proto/build.rs @@ -18,14 +18,14 @@ fn main() { } } if should_compile { - let mut compile = false; + let mut _compile = false; #[cfg(feature = "protobuf_feature")] { std::env::set_var("PROTOC", protobuf_src::protoc()); - compile = true; + _compile = true; } - if !compile { - eprintln!("protoc not found,you can try use \"cargo build --features protobuf_feature\" to compile a protoc"); + if !_compile { + eprintln!("protoc not found,you can try use \"cargo build --package proto --features protobuf_feature\" to compile a protoc"); exit(1); } }