Skip to content

Commit 1c25ca9

Browse files
committed
fix test and small refactor
1 parent 1813cda commit 1c25ca9

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

assets/scripts/game_of_life.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313

1414
function on_script_loaded()
1515
world.info("Lua: Hello! I am initiating the game of life simulation state with randomness!")
16-
world.info("Lua: Click on the screen to set cells alive")
16+
world.info("Lua: Click on the screen to set cells alive after running the `gol start` command")
1717

1818
local life_state = fetch_life_state()
1919
local cells = life_state.cells

crates/bevy_mod_scripting_core/src/bindings/pretty_print.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,13 @@ impl ReflectReferencePrinter {
7474
pretty_path.push_str("<Reference to ");
7575
if let Some(world) = world {
7676
let tail_type_id = self.reference.tail_type_id(world.clone()).ok().flatten();
77-
let type_registry = world.type_registry();
7877

79-
Self::pretty_print_base(&self.reference.base, Some(world), &mut pretty_path);
78+
Self::pretty_print_base(&self.reference.base, Some(world.clone()), &mut pretty_path);
8079

8180
pretty_path.push_str(&self.reference.reflect_path.to_string());
8281

8382
if let Some(tail_type_id) = tail_type_id {
84-
let type_path = {
85-
let type_registry = type_registry.read();
86-
type_registry
87-
.get_type_info(tail_type_id)
88-
.map(|t| t.type_path_table().short_path())
89-
.unwrap_or(Self::UNREGISTERED_TYPE)
90-
};
83+
let type_path = tail_type_id.display_with_world(world);
9184
pretty_path.push_str(&format!(" -> {}", type_path));
9285
}
9386
} else {
@@ -125,7 +118,7 @@ impl ReflectReferencePrinter {
125118
let type_path = if let Some(world) = world {
126119
type_id.display_with_world(world.clone())
127120
} else {
128-
format!("{:?}", type_id)
121+
type_id.display_without_world()
129122
};
130123

131124
let base_kind = match base.base_id {

crates/languages/bevy_mod_scripting_lua/tests/data/remove_resource/no_resource_data_errors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ local type = _get_mock_type()
33

44
assert_throws(function ()
55
world.remove_resource(type)
6-
end, "Missing type data ReflectResource for type: Unregistered TypeId.*")
6+
end, "Missing type data ReflectResource for type: Unregistered(TypeId.*")

0 commit comments

Comments
 (0)