minecraft-access icon indicating copy to clipboard operation
minecraft-access copied to clipboard

Switch to Cloth Config

Open TheSuperGamer20578 opened this issue 1 year ago • 1 comments

Changelog

New Features

  • Cloth Config is now accessible

Feature Updates

  • Cloth Config is now used for config

TheSuperGamer20578 avatar Oct 02 '24 10:10 TheSuperGamer20578

Holy cow 75 files... 😂

boholder avatar Oct 02 '24 11:10 boholder

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

boholder avatar Dec 28 '24 04:12 boholder

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...

boholder avatar Dec 29 '24 05:12 boholder

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 avatar Dec 29 '24 22:12 TheSuperGamer20578

@TheSuperGamer20578 So the goal is making all the classes under me.shedaniel.clothconfig2.gui package narratable, right?

boholder avatar Jan 01 '25 11:01 boholder

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.

boholder avatar Jan 01 '25 13:01 boholder

@TheSuperGamer20578 So the goal is making all the classes under me.shedaniel.clothconfig2.gui package 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.

TheSuperGamer20578 avatar Jan 01 '25 20:01 TheSuperGamer20578

It seems that only two things are left:

  • make SubCategoryListEntry navigable
  • suppress "edit box:" prefix of narration of SearchFieldEntry.EditBox

boholder avatar Jan 19 '25 13:01 boholder

Note: configuration file has been changed from config/minecraft-access/config.json to config/minecraft-access.json

boholder avatar Feb 20 '25 07:02 boholder

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.

boholder avatar Feb 27 '25 01:02 boholder

There are two dependency questions and one code opinion waiting for @TheSuperGamer20578 to answer... see the comments in "17 hidden items"

boholder avatar Mar 16 '25 06:03 boholder