Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/zkitefly/mods_list-copy-na…
Browse files Browse the repository at this point in the history
…me' into prs
  • Loading branch information
burningtnt committed Oct 2, 2024
2 parents 818c2b4 + e29f3ac commit b12f271
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ protected ModDownloadPageSkin(DownloadPage control) {
.collect(Collectors.toList()));
descriptionPane.getChildren().add(content);

JFXHyperlink copyNameButton = new JFXHyperlink(i18n("mods.name.copy"));
copyNameButton.setOnAction(e -> {
FXUtils.copyText(content.getTitle());
});
copyNameButton.setMinWidth(Region.USE_PREF_SIZE);
descriptionPane.getChildren().add(copyNameButton);

if (getSkinnable().mod != null) {
JFXHyperlink openMcmodButton = new JFXHyperlink(i18n("mods.mcmod"));
openMcmodButton.setExternalLink(getSkinnable().translations.getMcmodUrl(getSkinnable().mod));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,15 @@ class ModInfoDialog extends JFXDialogLayout {
getActions().add(mcmodButton);
}

if (StringUtils.isNotBlank(modInfo.getModInfo().getName())) {
JFXHyperlink copyNameButton = new JFXHyperlink(i18n("mods.name.copy"));
copyNameButton.setOnAction(e -> {
FXUtils.copyText(modInfo.getModInfo().getName());
});

getActions().add(copyNameButton);
}

JFXButton okButton = new JFXButton();
okButton.getStyleClass().add("dialog-accept");
okButton.setText(i18n("button.ok"));
Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ mods.check_updates.source=Source
mods.check_updates.target_version=Target Version
mods.check_updates.update=Update
mods.choose_mod=Choose a mod
mods.name.copy=Copy Name
mods.curseforge=CurseForge
mods.dependency.embedded=built-in pre-mod (already packaged in the mod file by the author, no need to download separately)
mods.dependency.optional=optional pre-mod (if the game is missing, but mod functionality may be missing)
Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ mods.check_updates.source=來源
mods.check_updates.target_version=目標版本
mods.check_updates.update=更新
mods.choose_mod=選擇模組
mods.name.copy=複製名稱
mods.curseforge=CurseForge
mods.dependency.embedded=內置前端模組(作者已經打包在模組檔中,無需額外下載)
mods.dependency.optional=可選的前模組(如果缺少遊戲,遊戲可以運行,但模組功能可能缺失)
Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ mods.check_updates.source=来源
mods.check_updates.target_version=目标版本
mods.check_updates.update=更新
mods.choose_mod=选择模组
mods.name.copy=复制名称
mods.curseforge=CurseForge
mods.dependency.embedded=内置的前置模组(已经由作者打包在模组文件中,无需另外下载)
mods.dependency.optional=可选的前置模组(若缺失游戏能够正常运行,但模组功能可能缺失)
Expand Down

0 comments on commit b12f271

Please sign in to comment.