Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bevy Micro LDTK
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Micro LDTK
Commits
477d3b3a
Verified
Commit
477d3b3a
authored
1 year ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Fix lints
parent
ae25d19c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/assets/asset_events.rs
+1
-1
1 addition, 1 deletion
src/assets/asset_events.rs
src/ldtk/mod.rs
+5
-4
5 additions, 4 deletions
src/ldtk/mod.rs
with
6 additions
and
5 deletions
src/assets/asset_events.rs
+
1
−
1
View file @
477d3b3a
...
...
@@ -49,7 +49,7 @@ pub fn handle_ldtk_level_events(
mut
level_index
:
ResMut
<
LevelIndex
>
,
mut
update_events
:
EventWriter
<
LevelDataUpdated
>
,
)
{
for
event
in
events
.
iter
()
{
for
event
in
events
.
read
()
{
match
event
{
AssetEvent
::
Added
{
id
}
|
AssetEvent
::
Modified
{
id
}
=>
{
let
handle
=
Handle
::
Weak
(
*
id
);
...
...
This diff is collapsed.
Click to expand it.
src/ldtk/mod.rs
+
5
−
4
View file @
477d3b3a
...
...
@@ -24,7 +24,7 @@ use bevy::asset::{
use
bevy
::
prelude
::
Asset
;
use
bevy
::
reflect
::{
TypePath
,
TypeUuid
,
Uuid
};
use
crate
::
{
ldtk
,
LdtkLevel
}
;
use
crate
::
ldtk
;
#[cfg(feature
=
"ldtk_1_0_0"
)]
pub
use
data_1_0_0
::
*
;
#[cfg(any(feature
=
"ldtk_1_1_1"
,
feature
=
"ldtk_1_1_0"
))]
...
...
@@ -196,7 +196,7 @@ impl AssetLoader for LdtkLoader {
reader
.read_to_end
(
&
mut
bytes
)
.await
?
;
let
project
=
Project
::
from_bytes
(
bytes
.as_slice
())
?
;
let
mut
levels
=
project
.levels
.iter
()
.flat_map
(|
level
|
{
let
levels
=
project
.levels
.iter
()
.flat_map
(|
level
|
{
log
::
debug!
(
"Checking if level is external: {} [{}]"
,
level
.identifier
,
...
...
@@ -326,13 +326,14 @@ mod autotile_support {
#[cfg(test)]
mod
test
{
#![allow(dead_code)]
use
crate
::
ldtk
::{
LdtkFromBytes
,
Project
};
#[cfg_attr(feature
=
"ldtk_1_2_5"
,
test)]
pub
fn
load_project
()
{
const
project_data
:
&
[
u8
]
=
include_bytes!
(
"./test_data/ver_1_2_5.ldtk"
);
const
PROJECT_DATA
:
&
[
u8
]
=
include_bytes!
(
"./test_data/ver_1_2_5.ldtk"
);
let
project
=
Project
::
from_bytes
(
project_data
)
.expect
(
"Failed to parse project file"
);
let
project
=
Project
::
from_bytes
(
PROJECT_DATA
)
.expect
(
"Failed to parse project file"
);
for
layer
in
project
.defs.layers
.iter
()
{
for
_auto_rule_group
in
layer
.auto_rule_groups
.iter
()
{}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment