diff --git a/native/Cargo.lock b/native/Cargo.lock index cb54813e..dd1f1308 100644 --- a/native/Cargo.lock +++ b/native/Cargo.lock @@ -187,9 +187,9 @@ checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "gdextension-api" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25d88dabe9fdb2e064cb545312178ec4025eefb62d9a3bbce1769088e2c381d" +checksum = "5383f33a2772746bbc83e5b0480862dd1eedfd0518b976f37f3db11c81e71a6a" [[package]] name = "getrandom" @@ -222,15 +222,15 @@ checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "glam" -version = "0.30.3" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b46b9ca4690308844c644e7c634d68792467260e051c8543e0c7871662b3ba7" +checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0" [[package]] name = "godot" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5599d03afd17a511e11d0bf9e06c88d4095a9120f10cf00a74f50b300f53413e" +checksum = "8908958eb739fbef2bac361032abacd92d7f8509aa874a4e1202d5003ac99591" dependencies = [ "godot-core", "godot-macros", @@ -238,24 +238,24 @@ dependencies = [ [[package]] name = "godot-bindings" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b6e65306c05e3c3f0131ee8dbf7394691e53268d72019007ec20687f2280f" +checksum = "eca73b7685c6e12a50ef7770611f32f5eaa026f367b277fb181c1bbb911d6456" dependencies = [ "gdextension-api", ] [[package]] name = "godot-cell" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738efef92fdcf1d92f0ed5a29c6f3cdce58e64029d08928c20e08771e1239c16" +checksum = "ebf31e3be55b2fc80566f095d15f0dd2c096c9130f4bb005767b7beeb6ca7f08" [[package]] name = "godot-codegen" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b9a59f603f354c54d83fb74071209203d0ebe396b2419acc731c90ebf94680" +checksum = "7db70e51cb6f24599c27af83608d136ee5e6bbfefafddcf68165d69813f27938" dependencies = [ "godot-bindings", "heck", @@ -267,9 +267,9 @@ dependencies = [ [[package]] name = "godot-core" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e80dfb58d2048ae0dca60bec32129dc1f96510f904b992ad170d84e950c33" +checksum = "146df09dbac1d0e9bf9144497f85453d8cb5ab2694cb0a60e0fda52fdc6cd696" dependencies = [ "glam", "godot-bindings", @@ -280,21 +280,20 @@ dependencies = [ [[package]] name = "godot-ffi" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6237b26c52c5baa6566705a73cd8804ea4ef83a666540939dd5a4e068c242666" +checksum = "32b6b1f65a0bf7da76543954a0c27087257883dba1524c0390732c7ed09f6ba7" dependencies = [ "godot-bindings", "godot-codegen", - "godot-macros", "libc", ] [[package]] name = "godot-macros" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d696b67ba99ff7d75e07546b04c3a711651d2c9e5851c9225dea3b64f8bb5af6" +checksum = "24e4c4320ee46c25bd2470c752c793d195dc91d087685e57f8ac7ff6152e5fa2" dependencies = [ "godot-bindings", "litrs", @@ -307,7 +306,7 @@ dependencies = [ [[package]] name = "godot-rust-script" version = "0.1.0" -source = "git+https://github.com/titannano/godot-rust-script?rev=26f10ece493d9cc8cdbe2799fba60f0420e41f65#26f10ece493d9cc8cdbe2799fba60f0420e41f65" +source = "git+https://github.com/titannano/godot-rust-script?rev=ca89cf182f6b9e051b66e1e52e23489e25f9077c#ca89cf182f6b9e051b66e1e52e23489e25f9077c" dependencies = [ "const-str", "convert_case", @@ -324,7 +323,7 @@ dependencies = [ [[package]] name = "godot-rust-script-derive" version = "0.1.0" -source = "git+https://github.com/titannano/godot-rust-script?rev=26f10ece493d9cc8cdbe2799fba60f0420e41f65#26f10ece493d9cc8cdbe2799fba60f0420e41f65" +source = "git+https://github.com/titannano/godot-rust-script?rev=ca89cf182f6b9e051b66e1e52e23489e25f9077c#ca89cf182f6b9e051b66e1e52e23489e25f9077c" dependencies = [ "darling", "itertools", @@ -397,9 +396,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.172" +version = "0.2.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" [[package]] name = "litrs" @@ -422,9 +421,9 @@ dependencies = [ [[package]] name = "markdown" -version = "1.0.0-alpha.23" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9047e0a37a596d4e15411a1ffbdabe71c328908cb90a721cb9bf8dcf3434e6d2" +checksum = "a5cab8f2cadc416a82d2e783a1946388b31654d391d1c7d92cc1f03e295b1deb" dependencies = [ "unicode-id", ] @@ -643,18 +642,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -746,9 +745,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -758,9 +757,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", diff --git a/native/Cargo.toml b/native/Cargo.toml index c608175e..8a6dcdc7 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -godot = { version = "0.4.5", features = ["experimental-threads", "api-4-5", "register-docs"] } -godot-rust-script = { git = "https://github.com/titannano/godot-rust-script", rev = "26f10ece493d9cc8cdbe2799fba60f0420e41f65" } +godot = { version = "0.5.0", features = ["experimental-threads", "api-4-5", "register-docs"] } +godot-rust-script = { git = "https://github.com/titannano/godot-rust-script", rev = "ca89cf182f6b9e051b66e1e52e23489e25f9077c" } lerp = "0.4.0" backtrace = "0.3.64" num = "0.4.0" diff --git a/native/rust-toolchain.toml b/native/rust-toolchain.toml index 4e9556cb..b43d9209 100644 --- a/native/rust-toolchain.toml +++ b/native/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.92.0" +channel = "1.94.0" components = [ "rustfmt", "clippy" ] profile = "default" diff --git a/native/src/editor.rs b/native/src/editor.rs index c94ddeb9..3ff46c72 100644 --- a/native/src/editor.rs +++ b/native/src/editor.rs @@ -21,9 +21,10 @@ use godot::classes::{ ConfigFile, EditorPlugin, EditorSettings, GDExtensionManager, GltfDocument, IEditorPlugin, ProjectSettings, }; -use godot::global::{self, godot_error, godot_print, PropertyHint}; +use godot::global::{self, godot_error, godot_print}; use godot::meta::{AsArg, FromGodot}; use godot::obj::{Base, Gd, NewGd, OnReady, Singleton as _, WithBaseField}; +use godot::register::info::PropertyHint; use godot::register::{godot_api, GodotClass}; use building_imports::SetupBuildingImports; @@ -133,11 +134,7 @@ impl IEditorPlugin for EditorExtension { let ao_baker = { let base = self.base(); - AoBaker::new( - editor_interface.clone(), - base.get_tree() - .expect("SceneTree should be available after entering the tree"), - ) + AoBaker::new(editor_interface.clone(), base.get_tree()) }; self.ao_baker.init(ao_baker); @@ -272,4 +269,4 @@ impl EngineSettings for Gd { fn add_property_info(&mut self, property_info: &VarDictionary) { self.deref_mut().add_property_info(property_info); } -} \ No newline at end of file +} diff --git a/native/src/editor/ao_baker.rs b/native/src/editor/ao_baker.rs index 231b09e6..95ff738f 100644 --- a/native/src/editor/ao_baker.rs +++ b/native/src/editor/ao_baker.rs @@ -10,22 +10,16 @@ use std::{ process::{Command, Stdio}, }; -use godot::{ - builtin::{GString, PackedStringArray, VariantType}, - classes::{EditorInterface, ProjectSettings, RefCounted, SceneTree}, - global::PropertyHint, - obj::{Base, Gd, Singleton}, - prelude::{godot_api, GodotClass}, - task, -}; +use godot::builtin::{GString, PackedStringArray, VariantType}; +use godot::classes::{EditorInterface, ProjectSettings, RefCounted, SceneTree}; +use godot::obj::{Base, Gd, Singleton}; +use godot::prelude::{godot_api, GodotClass}; +use godot::register::info::PropertyHint; +use godot::task; -use crate::{ - editor::{ - new_non_zero, - ui::{ForgroundProcess, ProgressDialog}, - }, - util::logger, -}; +use crate::editor::new_non_zero; +use crate::editor::ui::{ForgroundProcess, ProgressDialog}; +use crate::util::logger; #[derive(GodotClass)] #[class(base = RefCounted, no_init)] @@ -245,4 +239,4 @@ impl AoBaker { dialog.queue_free(); } -} \ No newline at end of file +} diff --git a/native/src/editor/building_imports.rs b/native/src/editor/building_imports.rs index 14f8492b..0d5681ea 100644 --- a/native/src/editor/building_imports.rs +++ b/native/src/editor/building_imports.rs @@ -7,17 +7,15 @@ use std::collections::VecDeque; -use godot::{ - builtin::{GString, VarDictionary, Vector2i}, - classes::{ - editor_file_dialog, ConfigFile, DirAccess, EditorFileDialog, EditorInterface, FileAccess, - MeshInstance3D, Object, PackedScene, ResourceLoader, - }, - global::Error, - meta::ToGodot, - obj::{Base, Gd, GodotClass, NewAlloc, NewGd, Singleton as _, WithBaseField}, - register::{godot_api, GodotClass}, +use godot::builtin::{GString, VarDictionary, Vector2i}; +use godot::classes::{ + editor_file_dialog, ConfigFile, DirAccess, EditorFileDialog, EditorInterface, FileAccess, + MeshInstance3D, Object, PackedScene, ResourceLoader, }; +use godot::global::Error; +use godot::meta::ToGodot; +use godot::obj::{Base, Gd, GodotClass, NewAlloc, NewGd, Singleton as _, WithBaseField}; +use godot::register::{godot_api, GodotClass}; use pomsky_macro::pomsky; use regex::Regex; @@ -113,7 +111,7 @@ impl SetupBuildingImports { while let Some(dir_path) = dir_queue.pop_front() { logger::info!("Traversing dir \"{}\"...", dir_path); - let Some(mut dir) = DirAccess::open(&dir_path) else { + let Some(dir) = DirAccess::open(&dir_path) else { logger::error!("Directory not accessible: {}", root_dir); return; }; @@ -218,7 +216,7 @@ impl SetupBuildingImports { .for_each(|index| { let path = scene_state.get_node_path(index); let mut config: VarDictionary = nodes - .get(path.clone()) + .get(&path) .map(|value| value.try_to()) .transpose() .inspect_err(|err| { @@ -235,11 +233,11 @@ impl SetupBuildingImports { nodes.set( format!("PATH:{}", path.to_string().trim_start_matches("./")), - config, + &config, ); }); - subresources.set("nodes", nodes); + subresources.set("nodes", &nodes); file.set_value("params", "_subresources", &subresources.to_variant()); @@ -253,4 +251,4 @@ impl SetupBuildingImports { ); } } -} \ No newline at end of file +} diff --git a/native/src/editor/gltf.rs b/native/src/editor/gltf.rs index 3b713af8..f27d3d61 100644 --- a/native/src/editor/gltf.rs +++ b/native/src/editor/gltf.rs @@ -7,7 +7,8 @@ use anyhow::Context; use godot::builtin::{ - Array, GString, PackedInt32Array, PackedVector3Array, VarDictionary, Variant, Vector3, + Array, GString, PackedInt32Array, PackedVector3Array, StringName, VarDictionary, Variant, + Vector3, }; use godot::classes::decal::DecalTexture; use godot::classes::mesh::ArrayType; @@ -125,7 +126,7 @@ fn fix_ao_uv2(state: &mut Gd) -> Result<(), global::Error> { return false; }; - material.get_name() == name.to() + material.get_name() == name.to::() }) .map(|mat| mat.to::()); @@ -208,7 +209,7 @@ fn use_gd_node( }; Ok(node?.map(|mut node| { - node.set_name(gltf_node.get_name().arg()); + node.set_name(&StringName::from(&gltf_node.get_name())); node })) } @@ -385,4 +386,4 @@ fn create_occluder_node( node.set_occluder(&mesh); Ok(Some(node.upcast())) -} \ No newline at end of file +} diff --git a/native/src/editor/ui.rs b/native/src/editor/ui.rs index 62b1d6e3..95729295 100644 --- a/native/src/editor/ui.rs +++ b/native/src/editor/ui.rs @@ -7,4 +7,4 @@ mod progress_dialog; -pub use progress_dialog::*; \ No newline at end of file +pub use progress_dialog::*; diff --git a/native/src/editor/ui/progress_dialog.rs b/native/src/editor/ui/progress_dialog.rs index 63aeda47..0034cc0c 100644 --- a/native/src/editor/ui/progress_dialog.rs +++ b/native/src/editor/ui/progress_dialog.rs @@ -185,4 +185,4 @@ fn add_margin_child( } mc -} \ No newline at end of file +} diff --git a/native/src/ext.rs b/native/src/ext.rs index d1dd2c9c..0e999a76 100644 --- a/native/src/ext.rs +++ b/native/src/ext.rs @@ -5,4 +5,4 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -pub(crate) mod node_3d; \ No newline at end of file +pub(crate) mod node_3d; diff --git a/native/src/ext/node_3d.rs b/native/src/ext/node_3d.rs index a31a92f0..3f694ddf 100644 --- a/native/src/ext/node_3d.rs +++ b/native/src/ext/node_3d.rs @@ -36,4 +36,4 @@ impl Node3DExt for Node3D { self.set_global_transform(node_transform); } -} \ No newline at end of file +} diff --git a/native/src/lib.rs b/native/src/lib.rs index 7f86438f..af4f6dea 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -17,23 +17,22 @@ mod terrain_builder; mod util; mod world; -use godot::prelude::{gdextension, ExtensionLibrary, InitLevel}; +use godot::init::InitStage; +use godot::prelude::{gdextension, ExtensionLibrary}; struct NativeLib; #[gdextension] unsafe impl ExtensionLibrary for NativeLib { - fn on_level_init(level: InitLevel) { - match level { - InitLevel::Scene => godot_rust_script::init!(scripts), - InitLevel::Editor | InitLevel::Servers | InitLevel::Core => (), + fn on_stage_init(level: InitStage) { + if level == InitStage::Scene { + godot_rust_script::init!(scripts); } } - fn on_level_deinit(level: InitLevel) { - match level { - InitLevel::Scene => godot_rust_script::deinit!(), - InitLevel::Servers | InitLevel::Core | InitLevel::Editor => (), + fn on_stage_deinit(level: InitStage) { + if level == InitStage::Scene { + godot_rust_script::deinit!(); } } } @@ -71,4 +70,4 @@ macro_rules! engine_callable { __typecheck($instance).callable(stringify!($fn)) }}; -} \ No newline at end of file +} diff --git a/native/src/objects.rs b/native/src/objects.rs index d00ff36c..ea6e3ce3 100644 --- a/native/src/objects.rs +++ b/native/src/objects.rs @@ -5,4 +5,4 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -pub mod scene_object_registry; \ No newline at end of file +pub mod scene_object_registry; diff --git a/native/src/objects/scene_object_registry.rs b/native/src/objects/scene_object_registry.rs index 5b15e0b6..289f7906 100644 --- a/native/src/objects/scene_object_registry.rs +++ b/native/src/objects/scene_object_registry.rs @@ -521,4 +521,4 @@ pub fn load_network(object_id: u8) -> Option> { pub fn load_building(object_id: u8) -> Option> { load(buildings, object_id) -} \ No newline at end of file +} diff --git a/native/src/project_settings.rs b/native/src/project_settings.rs index b2f30a6f..24c01de9 100644 --- a/native/src/project_settings.rs +++ b/native/src/project_settings.rs @@ -17,4 +17,4 @@ pub trait CustomProjectSettings { const EDITOR_REQUIRED_VERSION: &str = "editor/required_version"; } -impl CustomProjectSettings for classes::ProjectSettings {} \ No newline at end of file +impl CustomProjectSettings for classes::ProjectSettings {} diff --git a/native/src/resources/input_device.rs b/native/src/resources/input_device.rs index c5bda857..112f91ea 100644 --- a/native/src/resources/input_device.rs +++ b/native/src/resources/input_device.rs @@ -4,9 +4,11 @@ use godot::classes::{ match_class, Engine, IResource, Input, InputEvent, InputEventJoypadButton, InputEventJoypadMotion, Resource, }; -use godot::meta::{FromGodot, GodotConvert}; +use godot::meta::conv::ByValue; +use godot::meta::{FromGodot, GodotConvert, ToGodot}; use godot::obj::{Base, Gd, Singleton, WithUserSignals}; -use godot::prelude::{godot_api, ConvertError, GodotClass, Var}; +use godot::prelude::{godot_api, ConvertError, GodotClass}; +use godot::register::property::SimpleVar; macro_rules! input_axis { ($event:ident, $field:expr, $neg:expr, $pos:expr) => { @@ -255,19 +257,18 @@ impl AxisAction { impl GodotConvert for AxisAction { type Via = StringName; -} -impl Var for AxisAction { - fn get_property(&self) -> Self::Via { - self.as_str().into() + fn godot_shape() -> godot::meta::shape::GodotShape { + Self::Via::godot_shape() } +} - fn set_property(&mut self, value: Self::Via) { - let Ok(parsed) = AxisAction::try_from_godot(value.clone()) else { - panic!("unknown action type {value}"); - }; +impl SimpleVar for AxisAction {} +impl ToGodot for AxisAction { + type Pass = ByValue; - *self = parsed; + fn to_godot(&self) -> godot::meta::ToArg<'_, Self::Via, Self::Pass> { + StringName::from(self.as_str()) } } @@ -307,6 +308,10 @@ impl ButtonAction { impl GodotConvert for ButtonAction { type Via = StringName; + + fn godot_shape() -> godot::meta::shape::GodotShape { + Self::Via::godot_shape() + } } impl FromGodot for ButtonAction { diff --git a/native/src/resources/items.rs b/native/src/resources/items.rs index 541abf69..844b003d 100644 --- a/native/src/resources/items.rs +++ b/native/src/resources/items.rs @@ -5,4 +5,4 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -pub mod helicopter_upgrade; \ No newline at end of file +pub mod helicopter_upgrade; diff --git a/native/src/resources/water_decal_tracker.rs b/native/src/resources/water_decal_tracker.rs index 88b95fb8..6939e96d 100644 --- a/native/src/resources/water_decal_tracker.rs +++ b/native/src/resources/water_decal_tracker.rs @@ -45,4 +45,4 @@ impl IResource for WaterDecalTracker { base, } } -} \ No newline at end of file +} diff --git a/native/src/resources/world_constants.rs b/native/src/resources/world_constants.rs index cf83fe0a..cab4ce5e 100644 --- a/native/src/resources/world_constants.rs +++ b/native/src/resources/world_constants.rs @@ -40,4 +40,4 @@ impl WorldConstants { fn set_tile_height(&mut self, value: u8) { self.tile_height = value; } -} \ No newline at end of file +} diff --git a/native/src/road_navigation.rs b/native/src/road_navigation.rs index aa8a9e2e..256763f7 100644 --- a/native/src/road_navigation.rs +++ b/native/src/road_navigation.rs @@ -468,4 +468,4 @@ impl RoadNavigationConfig { self.road_navigation_mut().insert_node(building, scene_node); } -} \ No newline at end of file +} diff --git a/native/src/scripts/effects.rs b/native/src/scripts/effects.rs index 3c33994d..8f339dbd 100644 --- a/native/src/scripts/effects.rs +++ b/native/src/scripts/effects.rs @@ -5,4 +5,4 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -mod water_decal; \ No newline at end of file +mod water_decal; diff --git a/native/src/scripts/effects/water_decal.rs b/native/src/scripts/effects/water_decal.rs index f62237da..52c9730e 100644 --- a/native/src/scripts/effects/water_decal.rs +++ b/native/src/scripts/effects/water_decal.rs @@ -34,7 +34,7 @@ impl WaterDecal { return; } - util::timer(&mut self.base.get_tree().unwrap(), Self::LIFETIME) + util::timer(&mut self.base.get_tree(), Self::LIFETIME) .connect("timeout", &script_callable!(self, Self::on_timeout)); } @@ -64,4 +64,4 @@ impl WaterDecal { self.decal_tracker.bind_mut().free(&self.base); self.base.queue_free(); } -} \ No newline at end of file +} diff --git a/native/src/scripts/mod.rs b/native/src/scripts/mod.rs index 1fcc2fb5..9a24c45b 100644 --- a/native/src/scripts/mod.rs +++ b/native/src/scripts/mod.rs @@ -14,4 +14,4 @@ mod world; pub use spawner::*; -godot_rust_script::define_script_root!(); \ No newline at end of file +godot_rust_script::define_script_root!(); diff --git a/native/src/scripts/objects.rs b/native/src/scripts/objects.rs index aab4a721..95cd21d7 100644 --- a/native/src/scripts/objects.rs +++ b/native/src/scripts/objects.rs @@ -10,4 +10,4 @@ mod building; mod camera; mod canon_upgrade; mod debugger_3_d; -mod water_jet; \ No newline at end of file +mod water_jet; diff --git a/native/src/scripts/objects/agents.rs b/native/src/scripts/objects/agents.rs index 77c81dfa..56f43507 100644 --- a/native/src/scripts/objects/agents.rs +++ b/native/src/scripts/objects/agents.rs @@ -5,4 +5,4 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -mod car; \ No newline at end of file +mod car; diff --git a/native/src/scripts/objects/agents/car.rs b/native/src/scripts/objects/agents/car.rs index ad4df855..64c83c86 100644 --- a/native/src/scripts/objects/agents/car.rs +++ b/native/src/scripts/objects/agents/car.rs @@ -428,4 +428,4 @@ fn angular_offset(from: f32, to: f32) -> f32 { } offset -} \ No newline at end of file +} diff --git a/native/src/scripts/objects/building.rs b/native/src/scripts/objects/building.rs index 8a8a9f4f..7a340206 100644 --- a/native/src/scripts/objects/building.rs +++ b/native/src/scripts/objects/building.rs @@ -137,4 +137,4 @@ impl Building { fn dispatch_notification(&mut self, notification: BuildingNotification) { self.features.dispatch_notification(notification); } -} \ No newline at end of file +} diff --git a/native/src/scripts/objects/building/fire.rs b/native/src/scripts/objects/building/fire.rs index 4baf5c88..273eb3dd 100644 --- a/native/src/scripts/objects/building/fire.rs +++ b/native/src/scripts/objects/building/fire.rs @@ -167,4 +167,4 @@ impl> BuildingFeature for FireFeature { } } } -} \ No newline at end of file +} diff --git a/native/src/scripts/objects/debugger_3_d.rs b/native/src/scripts/objects/debugger_3_d.rs index 83f895ed..57012a42 100644 --- a/native/src/scripts/objects/debugger_3_d.rs +++ b/native/src/scripts/objects/debugger_3_d.rs @@ -40,4 +40,4 @@ impl Debugger3D { pub fn debug_data(&self) -> VarDictionary { self.debug_data.clone() } -} \ No newline at end of file +} diff --git a/native/src/scripts/objects/water_jet.rs b/native/src/scripts/objects/water_jet.rs index 30bfab1e..5f00d5d3 100644 --- a/native/src/scripts/objects/water_jet.rs +++ b/native/src/scripts/objects/water_jet.rs @@ -8,7 +8,7 @@ use std::boxed::Box; use anyhow::{bail, Result}; -use godot::builtin::{Aabb, Array, Callable, GString, Variant, Vector3}; +use godot::builtin::{Aabb, Array, Callable, StringName, Variant, Vector3}; use godot::classes::object::ConnectFlags; use godot::classes::{ Area3D, Decal, GpuParticles3D, Node, Node3D, PhysicsRayQueryParameters3D, ShapeCast3D, @@ -103,7 +103,7 @@ impl WaterJet { } fn raycast_to_surface(&self, origin: Vector3, target: Vector3) -> Result> { - let Some(mut physics_world) = self.base.get_world_3d() else { + let Some(physics_world) = self.base.get_world_3d() else { bail!("Failed to acquire physics world!"); }; @@ -174,7 +174,7 @@ impl WaterJet { continue; } - let mut impact_targets = Array::::new(); + let mut impact_targets = Array::::new(); #[cfg(debug_assertions)] { @@ -196,7 +196,7 @@ impl WaterJet { } }; - impact_targets.push(target_node.get_name().arg()); + impact_targets.push(&target_node.get_name()); let point = self.align_decal_normal(Intersection { position: shape_cast.get_collision_point(index), @@ -225,8 +225,7 @@ impl WaterJet { let impact_delay = Self::distance_scale(impact_distance, 0.0, self.max_delay); - let mut timer = - util::timer(&mut self.base.get_tree().unwrap(), impact_delay.into()); + let mut timer = util::timer(&mut self.base.get_tree(), impact_delay.into()); #[cfg(debug_assertions)] { @@ -251,7 +250,7 @@ impl WaterJet { break; } - debug_3d!(self.debugger => shape_cast_name, impacting, decal_spawned); + debug_3d!(self.debugger => shape_cast_name, (ref impacting), decal_spawned); } fn distance_scale(distance: f32, min: f32, max: f32) -> f32 { @@ -302,10 +301,7 @@ impl WaterJet { { #[cfg(debug_assertions)] let mut debugger = self.debugger.clone(); - let mut decal_inst: Gd = template - .duplicate() - .expect("Failed to duplicate decal node!") - .cast(); + let mut decal_inst: Gd = template.duplicate_node(); let decal_size = Vector3::new(decal_scale, decal_inst.get_size().y, decal_scale); logger::debug!("setting decal size: {decal_size}"); @@ -325,11 +321,7 @@ impl WaterJet { rand::random_range::(-90.0..90.0).to_radians(), ); - if let Some(scene_root) = target_node - .upcast_ref() - .get_tree() - .and_then(|tree| tree.get_current_scene()) - { + if let Some(scene_root) = target_node.upcast_ref().get_tree().get_current_scene() { decal_inst.set_owner(&scene_root); } else { logger::error!("Failed to access scene root! Unable to set decal owner."); @@ -349,4 +341,4 @@ impl WaterJet { target.call("impact_water", &[delta.to_variant()]); } -} \ No newline at end of file +} diff --git a/native/src/scripts/particles/mod.rs b/native/src/scripts/particles/mod.rs index aabdaf59..26549081 100644 --- a/native/src/scripts/particles/mod.rs +++ b/native/src/scripts/particles/mod.rs @@ -5,4 +5,4 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -mod dust_particles; \ No newline at end of file +mod dust_particles; diff --git a/native/src/scripts/spawner/car_spawner.rs b/native/src/scripts/spawner/car_spawner.rs index a7d2e698..a7f4f9c5 100644 --- a/native/src/scripts/spawner/car_spawner.rs +++ b/native/src/scripts/spawner/car_spawner.rs @@ -58,11 +58,7 @@ impl CarSpawner { .force_readable_name(true) .done(); - let Some(current_scene) = self - .base - .get_tree() - .and_then(|tree| tree.get_current_scene()) - else { + let Some(current_scene) = self.base.get_tree().get_current_scene() else { godot_error!("there is no active scene!"); return; }; @@ -102,4 +98,4 @@ impl CarSpawner { timer.stop(); } -} \ No newline at end of file +} diff --git a/native/src/scripts/spawner/fire_spawner.rs b/native/src/scripts/spawner/fire_spawner.rs index a63d2bc8..4f3dbd3e 100644 --- a/native/src/scripts/spawner/fire_spawner.rs +++ b/native/src/scripts/spawner/fire_spawner.rs @@ -132,11 +132,11 @@ impl FireSpawner { logger::debug!("Init Fire spawner..."); if is_editor - && (self.fire.get_property().is_none() - || self.smoke.get_property().is_none() - || self.emission_points.get_property().is_none() - || self.emission_point_normals.get_property().is_none() - || self.fire_sound.get_property().is_none()) + && (OnEditor::var_get(&self.fire).is_none() + || OnEditor::var_get(&self.smoke).is_none() + || OnEditor::var_get(&self.emission_points).is_none() + || OnEditor::var_get(&self.emission_point_normals).is_none() + || OnEditor::var_get(&self.fire_sound).is_none()) { self.base.update_configuration_warnings(); return; @@ -159,13 +159,11 @@ impl FireSpawner { .expect("emission point count should be in range"); let mut fire_process_material = org_fire_process_material - .duplicate() - .expect("Duplicating shouldn't fail!") + .duplicate_resource() .cast::(); let mut smoke_process_material = org_smoke_process_material - .duplicate() - .expect("Duplicating should work!") + .duplicate_resource() .cast::(); fire_process_material.set_emission_point_count(emission_point_count); @@ -303,16 +301,14 @@ impl FireSpawner { /// Indicates whether the current node is instanced in an other scene or not. fn is_instance(&self) -> bool { - let root_scene_path = self - .base - .get_tree() - .and_then(|tree| { - if Engine::singleton().is_editor_hint() { - tree.get_edited_scene_root() - } else { - tree.get_current_scene() - } - }) + let tree = self.base.get_tree(); + let root_scene = if Engine::singleton().is_editor_hint() { + tree.get_edited_scene_root() + } else { + tree.get_current_scene() + }; + + let root_scene_path = root_scene .map(|node| node.get_scene_file_path()) .unwrap_or_default(); @@ -330,7 +326,7 @@ impl FireSpawner { } pub fn set_emission_point_normals(&mut self, value: Option>) { - self.emission_point_normals.set_property(value); + OnEditor::var_set(&mut self.emission_point_normals, value); if Engine::singleton().is_editor_hint() && self.base.is_node_ready() { script_callable!(self, Self::_ready).call_deferred(&[]); @@ -338,7 +334,7 @@ impl FireSpawner { } pub fn set_emission_points(&mut self, value: Option>) { - self.emission_points.set_property(value); + OnEditor::var_set(&mut self.emission_points, value); if Engine::singleton().is_editor_hint() && self.base.is_node_ready() { script_callable!(self, Self::_ready).call_deferred(&[]); @@ -354,7 +350,7 @@ impl FireSpawner { } fn set_fire(&mut self, value: Option>) { - self.fire.set_property(value); + OnEditor::var_set(&mut self.fire, value); if Engine::singleton().is_editor_hint() && self.base.is_node_ready() { script_callable!(self, Self::_ready).call_deferred(&[]); @@ -362,7 +358,7 @@ impl FireSpawner { } fn set_smoke(&mut self, value: Option>) { - self.smoke.set_property(value); + OnEditor::var_set(&mut self.smoke, value); if Engine::singleton().is_editor_hint() && self.base.is_node_ready() { script_callable!(self, Self::_ready).call_deferred(&[]); @@ -378,7 +374,7 @@ impl FireSpawner { } fn set_light_source(&mut self, value: Option>) { - self.light_source.set_property(value); + OnEditor::var_set(&mut self.light_source, value); if Engine::singleton().is_editor_hint() && self.base.is_node_ready() { script_callable!(self, Self::_ready).call_deferred(&[]); @@ -386,7 +382,7 @@ impl FireSpawner { } fn set_fire_sound(&mut self, value: Option>) { - self.fire_sound.set_property(value); + OnEditor::var_set(&mut self.fire_sound, value); if Engine::singleton().is_editor_hint() && self.base.is_node_ready() { script_callable!(self, Self::_ready).call_deferred(&[]); @@ -412,30 +408,30 @@ impl FireSpawner { pub fn _get_configuration_warnings(&self) -> Array { let mut warnings = Array::new(); - if self.fire.get_property().is_none() { + if OnEditor::var_get(&self.fire).is_none() { warnings.push("Requires a GpuParticles3D node for the fire vfx"); } - if self.smoke.get_property().is_none() { + if OnEditor::var_get(&self.smoke).is_none() { warnings.push("Requires a GpuParticles3D node for the smoke vfx"); } - if self.light_source.get_property().is_none() { + if OnEditor::var_get(&self.light_source).is_none() { warnings.push("A light source must be assigned"); } - if self.emission_points.get_property().is_none() { + if OnEditor::var_get(&self.emission_points).is_none() { warnings.push("Emission points texture must be assinged"); } - if self.emission_point_normals.get_property().is_none() { + if OnEditor::var_get(&self.emission_point_normals).is_none() { warnings.push("Emission point normals texture must be assinged"); } - if self.fire_sound.get_property().is_none() { + if OnEditor::var_get(&self.fire_sound).is_none() { warnings.push("Fire audio source must be assigned"); } warnings } -} \ No newline at end of file +} diff --git a/native/src/scripts/spawner/mod.rs b/native/src/scripts/spawner/mod.rs index 7e14b683..d0a6c34d 100644 --- a/native/src/scripts/spawner/mod.rs +++ b/native/src/scripts/spawner/mod.rs @@ -8,4 +8,4 @@ mod car_spawner; mod fire_spawner; -pub use fire_spawner::*; \ No newline at end of file +pub use fire_spawner::*; diff --git a/native/src/scripts/ui/title_menu.rs b/native/src/scripts/ui/title_menu.rs index ce31d110..fa8ff073 100644 --- a/native/src/scripts/ui/title_menu.rs +++ b/native/src/scripts/ui/title_menu.rs @@ -1,5 +1,5 @@ use godot::builtin::math::ApproxEq; -use godot::builtin::{GString, Vector2, Vector2i}; +use godot::builtin::{GString, StringName, Vector2, Vector2i}; use godot::classes::input::MouseMode; use godot::classes::resource_loader::ThreadLoadStatus; use godot::classes::{ @@ -7,7 +7,7 @@ use godot::classes::{ InputEvent, Node3D, PackedScene, ResourceLoader, }; use godot::global; -use godot::meta::ObjectToOwned; +use godot::meta::conv::ObjectToOwned; use godot::obj::{EngineEnum, Gd, Singleton as _}; use godot_rust_script::{godot_script_impl, Context, GodotScript, OnEditor, ScriptExportGroup}; use num::ToPrimitive; @@ -98,7 +98,7 @@ impl TitleMenu { } let scene_path = self.main_scene.clone(); - let mut tree = self.base.get_tree().unwrap(); + let mut tree = self.base.get_tree(); let animation_player = self.scene_transitions.clone(); godot::task::spawn(async move { @@ -144,7 +144,7 @@ impl TitleMenu { } pub fn on_quit(&mut self) { - let mut tree = self.base.get_tree().unwrap(); + let mut tree = self.base.get_tree(); tree.quit(); } @@ -180,7 +180,7 @@ impl TitleMenu { let animation = animation.get_name(); - if !self.ui_sounds.has_animation(animation.arg()) { + if !self.ui_sounds.has_animation(&StringName::from(&animation)) { logger::error!( "Animation {} does not belong to Animation Player {}", animation, @@ -189,7 +189,10 @@ impl TitleMenu { return; } - self.ui_sounds.play_ex().name(animation.arg()).done(); + self.ui_sounds + .play_ex() + .name(&StringName::from(&animation)) + .done(); } fn apply_ui_scale(&self) { diff --git a/native/src/scripts/world.rs b/native/src/scripts/world.rs index e966ad51..be6eed58 100644 --- a/native/src/scripts/world.rs +++ b/native/src/scripts/world.rs @@ -7,4 +7,4 @@ mod buildings; mod gi_probes; -pub mod solar_setup; \ No newline at end of file +pub mod solar_setup; diff --git a/native/src/scripts/world/buildings.rs b/native/src/scripts/world/buildings.rs index c1de658d..45e961db 100644 --- a/native/src/scripts/world/buildings.rs +++ b/native/src/scripts/world/buildings.rs @@ -72,7 +72,7 @@ impl Buildings { let handle = ctx.reentrant_scope(self, |mut base: Gd| { let mut script_self_ref: RsRef = base.to_script(); - let tree = base.get_tree().expect("Node must be part of the tree!"); + let tree = base.get_tree(); task::spawn(async move { let next_tick = tree.signals().process_frame(); @@ -204,7 +204,7 @@ impl Buildings { }; if !instance.get("tile_coords_array").is_nil() { - let mut array = Array::new(); + let mut array = Array::::new(); array.push(tile_coords.0); array.push(tile_coords.1); @@ -228,7 +228,7 @@ impl Buildings { .force_readable_name(true) .done(); - let Some(root) = base.get_tree().and_then(|tree| tree.get_current_scene()) else { + let Some(root) = base.get_tree().get_current_scene() else { logger::warn!("there is no active scene!"); return; }; @@ -252,7 +252,7 @@ impl Buildings { } } - /// sector coordinates are expected to align with a step of 10 + /// Sector coordinates are expected to align with a step of 10 fn get_sector( base: &mut ::Base, tile_coords: (u32, u32), @@ -285,7 +285,7 @@ impl Buildings { 0, )); - if let Some(root) = base.get_tree().and_then(|tree| tree.get_current_scene()) { + if let Some(root) = base.get_tree().get_current_scene() { sector.set_owner(&root); } @@ -350,4 +350,4 @@ fn with_timing(cb: impl FnOnce() -> R) -> (R, u64) { let result = cb(); (result, Time::singleton().get_ticks_msec() - start) -} \ No newline at end of file +} diff --git a/native/src/scripts/world/gi_probes.rs b/native/src/scripts/world/gi_probes.rs index bea46e5d..9a1a98da 100644 --- a/native/src/scripts/world/gi_probes.rs +++ b/native/src/scripts/world/gi_probes.rs @@ -82,7 +82,7 @@ impl GiProbes { return; } - let mut tree = base.get_tree().unwrap(); + let tree = base.get_tree(); // Wait for one frame to clear the borrow of self. tree.signals().process_frame().into_future().await; @@ -117,7 +117,7 @@ impl GiProbes { .flat_map(|x| (0..probe_count.into_u32()).map(move |y| (x, y))); let world_root = base.get_parent_node_3d().unwrap(); - let scene_tree = base.get_tree().unwrap(); + let scene_tree = base.get_tree(); let mut script: RsRef = base.to_script(); let probes = probe_coordinates @@ -218,10 +218,7 @@ fn create_voxel_gi_probe( height_offset: f32, ) -> Gd { let mut probe = VoxelGi::new_alloc(); - let probe_data: Gd = data - .duplicate() - .expect("Should be possible to duplicate VoxelGIData") - .cast(); + let probe_data: Gd = data.duplicate_resource(); probe.set_size(Vector3::splat(dimensions.size + dimensions.margin)); probe.set_subdiv(Subdiv::SUBDIV_64); @@ -245,7 +242,7 @@ fn create_voxel_gi_probe( let translate_z = height_offset + dimensions.extent; probe.set_global_position(Vector3::new(translate_x, translate_z, translate_y)); - probe.set_owner(&node.get_tree().unwrap().get_current_scene().unwrap()); + probe.set_owner(&node.get_tree().get_current_scene().unwrap()); probe } diff --git a/native/src/scripts/world/solar_setup.rs b/native/src/scripts/world/solar_setup.rs index f9f5c1b9..f56c1cc7 100644 --- a/native/src/scripts/world/solar_setup.rs +++ b/native/src/scripts/world/solar_setup.rs @@ -272,4 +272,4 @@ impl SolarSetup { pub fn environment_brightness(&self) -> f32 { self.sun_brightness() + self.moon_brightness() + self.sky_brightness() } -} \ No newline at end of file +} diff --git a/native/src/terrain_builder.rs b/native/src/terrain_builder.rs index 419b44dc..e2740a5c 100644 --- a/native/src/terrain_builder.rs +++ b/native/src/terrain_builder.rs @@ -940,4 +940,4 @@ fn is_water_cliff(tile: &Tile, neighbor: &Tile) -> bool { neighbor.terrain.ty, TerrainType::SurfaceWater | TerrainType::MoreSurfaceWater ) || !matches!(neighbor.terrain.slope, TerrainSlope::VertialCliff)) -} \ No newline at end of file +} diff --git a/native/src/terrain_builder/lerp.rs b/native/src/terrain_builder/lerp.rs index 016fc3e0..ac65759e 100644 --- a/native/src/terrain_builder/lerp.rs +++ b/native/src/terrain_builder/lerp.rs @@ -21,4 +21,4 @@ pub fn bilerp_xyz(points: &[Vector3; 4], x: f32, y: f32) -> Vector3 { let target_z = bilerp(points.map(|v| v.z), x, y); Vector3::new(target_x, target_y, target_z) -} \ No newline at end of file +} diff --git a/native/src/terrain_builder/point.rs b/native/src/terrain_builder/point.rs index a39700eb..49d845d5 100644 --- a/native/src/terrain_builder/point.rs +++ b/native/src/terrain_builder/point.rs @@ -41,4 +41,4 @@ impl DimensionZ for RwLock { fn z(&self) -> f32 { self.read().expect(MUTEX_LOCK_ERROR).z() } -} \ No newline at end of file +} diff --git a/native/src/terrain_builder/terrain_rotation.rs b/native/src/terrain_builder/terrain_rotation.rs index 0b8bde58..b75a3d7a 100644 --- a/native/src/terrain_builder/terrain_rotation.rs +++ b/native/src/terrain_builder/terrain_rotation.rs @@ -119,4 +119,4 @@ impl TerrainRotation { Self { offset } } -} \ No newline at end of file +} diff --git a/native/src/terrain_builder/tile_surface.rs b/native/src/terrain_builder/tile_surface.rs index a8c855b3..44251da7 100644 --- a/native/src/terrain_builder/tile_surface.rs +++ b/native/src/terrain_builder/tile_surface.rs @@ -383,4 +383,4 @@ impl SurfaceAssociated for Vertex { fn surface(&self) -> TileSurfaceType { self.surface } -} \ No newline at end of file +} diff --git a/native/src/util.rs b/native/src/util.rs index 7c3f0669..76ebc512 100644 --- a/native/src/util.rs +++ b/native/src/util.rs @@ -27,7 +27,7 @@ use godot::obj::NewAlloc; pub use numbers::*; -/// Create a new ingame one-shot timer in seconds. +/// Create a new in game one-shot timer in seconds. #[inline] pub fn timer(tree: &mut Gd, delay: f64) -> Gd { tree.create_timer_ex(delay) @@ -146,7 +146,11 @@ macro_rules! debug_3d { $debugger.debug_data().set(stringify!($variable), $variable.to_degrees()); }; + (inner $debugger: ident, (ref $variable: ident)) => { + $debugger.debug_data().set(stringify!($variable), &$variable); + }; + (inner $debugger: ident, $variable: ident) => { $debugger.debug_data().set(stringify!($variable), $variable); }; -} \ No newline at end of file +} diff --git a/native/src/util/async_support.rs b/native/src/util/async_support.rs index eb73af18..5091a0ab 100644 --- a/native/src/util/async_support.rs +++ b/native/src/util/async_support.rs @@ -49,4 +49,4 @@ pub fn godot_future() -> (impl Fn(R), Gd) { }, future, ) -} \ No newline at end of file +} diff --git a/native/src/util/logger.rs b/native/src/util/logger.rs index b9ff1540..3e1abb16 100644 --- a/native/src/util/logger.rs +++ b/native/src/util/logger.rs @@ -62,4 +62,4 @@ macro_rules! error { ($($param:expr),+) => { log!(ERROR, error, $($param),+) }; -} \ No newline at end of file +} diff --git a/native/src/util/numbers.rs b/native/src/util/numbers.rs index 55df422c..0f5f61ea 100644 --- a/native/src/util/numbers.rs +++ b/native/src/util/numbers.rs @@ -7,10 +7,9 @@ use std::fmt::Display; -use godot::{ - meta::{ByValue, FromGodot, ToGodot}, - prelude::GodotConvert, -}; +use godot::meta::conv::ByValue; +use godot::meta::{FromGodot, ToGodot}; +use godot::prelude::GodotConvert; use godot_rust_script::{GetScriptProperty, GodotScriptExport, SetScriptProperty}; #[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq, Debug)] @@ -161,19 +160,25 @@ impl From> for u64 { impl GodotScriptExport for LInt { fn hint_string( - custom_hint: Option, + custom_hint: Option, custom_string: Option, ) -> String { ::hint_string(custom_hint, custom_string) } - fn hint(custom: Option) -> godot::global::PropertyHint { + fn hint( + custom: Option, + ) -> godot::register::info::PropertyHint { u32::hint(custom) } } impl GodotConvert for LInt { type Via = u32; + + fn godot_shape() -> godot::meta::shape::GodotShape { + Self::Via::godot_shape() + } } impl SetScriptProperty for LInt { @@ -208,7 +213,7 @@ impl Display for LInt { } } -/// F32 has a mantissa of 23-bits +/// `f32` has a mantissa of 23-bits const F32_MAX: u32 = 2u32.pow(24); pub type Uf32 = LInt<0, F32_MAX>; @@ -269,4 +274,4 @@ mod test { super::F32_MAX ); } -} \ No newline at end of file +} diff --git a/native/src/world.rs b/native/src/world.rs index d16bb53e..7f1d470a 100644 --- a/native/src/world.rs +++ b/native/src/world.rs @@ -6,4 +6,4 @@ */ pub(crate) mod city_coords_feature; -pub(crate) mod city_data; \ No newline at end of file +pub(crate) mod city_data; diff --git a/native/src/world/city_coords_feature.rs b/native/src/world/city_coords_feature.rs index c544a5af..643cbf7c 100644 --- a/native/src/world/city_coords_feature.rs +++ b/native/src/world/city_coords_feature.rs @@ -80,4 +80,4 @@ impl CityCoordsFeature { (x, y, altitude) } -} \ No newline at end of file +} diff --git a/native/src/world/city_data.rs b/native/src/world/city_data.rs index 6413b270..777f87f7 100644 --- a/native/src/world/city_data.rs +++ b/native/src/world/city_data.rs @@ -389,4 +389,4 @@ fn array_to_tuple(value: &VarArray) -> Result { .try_to() .map_err(|err| TryFromDictError::InvalidType("(x, _)".into(), err.into()))?, )) -} \ No newline at end of file +} diff --git a/native/src/world/city_data/terrain_slope.rs b/native/src/world/city_data/terrain_slope.rs index e73eb118..d5934660 100644 --- a/native/src/world/city_data/terrain_slope.rs +++ b/native/src/world/city_data/terrain_slope.rs @@ -1433,4 +1433,4 @@ impl From for u8 { } } } -} \ No newline at end of file +}