跳到正文

CotiiUILib

作者:Cotii_

Side panel UI library used by CubOsu!, QuickTime Events and other Cotii_Art mods: sliders, dropdowns, color picker, themes and live previews.

收藏

介绍

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

CotiiUI Lib

The side panel UI library behind CubOsu!, QuickTime Events, Customlights and General Cotii_Art Mods!.

You only need it if another mod asks for it. It adds nothing to the game by itself: install it next to the mods that use it.


Supported Versions

Loader Minecraft
Fabric 1.20.1 · 1.20.4 · 1.21.1 · 1.21.4 · 1.21.5 · 1.21.8 · 1.21.11 · 26.2 · 26.3
NeoForge 1.20.1 · 1.20.4 · 1.21.1 · 1.21.4 · 1.21.5 · 1.21.8 · 1.21.11 · 26.2 · 26.3
Forge 1.20.1 · 1.20.4

Works with Sodium, and on 26.x with both OpenGL and Vulkan.


What It Gives Mods

  • A sliding side panel that stays out of the way of the game, so changes are previewed live.
  • Collapsible sections, sliders, toggles, buttons, text fields, dropdowns with previews and a colour picker.
  • Pop-up windows, tooltips and a status line.
  • Themes: PINK RED PURPLE BLUE GREEN
  • English and Spanish texts, and any other language a mod adds.
  • One set of drawing and input methods that works the same on every Minecraft version and loader.

For Developers

Depend on com.cotii:cotiiui-<loader>:1.0.8+<minecraft> and nest it in your jar.

public final class MyPanel extends UiPanel {
    @Override
    protected String title() {
        return "My mod";
    }

    @Override
    protected int layout(int y) {
        header(y, "General");
        y += 12;
        toggle("enabled", LEFT, y, INNER, "Enabled", () -> enabled, value -> enabled = value);
        return y + ROW;
    }
}

CotiiUI.applyTheme(Theme.BLUE);
CotiiUI.registerTranslations("mymod", MyMod.class.getClassLoader());
CotiiUI.openPanel(Component.literal("My mod"), new MyPanel());

Translations are read from assets/<namespace>/i18n/<language>.json, keyed by the English text.

Other helpers:

  • Draw — rectangles, gradients, lines, rings, arcs, discs, stars and frames
  • Gfx — drawing text and textures the same way on every version
  • BaseScreen — one set of mouse and keyboard methods for every version
  • DynamicImage — textures created at runtime

常见问题

CotiiUILib 支持哪些 Minecraft 版本?

CotiiUILib 支持 Minecraft Java 版 1.20.1–26.3,共 9 个版本,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

CotiiUILib 怎么安装?

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

评论

登录后评论和评分

Cotii_ 的其他作品

查看全部 →