Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Settings GUI #166

Open
ZekerZhayard opened this issue May 13, 2021 · 2 comments
Open

[Feature] Settings GUI #166

ZekerZhayard opened this issue May 13, 2021 · 2 comments

Comments

@ZekerZhayard
Copy link
Collaborator

由来

目前大多数存在设置需求的 Mod 都拥有游戏内图形化的设置界面,但是 CustomSkinLoader 由于兼容性原因不提供相关的界面,无疑增加了新手修改配置的门槛。尽管现在已经有 @g-plane 制作的图形化设置网站 https://mc-csl.netlify.app/ ,但是仍然存在需要手动导入并导出配置文件、修改后需要重启游戏等缺陷,并且可能由于宣传问题,不少人不知道有这个地址。因此制作一个游戏内的设置界面迫在眉睫。

想法

  • 由于 CustomSkinLoader 本体需要维持相当恐怖的兼容性,因此直接把设置界面实现在本体中有极大困难,因此需要重新设计一套接口,本体提供一个默认实现,功能特性基本不变,另外再新写一个只兼容单个 Minecraft 版本的 Mod 实现这套接口以支持设置界面。
  • 这套接口有一个可参考的例子 IFMLPlatform ,此接口设计时 1.7.10 在国内仍然拥有一定热度,但是由于 1.8 之后支持双层皮肤,而且 Forge 1.8 的 FML 部分包名全部改变,所以 CustomSkinLoader 本体不大可能再次兼容 1.7.10,因此将本体调用 FML 的部分抽象出来形成一个接口,再由本体提供 Forge 1.8~1.12.2 的实现,然后由 CompatibilityLayerForCustomSkinLoader 提供 Forge 1.7.10 的实现,以达到 CustomSkinLoader 兼容 1.7.10 的目的。
  • 此配置接口与 IFMLPlatform 有些许不同,IFMLPlatform 不允许同时存在两个或以上的有效实现(通过 IFMLPlatform#init 控制,存在的理由是显然的),而配置接口不同,当本体更新且新增配置项时,如果配套 Mod 不及时更新,或玩家使用了旧版的配套 Mod ,可能会出现 AbstractMethodError 之类的,因此想法是给所有实现类进行优先级排序,当更高级的配置接口不存在方法实现时,能调用低级的实现方法。
  • 根据 cpw 对 Forge 使用率的统计,目前 Forge 1.12.x 和 1.16.x 的使用量占到了 68%,因此这个扩展 Mod 目前仅打算基于 Forge-1.12.2,Forge-1.16.5,Fabric-1.16.5 实现(未来可能会实现基于 Forge-1.7.10 和 Forge-1.8.9 的版本)。
  • 由于 CustomSkinLoader 使用 Json 作为配置文件格式,Forge 本体提供的配置文件工具类不能很好地适配,并且 Fabric API 没有提供配置文件相关的 API,因此 Forge/Fabric-1.16.5 可能会基于 Cloth Config API 实现,Forge-1.12.2 可能会基于 Configuration 实现。
@xfl03
Copy link
Owner

xfl03 commented May 14, 2021

  • Forge 1.7.10,直接做进 CompatibilityLayerForCustomSkinLoader
  • Forge 1.12.2、1.16.5,可以制作独立的配置Mod
  • Fabric-1.16.5,建议和Forge 1.12.2、1.16.5制作同一个Mod,仅提供不同API的支持

@8MiYile
Copy link
Contributor

8MiYile commented Jan 30, 2023

这东西做出来应该得用独立mod 以CSL为前置 那干脆叫CSL-GUI吧(逃)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants