@@ -5,14 +5,13 @@ use std::collections::BTreeMap;
5
5
use std:: path:: Path ;
6
6
7
7
use astro_modintegrator:: unreal_modintegrator:: IntegratorConfig ;
8
- use astro_modintegrator:: unreal_modloader:: config:: { GameConfig , InstallManager } ;
8
+ use astro_modintegrator:: unreal_modloader:: config:: { GameConfig , IconData , InstallManager } ;
9
9
use astro_modintegrator:: unreal_modloader:: error:: ModLoaderError ;
10
10
use astro_modintegrator:: unreal_modloader:: game_platform_managers:: {
11
11
GetGameBuildTrait , MsStoreInstallManager , SteamInstallManager ,
12
12
} ;
13
13
use astro_modintegrator:: unreal_modloader:: update_info:: UpdateInfo ;
14
14
use astro_modintegrator:: unreal_modloader:: version:: GameBuild ;
15
- use astro_modintegrator:: unreal_modloader:: IconData ;
16
15
use astro_modintegrator:: { unreal_modloader, AstroIntegratorConfig } ;
17
16
18
17
mod logging;
@@ -55,6 +54,21 @@ impl GetGameBuildTrait<SteamInstallManager> for SteamGetGameBuild {
55
54
56
55
struct AstroGameConfig ;
57
56
57
+ fn load_icon ( ) -> IconData {
58
+ let data = include_bytes ! ( "../assets/icon.ico" ) ;
59
+ let image = image:: load_from_memory ( data) . unwrap ( ) . to_rgba8 ( ) ;
60
+
61
+ IconData {
62
+ data : image. to_vec ( ) ,
63
+ width : image. width ( ) ,
64
+ height : image. height ( ) ,
65
+ }
66
+ }
67
+
68
+ lazy_static ! {
69
+ static ref RGB_DATA : IconData = load_icon( ) ;
70
+ }
71
+
58
72
impl < T , E : std:: error:: Error > GameConfig < ' static , AstroIntegratorConfig , T , E > for AstroGameConfig
59
73
where
60
74
AstroIntegratorConfig : IntegratorConfig < ' static , T , E > ,
78
92
79
93
const WINDOW_TITLE : & ' static str = "Astroneer Modloader" ;
80
94
const CONFIG_DIR : & ' static str = "AstroModLoader" ;
95
+ const CRATE_VERSION : & ' static str = cargo_crate_version ! ( ) ;
81
96
82
97
fn get_install_managers (
83
98
& self ,
@@ -135,29 +150,18 @@ where
135
150
}
136
151
Ok ( ( ) )
137
152
}
138
- }
139
153
140
- fn load_icon ( ) -> IconData {
141
- let data = include_bytes ! ( "../assets/icon.ico" ) ;
142
- let image = image:: load_from_memory ( data) . unwrap ( ) . to_rgba8 ( ) ;
143
-
144
- IconData {
145
- data : image. to_vec ( ) ,
146
- width : image. width ( ) ,
147
- height : image. height ( ) ,
154
+ fn get_icon ( & self ) -> Option < IconData > {
155
+ Some ( RGB_DATA . clone ( ) )
148
156
}
149
157
}
150
158
151
- lazy_static ! {
152
- static ref RGB_DATA : IconData = load_icon( ) ;
153
- }
154
-
155
159
fn main ( ) {
156
160
logging:: init ( ) . unwrap ( ) ;
157
161
158
162
info ! ( "Astroneer Modloader" ) ;
159
163
160
164
let config = AstroGameConfig ;
161
165
162
- unreal_modloader:: run ( config, Some ( RGB_DATA . clone ( ) ) , cargo_crate_version ! ( ) ) ;
166
+ unreal_modloader:: run ( config) ;
163
167
}
0 commit comments