Static World Gen and Display for the Overworld #5
1 changed files with 3 additions and 2 deletions
5
build.rs
5
build.rs
|
@ -31,6 +31,7 @@ impl AssetsWriter {
|
||||||
fn new<P: AsRef<Path>>(path: P) -> Self {
|
fn new<P: AsRef<Path>>(path: P) -> Self {
|
||||||
let mut file = File::create(path).expect("Failed to create assets file");
|
let mut file = File::create(path).expect("Failed to create assets file");
|
||||||
writeln!(file, "// @generated").unwrap();
|
writeln!(file, "// @generated").unwrap();
|
||||||
|
writeln!(file, "#![allow(dead_code)]").unwrap();
|
||||||
Self {
|
Self {
|
||||||
file,
|
file,
|
||||||
root: Assets::default()
|
root: Assets::default()
|
||||||
|
@ -80,14 +81,14 @@ impl AssetsWriter {
|
||||||
for asset_name in root.assets.keys() {
|
for asset_name in root.assets.keys() {
|
||||||
writeln!(
|
writeln!(
|
||||||
file,
|
file,
|
||||||
"pub {indent}\t{}: comfy::TextureHandle,",
|
"{indent}\tpub {}: comfy::TextureHandle,",
|
||||||
asset_name.to_snake_case()
|
asset_name.to_snake_case()
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
for group_name in root.groups.keys() {
|
for group_name in root.groups.keys() {
|
||||||
writeln!(
|
writeln!(
|
||||||
file,
|
file,
|
||||||
"pub {indent}\t{group_name}: &'static {group_name}::Assets,"
|
"{indent}\tpub {group_name}: &'static {group_name}::Assets,"
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
writeln!(file, "{indent}}}")?;
|
writeln!(file, "{indent}}}")?;
|
||||||
|
|
Loading…
Reference in a new issue