ModernUI Flag Support

ModernUI Flag Support extends Modern UI with client-side rendering of country/region flags.

Modern UI Flag Support

Overview

Modern UI Flag Support is a pure client-side patch mod for Modern UI that primarily solves the issue of flag emojis not rendering correctly.

When using Modern UI, flags don't display as complete flags but instead show as letter combinations like HK, US, CN, etc. This mod provides a simple TOML configuration entry point, allowing players or modpack authors to manually declare which flag sequences need to be supported.

The mod itself does not include a built-in flag atlas, nor does it automatically generate flag images. It only handles making Modern UI recognize these combined emojis; the actual flag PNGs used for display still need to be provided through a resource pack.


How to Use

Prepare a resource pack and place flag PNGs at:

assets/modernui/emoji/

For example:

assets/modernui/emoji/1f1ed_1f1f0.png
assets/modernui/emoji/1f1fa_1f1f8.png
assets/modernui/emoji/1f1e8_1f1f3.png

Then edit the client configuration file:

config/muifs-client.toml

Write the flags you want to enable:

flags = [
    "1f1ed_1f1f0",
    "1f1fa_1f1f8",
    "1f1e8_1f1f3"
]

The .png suffix is optional in the config. As long as the config entries match the PNG filenames in the resource pack, they will load correctly.

If you modify the configuration or resource pack while the game is running, you need to reload resources. If everything is prepared before launching, it will take effect automatically upon entering the game.


How to Get Flag and Country/Region Codes

Flag emojis typically consist of two regional indicator code points. You can obtain them through Unicode lookup websites, emoji code point tools, or by searching for "flag emoji codepoint" for a specific country/region.

Common examples:

Flag Code Points Filename
🇺🇸 U+1F1FA U+1F1F8 1f1fa_1f1f8.png
🇨🇳 U+1F1E8 U+1F1F3 1f1e8_1f1f3.png
🇯🇵 U+1F1EF U+1F1F5 1f1ef_1f1f5.png

When writing filenames, remove the U+ prefix, convert to lowercase, and join with an underscore _.


Important Notes

Images must be 72×72 PNGs. If the dimensions are incorrect, Modern UI may not load the image, and it will appear as if the configuration didn't take effect.

Additionally, individual regional indicator images and combined flag images are not the same thing. Modern UI may already have these files:

1f1ed.png
1f1f0.png

But that will only display two separate regional indicators, similar to "HK". If you want to display a complete Regional Flag of the Hong Kong Special Administrative Region, you need:

1f1ed_1f1f0.png

In short: Whatever you write in the TOML config must have a corresponding 72×72 PNG with the same name in your resource pack. When both match up, Modern UI can combine the two regional indicators into a real flag.

Modern UI Flag Support

概述

Modern UI Flag Support 是一个用于 Modern UI 的纯客户端补丁模组,主要解决国旗 emoji 无法被正确渲染的问题。

在使用 Modern UI 时,国旗不会显示成完整旗帜,而是显示成类似 HK、US、CN 这样的字母组合。这个模组提供了一个简单的 TOML 配置入口,让玩家或整合包作者可以手动声明需要支持的国旗序列。

模组本身不内置完整国旗图集,也不会自动生成国旗图片。它只负责让 Modern UI 识别这些组合 emoji;实际显示用的国旗 PNG 仍然需要通过资源包提供。


使用方法

准备一个资源包,把国旗 PNG 放到:

assets/modernui/emoji/

例如:

assets/modernui/emoji/1f1ed_1f1f0.png
assets/modernui/emoji/1f1fa_1f1f8.png
assets/modernui/emoji/1f1e8_1f1f3.png

然后编辑客户端配置文件:

config/muifs-client.toml

把需要启用的国旗写进去:

flags = [
    "1f1ed_1f1f0",
    "1f1fa_1f1f8",
    "1f1e8_1f1f3"
]

配置项可以不写 .png 后缀。只要配置名称和资源包里的 PNG 文件名对应,就可以被加载。

如果是在游戏运行中修改了配置或资源包,需要重载资源;如果在启动前已经准备好,进游戏后会自动生效。


如何获得国旗和国家地区代码

国旗 emoji 通常由两个 regional indicator code point 组成。可以通过 Unicode 查询网站、emoji code point 工具,或者搜索"某个国家/地区 flag emoji codepoint"来获得。

常见例子:

旗帜 Code Points 文件名
🇺🇸 U+1F1FA U+1F1F8 1f1fa_1f1f8.png
🇨🇳 U+1F1E8 U+1F1F3 1f1e8_1f1f3.png
🇯🇵 U+1F1EF U+1F1F5 1f1ef_1f1f5.png

写文件名时,把 U+ 去掉,改成小写,然后用 _ 连接即可。


注意事项

图片必须是 72×72 的 PNG。尺寸不对的话,Modern UI 可能不会加载这张图,看起来就像配置没有生效。

另外,单个 regional indicator 图片和组合国旗图片不是一回事。Modern UI 可能已经有这些文件:

1f1ed.png
1f1f0.png

但这只能让它显示两个单独的 regional indicator,也就是类似 HK。如果想显示成完整的香港特别行政区旗,需要的是:

1f1ed_1f1f0.png

简单来说: TOML 配置里写什么,资源包里就要有同名的 72×72 PNG。两边对上,Modern UI 才能把两个 regional indicator 合成一面真正的国旗。

ModernUI Flag Support Team

profile avatar
  • 12
    Projects
  • 4.9K
    Downloads

More from xianyu_miaoView all