跳到正文

Dnz Config

作者:DnzMc

Dnz Config Library for Dnz Hud

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

# DNZ Config

Clean, modern settings screens for Fabric mods. Build a full config menu in a few lines of code and get switches, sliders, dropdowns, color swatches and text boxes in a dark glass design that looks the same at every GUI scale.

DNZ Config is a library: on its own it only adds an example screen to Mod Menu. Install it if a mod you use needs it.

## For players

– Smooth, rounded menu with soft shadows and animations
– Pages on the left, settings in two columns on the right
– Help text when you rest the mouse on a setting
– Settings are saved to the `config` folder as readable JSON

## For mod developers

“`java
ConfigFile<MySettings> file = ConfigFile.of(“mymod”, MySettings.class);
MySettings s = file.get();

Screen screen = DnzConfig.builder(“My Mod”)
    .accent(0x4FA3FF)
    .category(“General”, page -> {
        page.toggle(“Enabled”, () -> s.enabled, v -> s.enabled = v).note(“Turns the mod on or off”);
        page.slider(“Size”, 0, 100, 5, () -> s.size, v -> s.size = v, v -> v + “%”);
        page.choice(“Mode”, List.of(“Simple”, “Detailed”), () -> s.mode, v -> s.mode = v);
    })
    .category(“Look”, page -> {
        page.color(“Color”, () -> s.color, v -> s.color = v);
        page.text(“Label”, “Type here”, 24, () -> s.label, v -> s.label = v);
    })
    .onSave(file::save)
    .build(parent);
“`

Rows: `header`, `toggle`, `slider`, `choice` (list or enum), `color`, `text`, `button`, or your own row with `custom`. Every row can get a `.note(…)`, a `.tooltip(…)` or `.wide()`.

`ConfigFile` keeps any plain Java class as `config/<name>.json`. New fields get their default values, and saving writes a temporary file first so a crash never leaves a broken file.

You can nest DNZ Config in your mod jar (jar-in-jar) or ask players to install it.

## Details

– Fabric, client side only
– Minecraft 26.2 and 26.3
– Open source (GPL-3.0): https://github.com/DnzMc/DnzClient
– Made by the team behind DNZ Client: https://dnzclient.com

常见问题

Dnz Config 支持哪些 Minecraft 版本?

Dnz Config 支持 Minecraft Java 版 26.2–26.3,共 2 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

Dnz Config 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

DnzMc 的其他作品

查看全部 →