File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 20
20
* @author bwyap
21
21
*
22
22
*/
23
- public class Resource {
24
-
25
- public static final String RESOURCE_JSON = "/com/bwyap/engine/resource/resources.json" ;
23
+ public class Resource {
26
24
27
25
28
26
public static final String IN_ROOT = "/com/bwyap/enginedriver/" ;
Original file line number Diff line number Diff line change 4
4
import java .io .IOException ;
5
5
6
6
import com .bwyap .engine .resource .ResourceManagerBase ;
7
+ import com .bwyap .enginedriver .resource .jsonwrapper .Settings ;
7
8
import com .bwyap .lwjgl .engine .gui .nanovg .NVGFont ;
8
9
import com .bwyap .lwjgl .engine .gui .nanovg .NVGTexture ;
9
10
import com .bwyap .lwjgl .engine .render3d .LWJGLTexture ;
21
22
*/
22
23
public class LWJGLResourceManager extends ResourceManagerBase {
23
24
25
+ public static final String RESOURCE_JSON = "/com/bwyap/engine/resource/resources.json" ;
26
+
24
27
25
28
private static LWJGLResourceManager instance ;
26
29
27
30
31
+ private Settings settings ;
32
+
33
+
28
34
/**
29
35
* Get the resource manager instance
30
36
* @return
@@ -76,6 +82,15 @@ public void loadDependentResources() throws Exception {
76
82
}
77
83
78
84
85
+ /**
86
+ * Get the settings object
87
+ * @return
88
+ */
89
+ public Settings settings () {
90
+ return settings ;
91
+ }
92
+
93
+
79
94
/*
80
95
* ===============
81
96
* PRIVATE METHODS
@@ -92,8 +107,12 @@ private void loadFolders() {
92
107
93
108
94
109
private void loadConfig () {
95
- //TODO
96
- //
110
+ File configFile = new File (lib .getConfig ().get ("config_file" ));
111
+ settings = new Settings (ResourceLoader .loadJSON (configFile ));
112
+ if (!settings .isValid ()) {
113
+ ResourceLoader .copyFileFromJar (configFile , null );
114
+ settings = new Settings (ResourceLoader .loadJSON (configFile ));
115
+ }
97
116
}
98
117
99
118
You can’t perform that action at this time.
0 commit comments