Option to define the category of a key binding

Published by Yanis48 on Thu, 11/15/2018 - 18:48
Status
Outdated
Product/platform
Not applicable
Priority
Normal
Issue description

Currently, all the key bindings you define are in the Miscellaneous category on the Controls menu.

I think it would be nice to choose the category we want, and even add new ones.

public KeyHandler() {
	keys = new KeyBinding("key.mcreator.foobar", Keyboard.KEY_FOOBAR, "key.categories.misc");
	ClientRegistry.registerKeyBinding(keys);
}

The category is defined with the 3rd argument. You can change it to another Minecraft category, and if it doesn't exist in vanilla, it will count it as a new category.

Issue comments

@Override
	@OnlyIn(Dist.CLIENT)
	public void initElements() {
		keys = new KeyBinding("key.mcreator.spellsguikey", GLFW.GLFW_KEY_G, "key.categories.spells");
		ClientRegistry.registerKeyBinding(keys);
		MinecraftForge.EVENT_BUS.register(this);
	}

In the third argument ("key.categories.spells"), we have only to change the third part(spells, but without change, it's .misc), and after take the key.categories.categoriename, and add it like a new localization entry. it's very easy to do. Why don't you add this?



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.