Skip to content

Commit 25eb19f

Browse files
authored
Merge pull request #14 from iss2022-BCR/sprint1
Update MapEditor: impostazioni e load/save mappe
2 parents 09ff1c2 + e77128d commit 25eb19f

File tree

27 files changed

+1291
-475
lines changed

27 files changed

+1291
-475
lines changed

Sprint1/Sprint1_Project/sprint1_map_editor/.idea/libraries/Maven__com_google_code_gson_gson_2_10.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"darkTheme": false,
3+
"logLevel": {
4+
"toStandardOutput": true,
5+
"toFile": false,
6+
"directory": ""
7+
},
8+
"roomMapFile": "",
9+
"mapConfigFile": "mapConfig",
10+
"confirmBeforeSaving": true,
11+
"coordinateColor": "0x000000ff"
12+
}
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
|H, -, -, -, G, G, G,
2+
|-, -, -, -, -, -, -,
3+
|-, -, -, -, -, -, P,
4+
|-, -, -, -, -, -, P,
5+
|I, I, I, -, -, -, P,

Sprint1/Sprint1_Project/sprint1_map_editor/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
<version>${junit.version}</version>
4343
<scope>test</scope>
4444
</dependency>
45+
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
46+
<dependency>
47+
<groupId>com.google.code.gson</groupId>
48+
<artifactId>gson</artifactId>
49+
<version>2.10</version>
50+
</dependency>
4551
</dependencies>
4652

4753
<build>

Sprint1/Sprint1_Project/sprint1_map_editor/src/main/java/it/unibo/map_editor_bcr/MapEditor.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package it.unibo.map_editor_bcr;
22

33
import it.unibo.map_editor_bcr.controller.ControllerEditor;
4+
import it.unibo.map_editor_bcr.model.Logger;
5+
import it.unibo.map_editor_bcr.model.persistence.SettingsManager;
46
import javafx.application.Application;
57
import javafx.fxml.FXMLLoader;
68
import javafx.scene.Scene;
@@ -14,14 +16,14 @@ public class MapEditor extends Application {
1416

1517
@Override
1618
public void start(Stage stage) throws IOException {
17-
// Load Map file
18-
// if present -> load
19-
// else -> alert + load empty
19+
SettingsManager settings = SettingsManager.getInstance();
20+
2021
FXMLLoader fxmlLoader = new FXMLLoader(MapEditor.class.getResource("views/view-map-editor.fxml"));
2122
ControllerEditor controller = new ControllerEditor();
2223
fxmlLoader.setController(controller);
2324
Scene scene = new Scene(fxmlLoader.load(), WINDOW_WIDTH, WINDOW_HEIGHT);
24-
scene.getStylesheets().add(MapEditor.class.getResource("/it/unibo/map_editor_bcr/styles/theme-light.css").toExternalForm());
25+
scene.getStylesheets().add(MapEditor.class.getResource("/it/unibo/map_editor_bcr/styles/theme-" +
26+
(settings.isDarkTheme() ? "dark" : "light") + ".css").toExternalForm());
2527
stage.setTitle("Map Editor");
2628
//stage.setResizable(false);
2729

@@ -30,6 +32,12 @@ public void start(Stage stage) throws IOException {
3032
stage.show();
3133
}
3234

35+
@Override
36+
public void stop(){
37+
Logger logger = Logger.getInstance();
38+
logger.closeLogWriter();
39+
}
40+
3341
public static void main(String[] args) {
3442
launch();
3543
}

0 commit comments

Comments
 (0)