Skip to content

Commit

Permalink
Added support to override LiteLoader's key gui
Browse files Browse the repository at this point in the history
version update
  • Loading branch information
okushama committed Dec 10, 2013
1 parent 4129c9c commit 205ca49
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 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.2")
@Mod(modid = "notenoughkeys", name = "Not Enough Keys", version = "0.0.3")

public class NotEnoughKeys {

Expand Down
20 changes: 17 additions & 3 deletions okushama/nek/Ticker.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,29 @@
import cpw.mods.fml.common.TickType;

public class Ticker implements ITickHandler{


public boolean liteloaderExists = true;

@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
if(type.equals(EnumSet.of(TickType.CLIENT))){
if(liteloaderExists){
try {
Class liteloadergui = Class.forName("com.mumfrey.liteloader.gui.GuiControlsPaginated");
if(liteloadergui != null){
if(Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen.getClass().equals(liteloadergui)){
Minecraft.getMinecraft().displayGuiScreen(new GuiKeybindsMenu());
NotEnoughKeys.log("Replaced the instance of LiteLoader's controls gui!");
}
}
} catch (ClassNotFoundException e) {
liteloaderExists = false;
}
}
if(Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiControls){
//Minecraft.getMinecraft().displayGuiScreen(new GuiKeybinds("IndustrialCraft 2", Minecraft.getMinecraft().gameSettings));
//Minecraft.getMinecraft().displayGuiScreen(new GuiKeybinds("Minecraft", Minecraft.getMinecraft().gameSettings));
Minecraft.getMinecraft().displayGuiScreen(new GuiKeybindsMenu());
NotEnoughKeys.log("Replaced an instance of the controls gui!");
NotEnoughKeys.log("Replaced the instance of Minecraft controls gui!");
}
}
}
Expand Down

0 comments on commit 205ca49

Please sign in to comment.