Skip to content

Commit 75253d8

Browse files
Correctly handle windows file separator
1 parent 8f7ec84 commit 75253d8

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/main/java/tools/sctrade/companion/domain/gamelog/GameLogService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ public void updateStarCitizenLivePath(String starCitizenLivePath) {
2424
}
2525

2626
starCitizenLivePath = starCitizenLivePath.strip();
27-
settings.set(Setting.STAR_CITIZEN_LIVE_PATH, starCitizenLivePath);
27+
settings.set(Setting.STAR_CITIZEN_LIVE_PATH, starCitizenLivePath.replace("\\", "\\\\"));
2828
}
2929

3030
public Optional<String> getStarCitizenLivePath() {
31-
return Optional.ofNullable(settings.get(Setting.STAR_CITIZEN_LIVE_PATH));
31+
return Optional.ofNullable(settings.get(Setting.STAR_CITIZEN_LIVE_PATH).toString());
3232
}
3333

3434
}

src/main/java/tools/sctrade/companion/gui/SettingsTab.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ private void updateUsername() {
6363

6464
private void buildStarCitizenLivePathField(GameLogService gameLogService) {
6565
var starCitizenLivePathLabel = buildLabel(3, LocalizationUtil.get("labelStarCitizenLivePath"));
66-
var starCitizenLivePathField =
67-
buildTextField(3, gameLogService.getStarCitizenLivePath().orElse(null));
66+
var starCitizenLivePathField = buildTextField(3, gameLogService.getStarCitizenLivePath().get());
6867
starCitizenLivePathField.putClientProperty("JTextField.placeholderText",
6968
LocalizationUtil.get("textFieldStarCitizenLivePathPlaceholder"));
7069
starCitizenLivePathLabel.setLabelFor(starCitizenLivePathField);

src/main/resources/bundles/localization.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ textFieldStarCitizenLivePathPlaceholder = ...\\StarCitizen\\LIVE
1111
labelUsername = Username:
1212
labelStarCitizenLivePath = Star Citizen LIVE folder:
1313
tooltipUsername = Used for the website's leaderboard
14-
tooltipStarCitizenLivePath = Used for the fully-automated data acquisition
14+
tooltipStarCitizenLivePath = <html><body style="text-align: right;">Only used to read the game's log file<br />We NEVER temper with the game's executable process</body></html>
1515
labelMyData = CSV folder:
1616
labelMyImages = Screenshot folder:
1717
tabLogs = Logs

0 commit comments

Comments
 (0)