Skip to content

Commit

Permalink
config of the api url
Browse files Browse the repository at this point in the history
  • Loading branch information
cubewhy committed Jan 13, 2024
1 parent decb07d commit 4b28404
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
29 changes: 19 additions & 10 deletions src/main/java/org/cubewhy/celestial/gui/pages/GuiSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,39 @@ private void initGui() {
claim("game"); // config in GuiVersionSelect
claim("javaagents"); // config in GuiAddonManager

// config of the launcher
JPanel panelLauncher = new JPanel();
panelLauncher.setLayout(new VerticalFlowLayout(VerticalFlowLayout.LEFT));
panelLauncher.setBorder(new TitledBorder(null, f.getString("gui.settings.launcher"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, Color.orange));
panelLauncher.add(getAutoSaveCheckBox(config.getConfig(), "data-sharing", f.getString("gui.settings.launcher.data-sharing")));
// theme
// api
JPanel p4 = new JPanel();
p4.add(new JLabel(f.getString("gui.settings.launcher.theme")));
p4.add(getAutoSaveComboBox(config.getConfig(), "theme", List.of(new String[]{"dark", "light"})));
p4.add(new JLabel(f.getString("gui.settings.launcher.api")));
p4.add(getAutoSaveTextField("api", config.getConfig()));

panelLauncher.add(p4);
// language
// data sharing
panelLauncher.add(getAutoSaveCheckBox(config.getConfig(), "data-sharing", f.getString("gui.settings.launcher.data-sharing")));
// theme
JPanel p5 = new JPanel();
p5.add(new JLabel(f.getString("gui.settings.launcher.language")));
p5.add(getAutoSaveComboBox(config.getConfig(), "language", List.of(new String[]{"zh", "en"})));
p5.add(new JLabel(f.getString("gui.settings.launcher.theme")));
p5.add(getAutoSaveComboBox(config.getConfig(), "theme", List.of(new String[]{"dark", "light"})));
panelLauncher.add(p5);
// max threads
// language
JPanel p6 = new JPanel();
p6.add(new JLabel(f.getString("gui.settings.launcher.max-threads")));
p6.add(getAutoSaveSpinner(config.getConfig(), "max-threads", 1, 256));
p6.add(new JLabel(f.getString("gui.settings.launcher.language")));
p6.add(getAutoSaveComboBox(config.getConfig(), "language", List.of(new String[]{"zh", "en"})));
panelLauncher.add(p6);
// max threads
JPanel p7 = new JPanel();
p7.add(new JLabel(f.getString("gui.settings.launcher.max-threads")));
p7.add(getAutoSaveSpinner(config.getConfig(), "max-threads", 1, 256));
panelLauncher.add(p7);

claim("data-sharing", panelLauncher);
claim("theme");
claim("language");
claim("max-threads");
claim("api");

JPanel panelUnclaimed = new JPanel();
panelUnclaimed.setBorder(new TitledBorder(null, f.getString("gui.settings.unclaimed"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, Color.orange));
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/languages/launcher.properties
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ gui.settings.launcher.data-sharing=Data sharing
gui.settings.launcher.theme=Theme:
gui.settings.warn.restart=Tip: Some settings require restarting the launcher to take effect
gui.settings.launcher.language=Language/语言:
gui.settings.launcher.max-threads=Downloader maximum thread:
gui.settings.launcher.max-threads=Downloader maximum thread:
gui.settings.launcher.api=API (only supports LunarCN):
3 changes: 2 additions & 1 deletion src/main/resources/languages/launcher_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ gui.settings.launcher.data-sharing=Data sharing
gui.settings.launcher.theme=Theme:
gui.settings.warn.restart=Tip: Some settings require restarting the launcher to take effect
gui.settings.launcher.language=Language/语言:
gui.settings.launcher.max-threads=Downloader maximum thread:
gui.settings.launcher.max-threads=Downloader maximum thread:
gui.settings.launcher.api=API (only supports LunarCN):
3 changes: 2 additions & 1 deletion src/main/resources/languages/launcher_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,5 @@ gui.settings.launcher.data-sharing=数据分享
gui.settings.launcher.theme=主题:
gui.settings.warn.restart=提示:部分设置需要重启启动器才能生效
gui.settings.launcher.language=语言/Language:
gui.settings.launcher.max-threads=下载器最大线程:
gui.settings.launcher.max-threads=下载器最大线程:
gui.settings.launcher.api=接口(仅支持LunarCN):

0 comments on commit 4b28404

Please sign in to comment.