@@ -13,6 +13,30 @@ pub(super) fn plugin(app: &mut App) {
1313
1414 app. register_type :: < HandleMap < SoundtrackKey > > ( ) ;
1515 app. init_resource :: < HandleMap < SoundtrackKey > > ( ) ;
16+
17+ app. register_type :: < HandleMap < FontKey > > ( ) ;
18+ app. init_resource :: < HandleMap < FontKey > > ( ) ;
19+ }
20+
21+ #[ derive( Copy , Clone , Eq , PartialEq , Hash , Reflect ) ]
22+ pub enum FontKey {
23+ Arrancar ,
24+ Guavine ,
25+ }
26+
27+ impl AssetKey for FontKey {
28+ type Asset = Font ;
29+ }
30+
31+ impl FromWorld for HandleMap < FontKey > {
32+ fn from_world ( world : & mut World ) -> Self {
33+ let asset_server = world. resource :: < AssetServer > ( ) ;
34+ [
35+ ( FontKey :: Arrancar , asset_server. load ( "fonts/arrancar.ttf" ) ) ,
36+ ( FontKey :: Guavine , asset_server. load ( "fonts/guavine.otf" ) ) ,
37+ ]
38+ . into ( )
39+ }
1640}
1741
1842#[ derive( Copy , Clone , Eq , PartialEq , Hash , Reflect ) ]
@@ -41,6 +65,11 @@ pub enum ImageKey {
4165 ClockTable ,
4266 OilTable ,
4367 Background ,
68+ TitleBackground ,
69+ Gear ,
70+ TitleHand ,
71+ StartButton ,
72+ CreditsButton ,
4473}
4574
4675impl AssetKey for ImageKey {
@@ -258,6 +287,51 @@ impl FromWorld for HandleMap<ImageKey> {
258287 } ,
259288 ) ,
260289 ) ,
290+ (
291+ ImageKey :: TitleBackground ,
292+ asset_server. load_with_settings (
293+ "images/title-background.png" ,
294+ |settings : & mut ImageLoaderSettings | {
295+ settings. sampler = ImageSampler :: nearest ( ) ;
296+ } ,
297+ ) ,
298+ ) ,
299+ (
300+ ImageKey :: Gear ,
301+ asset_server. load_with_settings (
302+ "images/gear.png" ,
303+ |settings : & mut ImageLoaderSettings | {
304+ settings. sampler = ImageSampler :: nearest ( ) ;
305+ } ,
306+ ) ,
307+ ) ,
308+ (
309+ ImageKey :: TitleHand ,
310+ asset_server. load_with_settings (
311+ "images/title-hand.png" ,
312+ |settings : & mut ImageLoaderSettings | {
313+ settings. sampler = ImageSampler :: nearest ( ) ;
314+ } ,
315+ ) ,
316+ ) ,
317+ (
318+ ImageKey :: StartButton ,
319+ asset_server. load_with_settings (
320+ "images/start-button.png" ,
321+ |settings : & mut ImageLoaderSettings | {
322+ settings. sampler = ImageSampler :: nearest ( ) ;
323+ } ,
324+ ) ,
325+ ) ,
326+ (
327+ ImageKey :: CreditsButton ,
328+ asset_server. load_with_settings (
329+ "images/credits-button.png" ,
330+ |settings : & mut ImageLoaderSettings | {
331+ settings. sampler = ImageSampler :: nearest ( ) ;
332+ } ,
333+ ) ,
334+ ) ,
261335 ]
262336 . into ( )
263337 }
0 commit comments