Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public enum SVG {
FEEDBACK("M12 15Q12.425 15 12.7125 14.7125T13 14Q13 13.575 12.7125 13.2875T12 13Q11.575 13 11.2875 13.2875T11 14Q11 14.425 11.2875 14.7125T12 15ZM11 11H13V5H11V11ZM2 22V4Q2 3.175 2.5875 2.5875T4 2H20Q20.825 2 21.4125 2.5875T22 4V16Q22 16.825 21.4125 17.4125T20 18H6L2 22ZM5.15 16H20V4H4V17.125L5.15 16ZM4 16V4 16Z"),
FEEDBACK_FILL("M2 22V4q0-.825.5875-1.4125T4 2H20q.825 0 1.4125.5875T22 4V16q0 .825-.5875 1.4125T20 18H6L2 22Zm10-7q.425 0 .7125-.2875T13 14t-.2875-.7125T12 13t-.7125.2875T11 14t.2875.7125T12 15Zm-1-4h2V5H11v6Z"),
FILE_OPEN("M6 22q-0.825 0-1.4125-0.5875T4 20v-16q0-0.825 0.5875-1.4125T6 2h8l6 6v6h-2v-5H13v-5H6v16h9v2H6Zm15.95 0.375L19 19.425v2.225h-2v-5.65h5.65v2h-2.25l2.95 2.95-1.4 1.425Zm-15.95-2.375v-16 16Z"),
FILTER_ENABLED_MODS("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"),
FILTER_DISABLED_MODS("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5-9h10v2H7z"),
FOLDER("M4 20Q3.175 20 2.5875 19.4125T2 18V6Q2 5.175 2.5875 4.5875T4 4H10L12 6H20Q20.825 6 21.4125 6.5875T22 8V18Q22 18.825 21.4125 19.4125T20 20H4ZM4 18H20V8H11.175L9.175 6H4V18ZM4 18V6 18Z"),
FOLDER_COPY("M3 21Q2.175 21 1.5875 20.4125T1 19V6H3V19H20V21H3ZM7 17Q6.175 17 5.5875 16.4125T5 15V4Q5 3.175 5.5875 2.5875T7 2H12L14 4H21Q21.825 4 22.4125 4.5875T23 6V15Q23 15.825 22.4125 16.4125T21 17H7ZM7 15H21V6H13.175L11.175 4H7V15ZM7 15V4 15Z"),
FOLDER_OPEN("M4 20Q3.175 20 2.5875 19.4125T2 18V6Q2 5.175 2.5875 4.5875T4 4H10L12 6H20Q20.825 6 21.4125 6.5875T22 8H11.175L9.175 6H4V18L6.4 10H23.5L20.925 18.575Q20.725 19.225 20.1875 19.6125T19 20H4ZM6.1 18H19L20.8 12H7.9L6.1 18ZM6.1 18 7.9 12 6.1 18ZM4 8V6 8Z"),
Expand Down
30 changes: 30 additions & 0 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,36 @@ public void refresh() {
loadMods(modManager);
}

public void filterEnabledMods() {
if (modManager == null) return;
List<ModListPageSkin.ModInfoObject> enabledMods = new ArrayList<>();
try {
for (LocalModFile mod : modManager.getMods()) {
if (mod.isActive()) {
enabledMods.add(new ModListPageSkin.ModInfoObject(mod));
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
getItems().setAll(enabledMods);
}

public void filterDisabledMods() {
if (modManager == null) return;
List<ModListPageSkin.ModInfoObject> disabledMods = new ArrayList<>();
try {
for (LocalModFile mod : modManager.getMods()) {
if (!mod.isActive()) {
disabledMods.add(new ModListPageSkin.ModInfoObject(mod));
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
getItems().setAll(disabledMods);
}

@Override
public void loadVersion(Profile profile, String id) {
this.profile = profile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ final class ModListPageSkin extends SkinBase<ModListPage> {
// Toolbar Normal
toolbarNormal.getChildren().setAll(
createToolbarButton2(i18n("button.refresh"), SVG.REFRESH, skinnable::refresh),
createToolbarButton2(i18n("mods.filter.enabled"), SVG.FILTER_ENABLED_MODS, skinnable::filterEnabledMods),
createToolbarButton2(i18n("mods.filter.disabled"), SVG.FILTER_DISABLED_MODS, skinnable::filterDisabledMods),
createToolbarButton2(i18n("mods.add"), SVG.ADD, skinnable::add),
createToolbarButton2(i18n("button.reveal_dir"), SVG.FOLDER_OPEN, skinnable::openModFolder),
createToolbarButton2(i18n("mods.check_updates.button"), SVG.UPDATE, () ->
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,8 @@ mods.download=Download Mod
mods.download.title=Download Mod - %1s
mods.download.recommend=Recommended Mod Version - Minecraft %1s
mods.enable=Enable
mods.filter.enabled=Enabled Mods
mods.filter.disabled=Disabled Mods
mods.game.version=Game Version
mods.manage=Mods
mods.mcbbs=MCBBS
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,8 @@ mods.download=تنزيل مود
mods.download.title=تنزيل مود - %1s
mods.download.recommend=إصدار المود المقترح - Minecraft %1s
mods.enable=تفعيل
mods.filter.enabled=المودات المفعلة
mods.filter.disabled=المودات المعطلة
mods.game.version=إصدار اللعبة
mods.manage=المودات
mods.mcbbs=MCBBS
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,8 @@ mods.download=Descargar mod
mods.download.title=Descargar mod - %1s
mods.download.recommend=Versión recomendada - Minecraft %1s
mods.enable=Activar
mods.filter.enabled=Mods habilitados
mods.filter.disabled=Mods deshabilitados
mods.game.version=Versión del juego
mods.manage=Mods
mods.mcbbs=MCBBS
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ mods.disable=無効にする
mods.download=Modのダウンロード
mods.download.title=Modダウンロード- %1s
mods.enable=有効にする
mods.filter.enabled=有効なMOD
mods.filter.disabled=無効なMOD
mods.manage=Mods
mods.mcbbs=MCBBS
mods.mcmod=MCMOD
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_lzh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,8 @@ mods.download=引改囊
mods.download.title=引改囊 - %1s
mods.download.recommend=宜版 - 礦藝 %1s
mods.enable=啟之
mods.filter.enabled=啟用之模組
mods.filter.disabled=停用之模組
mods.game.version=戲版
mods.manage=司改囊
mods.mcbbs=礦藝館肆
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,8 @@ mods.download=Скачать мод
mods.download.title=Скачать мод - %1s
mods.download.recommend=Рекомендуемая версия мода - Minecraft %1s
mods.enable=Включить
mods.filter.enabled=Включенные моды
mods.filter.disabled=Отключенные моды
mods.game.version=Версия игры
mods.manage=Моды
mods.mcbbs=MCBBS
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_uk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,8 @@ mods.download=Завантажити мод
mods.download.title=Завантажити мод - %1s
mods.download.recommend=Рекомендована версія мода - Minecraft %1s
mods.enable=Увімкнути
mods.filter.enabled=Увімкнені моди
mods.filter.disabled=Вимкнені моди
mods.game.version=Версія гри
mods.manage=Моди
mods.mcbbs=MCBBS
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ mods.download=模組下載
mods.download.title=模組下載 - %1s
mods.download.recommend=推薦版本 - Minecraft %1s
mods.enable=啟用
mods.filter.enabled=已啟用模組
mods.filter.disabled=已停用模組
mods.game.version=遊戲版本
mods.manage=模組管理
mods.mcbbs=MCBBS
Expand Down
2 changes: 2 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,8 @@ mods.download=模组下载
mods.download.title=模组下载 - %1s
mods.download.recommend=推荐版本 - Minecraft %1s
mods.enable=启用
mods.filter.enabled=已启用模组
mods.filter.disabled=已禁用模组
mods.game.version=游戏版本
mods.manage=模组管理
mods.mcbbs=MCBBS
Expand Down