Add: support for user-global configuration.

This commit is contained in:
iceBear67
2026-08-08 14:09:43 +08:00
parent 7c3262ee2e
commit 3afbdb2af2
24 changed files with 499 additions and 14 deletions
@@ -2,6 +2,7 @@ package dev.photosync.client;
import dev.photosync.core.PhotoSync;
import dev.photosync.core.capture.CapturedScreenshot;
import dev.photosync.core.config.ConfigLocations;
import dev.photosync.core.config.NotificationKind;
import dev.photosync.core.config.PhotoSyncConfig;
import dev.photosync.core.upload.UploadEvent;
@@ -52,7 +53,9 @@ public final class PhotoSyncClient implements AutoCloseable {
private final AutoCapture autoCapture;
public PhotoSyncClient(ClientBridge bridge) {
this(bridge, new PhotoSync(bridge.game().configDirectory()), Theme.dark());
this(bridge, new PhotoSync(new ConfigLocations(
bridge.game().configDirectory(),
bridge.game().userDataDirectory())), Theme.dark());
}
/** Takes its collaborators explicitly so a test can drive it without a game. */
@@ -98,6 +98,12 @@
"photosync.settings.cache": "Thumbnails kept in memory",
"photosync.settings.video_badge": "Mark videos in the grid",
"photosync.settings.section.storage": "Storage",
"photosync.settings.user_config_location": "Store settings outside the game folder",
"photosync.settings.user_config_location.detail": "Settings move to %s and are shared across your Minecraft installs. The upload queue stays in the game folder.",
"photosync.settings.config_folder": "Config folder",
"photosync.settings.show_folder": "Show in folder",
"photosync.settings.save": "Save",
"photosync.settings.revert": "Revert",
"photosync.settings.dirty": "Unsaved changes -- saved when you close this screen.",
@@ -98,6 +98,12 @@
"photosync.settings.cache": "内存中保留的缩略图数量",
"photosync.settings.video_badge": "在网格中标记视频",
"photosync.settings.section.storage": "存储",
"photosync.settings.user_config_location": "将设置存储在游戏文件夹之外",
"photosync.settings.user_config_location.detail": "设置将移动到 %s,并在你的多个 Minecraft 安装之间共享。上传队列仍保留在游戏文件夹中。",
"photosync.settings.config_folder": "配置文件夹",
"photosync.settings.show_folder": "在文件夹中显示",
"photosync.settings.save": "保存",
"photosync.settings.revert": "还原",
"photosync.settings.dirty": "有未保存的更改——关闭此界面时保存。",