Skip to content

Commit

Permalink
Added "All" category
Browse files Browse the repository at this point in the history
essentially is the original binds menu, just in-case for whatever reason
certain mods' binds don't get picked up (Smart Moving, i'm looking at
you!)
  • Loading branch information
okushama committed Dec 12, 2013
1 parent 205ca49 commit dfba661
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
14 changes: 14 additions & 0 deletions okushama/nek/GuiControlsOverride.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package okushama.nek;

import net.minecraft.client.gui.GuiControls;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.settings.GameSettings;

public class GuiControlsOverride extends GuiControls{

public GuiControlsOverride(GuiScreen par1GuiScreen,
GameSettings par2GameSettings) {
super(par1GuiScreen, par2GameSettings);
}

}
10 changes: 9 additions & 1 deletion okushama/nek/GuiKeybindsScrollPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ protected void elementClicked(int i, boolean flag)
{
selected = i;
}
Minecraft.getMinecraft().sndManager.playSoundFX("random.click", 1.0F, 1.0F);
String type = buttonNames[selected];
if(type.equalsIgnoreCase("all")){
Minecraft.getMinecraft().sndManager.playSoundFX("random.click", 1.0F, 1.0F);
Minecraft.getMinecraft().displayGuiScreen(new GuiControlsOverride(controls, Minecraft.getMinecraft().gameSettings));
KeybindTracker.updateConflictCategory();
selected = -1;
return;
}

Minecraft.getMinecraft().sndManager.playSoundFX("random.click", 1.0F, 1.0F);
Minecraft.getMinecraft().displayGuiScreen(new GuiSubKeybindsMenu(controls, type, KeybindTracker.modKeybinds.get(type).toArray(new KeyBinding[0]),Minecraft.getMinecraft().gameSettings));
KeybindTracker.updateConflictCategory();
selected = -1;
Expand Down
3 changes: 2 additions & 1 deletion okushama/nek/NotEnoughKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;

@Mod(modid = "notenoughkeys", name = "Not Enough Keys", version = "0.0.3")
@Mod(modid = "notenoughkeys", name = "Not Enough Keys", version = "0.0.4")

public class NotEnoughKeys {

Expand All @@ -31,6 +31,7 @@ public class NotEnoughKeys {
@EventHandler
public static void preInit(FMLPreInitializationEvent event) {
if(event.getSide() == Side.CLIENT){
KeybindTracker.modKeybinds.put("All", new ArrayList<KeyBinding>());
ArrayList<KeyBinding> vanillaKeys = new ArrayList<KeyBinding>();
for(KeyBinding kb : Minecraft.getMinecraft().gameSettings.keyBindings){
vanillaKeys.add(kb);
Expand Down
3 changes: 2 additions & 1 deletion okushama/nek/Ticker.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public void tickStart(EnumSet<TickType> type, Object... tickData) {
liteloaderExists = false;
}
}
if(Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiControls){
if(Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiControls
&& !(Minecraft.getMinecraft().currentScreen instanceof GuiControlsOverride)){
Minecraft.getMinecraft().displayGuiScreen(new GuiKeybindsMenu());
NotEnoughKeys.log("Replaced the instance of Minecraft controls gui!");
}
Expand Down

0 comments on commit dfba661

Please sign in to comment.