Skip to content

Commit

Permalink
added style resource loader + register built in style resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Nov 26, 2024
1 parent f58155b commit 4874b99
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fyrox-impl/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub mod task;

mod hotreload;

use crate::scene::node::constructor::new_node_constructor_container;
use crate::{
asset::{
event::ResourceEvent,
Expand All @@ -56,6 +55,7 @@ use crate::{
constructor::WidgetConstructorContainer,
font::{loader::FontLoader, Font, BUILT_IN_FONT},
loader::UserInterfaceLoader,
style::{self, resource::StyleLoader, Style},
UiContainer, UiUpdateSwitches, UserInterface,
},
material::{
Expand All @@ -80,7 +80,10 @@ use crate::{
graph::{GraphUpdateSwitches, NodePool},
mesh::surface::{self, SurfaceData, SurfaceDataLoader},
navmesh,
node::{constructor::NodeConstructorContainer, Node},
node::{
constructor::{new_node_constructor_container, NodeConstructorContainer},
Node,
},
sound::SoundEngine,
tilemap::{
brush::{TileMapBrush, TileMapBrushLoader},
Expand Down Expand Up @@ -1177,6 +1180,7 @@ pub(crate) fn initialize_resource_manager_loaders(
state.built_in_resources.add(BUILT_IN_FONT.clone());

state.built_in_resources.add(texture::PLACEHOLDER.clone());
state.built_in_resources.add(style::DEFAULT_STYLE.clone());

for material in [
&*material::STANDARD,
Expand Down Expand Up @@ -1213,6 +1217,7 @@ pub(crate) fn initialize_resource_manager_loaders(
state.constructors_container.add::<TileSet>();
state.constructors_container.add::<TileMapBrush>();
state.constructors_container.add::<AnimationTracksData>();
state.constructors_container.add::<Style>();

let loaders = &mut state.loaders;
loaders.set(model_loader);
Expand All @@ -1237,6 +1242,7 @@ pub(crate) fn initialize_resource_manager_loaders(
resource_manager: resource_manager.clone(),
});
state.loaders.set(TileMapBrushLoader {});
state.loaders.set(StyleLoader);
}

impl Engine {
Expand Down

0 comments on commit 4874b99

Please sign in to comment.