Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 24 additions & 72 deletions native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
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" }
godot = { version = "0.5.5", features = ["experimental-threads", "api-4-5", "register-docs"] }
godot-rust-script = { git = "https://github.com/titannano/godot-rust-script", rev = "e63d2e01cf1c02a46091463b5675576630b65659" }
lerp = "0.4.0"
backtrace = "0.3.64"
num = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion native/src/editor/ui/progress_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl ProgressDialog {
// No host window found, use main window.
EditorInterface::singleton()
.popup_dialog_centered_ex(&*base)
.minsize(ms.cast_int())
.minsize(ms.to_vector2i())
.done();
}
}
Expand Down
4 changes: 2 additions & 2 deletions native/src/scripts/effects/water_decal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use godot::builtin::{Callable, Color, NodePath};
use godot::classes::Decal;
use godot::meta::ToGodot;
use godot::obj::Gd;
use godot_rust_script::{godot_script_impl, CastToScript, Context, GodotScript, OnEditor, RsRef};
use godot_rust_script::{godot_script_impl, CastToScript, Context, GodotScript, OnEditor, Rs};

use crate::resources::WaterDecalTracker;
use crate::util;
Expand Down Expand Up @@ -52,7 +52,7 @@ impl WaterDecal {
1.0,
);

let mut script: RsRef<Self> = base.clone().into_script();
let mut script: Rs<Self> = base.clone().into_script();

