Tips

Tips

39M Downloads

[Suggestion] Add the ability to disable tips for certain screens

lumiscosity opened this issue ยท 3 comments

commented

See title.

commented

I was just about to comment this suggestion, I would love to have tips only on the loading screens and not pause screens

commented

This is a pretty complicated feature to add as screens do not have unique names or identifiers that users can reliably target. Mods with similar features use the class name of the screen but these are not consistent across mod loaders which can be confusing. They are also not visible to players or well documented. I've tried my best to implement this on 1.20.4 but plan to do this better when Mojang finally adds screen IDs.

To use this feature, you need to add the canonical name of the class to the ignoredScreens section of the config file. The canonical name for your modloader and environment will be printed to the log when tips entries are loaded. It will also show if the entry has been disabled by your config file. You can get this for 1.20.4 in version 15.0.4.

Example

NOTE: The screen names here are from development. While there may be some overlap you should always check the names for yourself by looking at your log file. Do not blindly trust these screen names.

tips.json

{
  "defaultCycleTime": 5000,
  "ignoredNamespaces": [],
  "ignoredTips": [],
  "ignoredScreens": [
    "net.minecraft.client.gui.screens.DeathScreen",
    "net.minecraft.client.gui.screens.PauseScreen"
  ]
}

latest.log

[19:31:36] [Render thread/INFO] [Tips/]: Loaded 81 tips. Took 4.4692ms.
[19:31:36] [Render thread/INFO] [Tips/]: The following screens have been registered to the tips mod.
[19:31:36] [Render thread/INFO] [Tips/]: Screen: 'net.minecraft.client.gui.screens.DisconnectedScreen' Enabled: 'true'
[19:31:36] [Render thread/INFO] [Tips/]: Screen: 'net.minecraft.client.gui.screens.LevelLoadingScreen' Enabled: 'true'
[19:31:36] [Render thread/INFO] [Tips/]: Screen: 'net.minecraft.client.gui.screens.PauseScreen' Enabled: 'false'
[19:31:36] [Render thread/INFO] [Tips/]: Screen: 'net.minecraft.client.gui.screens.ConnectScreen' Enabled: 'true'
[19:31:36] [Render thread/INFO] [Tips/]: Screen: 'net.minecraft.client.gui.screens.ProgressScreen' Enabled: 'true'
[19:31:36] [Render thread/INFO] [Tips/]: Screen: 'net.minecraft.client.gui.screens.DeathScreen' Enabled: 'false'
[19:31:36] [Render thread/INFO] [Tips/]: Screen: 'net.minecraft.client.gui.screens.GenericDirtMessageScreen' Enabled: 'true'
commented

hello sorry if I asked but will these 1.20.4 changes be backported to 1.20.1?