Switch to Cloth Config
Changelog
New Features
- Cloth Config is now accessible
Feature Updates
- Cloth Config is now used for config
Holy cow 75 files... 😂
Make some of the cloth config widgets accessible:
the code responsible for all the widgets is in compat/mixin/clothconfig
its really just a case of reimplementing the vanilla methods responsible for making the widget keyboard focussable and narratable
here is the cloth config source https://github.com/shedaniel/cloth-config, iirc the net.minecraft.client.gui.Narratable interface is where all the magic happens
Too many conflicts, I suggest waiting for #399, and #393 to be merged, and rework it on HEAD... Like I said, adding and deleting files while the directory is invalid do cause problems...
I think it should still be safe to touch the Cloth Config specific stuff such as the mixins and new config class because these will just require a simple rename. As for everything else I think I'll just abandon my changes and start from scratch when I merge stuff in which I think I'll do quickly once #420 is merged, it's also possible that most of the conflicts are due to the package rename so I might be able to resolve those normally and only redo the files that have had significant changes.
@TheSuperGamer20578 So the goal is making all the classes under me.shedaniel.clothconfig2.gui package narratable, right?
Currently tracing: how to remove the color char ahead of "Yes" and "No" button text when narrating them (keep the color on GUI). The text is from lang file of cloth-config: https://github.com/shedaniel/cloth-config/blob/a7639ae802bb1d0cdb8a49213b17bf141739ddc5/common/src/main/resources/assets/cloth-config2/lang/en_us.json#L33-L34
"text.cloth-config.boolean.value.true": "§aYes",
"text.cloth-config.boolean.value.false": "§cNo",
Looking for the position that this text is registered as narration text... ScreenNarrator.buildNarratorText ->ScreenNarrator.Message -> net.minecraft.client.gui.screen.narration.Narration bingo. No, not bingo, can't catch the position of the init of "§aYes" narration with breakpoint, maybe set breakpoint in wrong jar.
@TheSuperGamer20578 So the goal is making all the classes under
me.shedaniel.clothconfig2.guipackage narratable, right?
Yes, or at least everything that autoconfig and thus our config uses. BTW if you haven't already noticed I added a modmenu entrypoint which allows us to get to the config menu without loading up a world, you can also access cloth's example config from there which uses some more exotic widgets.
It seems that only two things are left:
- make
SubCategoryListEntrynavigable - suppress "edit box:" prefix of narration of
SearchFieldEntry.EditBox
Note: configuration file has been changed from config/minecraft-access/config.json to config/minecraft-access.json
I decide to create yet another PR just for doc, I'll do it now. @TheSuperGamer20578 This PR can't be assigned to you for reviewing so... take a look at the code. I have checked all config-invoking code (barely replacing the api) so maybe you can only focus on the cloth config patch part, the new classes.
There are two dependency questions and one code opinion waiting for @TheSuperGamer20578 to answer... see the comments in "17 hidden items"