tween.tween_callback(&Callable::from_fn("water_decal_tween_out", move |_| {
script.clean_up();
Expand Down
4 changes: 2 additions & 2 deletions native/src/scripts/objects/agents/car.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use godot::classes::{
};
use godot::meta::ToGodot;
use godot::obj::{Gd, Singleton as _};
use godot_rust_script::{godot_script_impl, GodotScript, OnEditor, RsRef};
use godot_rust_script::{godot_script_impl, GodotScript, OnEditor, Rs};

use crate::debug_3d;
use crate::project_settings::CustomProjectSettings;
Expand Down Expand Up @@ -95,7 +95,7 @@ struct Car {

/// Optional [`Debugger3D`] to inspect the internal state of the car.
#[export]
pub debugger: Option<RsRef<Debugger3D>>,
pub debugger: Option<Rs<Debugger3D>>,

base: Gd<<Self as GodotScript>::Base>,
}
Expand Down
8 changes: 4 additions & 4 deletions native/src/scripts/objects/building/fire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use godot::builtin::{math::ApproxEq, Transform3D, Vector3};
use godot::classes::{MeshInstance3D, Node, Node3D, PackedScene, Texture2D, Time};
use godot::obj::{Gd, Inherits, Singleton as _};
use godot::tools::load;
use godot_rust_script::{CastToScript, RsRef};
use godot_rust_script::{CastToScript, Rs};
use num::ToPrimitive;
use rand::Rng;

Expand All @@ -22,7 +22,7 @@ use super::{BuildingFeature, BuildingNotification};
#[derive(Debug)]
pub(super) struct FireFeature {
packed_fire_scene: Gd<PackedScene>,
fire_scene: Option<RsRef<FireSpawner>>,
fire_scene: Option<Rs<FireSpawner>>,
last_fire: u64,
fire_strength: f32,
last_fire_strength: f32,
Expand Down Expand Up @@ -67,7 +67,7 @@ impl FireFeature {
!self.is_dead() && self.fire_strength - self.last_fire_strength >= 0.0
}

pub fn update_fire_strength(&mut self, fire: &mut RsRef<FireSpawner>) {
pub fn update_fire_strength(&mut self, fire: &mut Rs<FireSpawner>) {
if self.fire_strength.approx_eq(&self.last_fire_strength) {
return;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ impl<N: Inherits<Node>> BuildingFeature<N> for FireFeature {
* aabb.size)
.abs();

let mut script: RsRef<FireSpawner> = scene_instance.to_script();
let mut script: Rs<FireSpawner> = scene_instance.to_script();

script.set_emission_points(Some(self.emission_points.clone()));
script.set_emission_point_normals(Some(self.emission_point_normals.clone()));
Expand Down
4 changes: 2 additions & 2 deletions native/src/scripts/objects/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::f32;
use godot::builtin::math::{ApproxEq, FloatExt};
use godot::classes::{Camera3D, CameraAttributesPhysical, Node3D};
use godot::obj::Gd;
use godot_rust_script::{godot_script_impl, GodotScript, OnEditor, RsRef};
use godot_rust_script::{godot_script_impl, GodotScript, OnEditor, Rs};
use itertools::Itertools;

use crate::scripts::world::solar_setup::{ISolarSetup, SolarSetup};
Expand All @@ -20,7 +20,7 @@ use crate::util::logger;
#[script(base = Camera3D)]
struct Camera {
#[export]
pub solar_setup: OnEditor<RsRef<SolarSetup>>,
pub solar_setup: OnEditor<Rs<SolarSetup>>,

#[export]
pub focus_target: Option<Gd<Node3D>>,
Expand Down
4 changes: 2 additions & 2 deletions native/src/scripts/objects/water_jet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use godot::classes::{
use godot::meta::ToGodot;
use godot::obj::{Gd, Inherits};
use godot::prelude::{GodotClass, NodePath};
use godot_rust_script::{godot_script_impl, GodotScript, OnEditor, RsRef};
use godot_rust_script::{godot_script_impl, GodotScript, OnEditor, Rs};

use crate::ext::node_3d::Node3DExt;
use crate::resources::WaterDecalTracker;
Expand All @@ -38,7 +38,7 @@ struct WaterJet {
pub decal: OnEditor<Gd<Decal>>,

#[export]
pub debugger: Option<RsRef<Debugger3D>>,
pub debugger: Option<Rs<Debugger3D>>,

#[export]
pub decal_tracker: OnEditor<Gd<WaterDecalTracker>>,
Expand Down
6 changes: 3 additions & 3 deletions native/src/scripts/world/buildings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use godot::obj::{Gd, NewAlloc, Singleton as _};
use godot::task;
use godot::task::TaskHandle;
use godot_rust_script::{
godot_script_impl, CastToScript, Context, GodotScript, OnEditor, RsRef, ScriptSignal,
godot_script_impl, CastToScript, Context, GodotScript, OnEditor, Rs, ScriptSignal,
};

use crate::objects::scene_object_registry;
Expand Down Expand Up @@ -71,7 +71,7 @@ impl Buildings {
let (resolve, godot_future) = async_support::godot_future();

let handle = ctx.reentrant_scope(self, |mut base: Gd<Node>| {
let mut script_self_ref: RsRef<Self> = base.to_script();
let script_self_ref: Rs<Self> = base.to_script();
let tree = base.get_tree();

task::spawn(async move {
Expand Down Expand Up @@ -148,7 +148,7 @@ impl Buildings {
&city_coords_feature,
);

CastToScript::<Buildings>::to_script(&base).emit_spawn_point_encountered(
base.to_script::<Self>().emit_spawn_point_encountered(
Array::from(&[building_origin.0, building_origin.1]),
2,
spawn_tile.altitude,
Expand Down
6 changes: 2 additions & 4 deletions native/src/scripts/world/gi_probes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ use godot::classes::{
CameraAttributes, CameraAttributesPractical, MeshInstance3D, Node3D, VoxelGi, VoxelGiData,
};
use godot::obj::{Gd, NewAlloc, NewGd};
use godot_rust_script::{
godot_script_impl, CastToScript, GodotScript, OnEditor, RsRef, ScriptSignal,
};
use godot_rust_script::{godot_script_impl, CastToScript, GodotScript, OnEditor, Rs, ScriptSignal};

use crate::{
resources::WorldConstants,
Expand Down Expand Up @@ -118,7 +116,7 @@ impl GiProbes {

let world_root = base.get_parent_node_3d().unwrap();
let scene_tree = base.get_tree();
let mut script: RsRef<Self> = base.to_script();
let mut script: Rs<Self> = base.to_script();

let probes = probe_coordinates
.map(|xy| {
Expand Down
Loading
Loading