Search in sources :

Example 1 with VolumeControlGui

use of org.blockartistry.DynSurround.client.gui.VolumeControlGui in project DynamicSurroundings by OreCruncher.

the class KeyHandler method onKeyboard.

@SubscribeEvent(receiveCanceled = false)
public static void onKeyboard(@Nonnull InputEvent.KeyInputEvent event) {
    if (shouldHandle(SELECTIONBOX_KEY)) {
        final EntityRenderer renderer = Minecraft.getMinecraft().entityRenderer;
        final boolean result = !EntityRendererUtil.getDrawBlockOutline(renderer);
        EntityRendererUtil.setDrawBlockOutline(renderer, result);
        sendPlayerMessage("dsurround.cfg.keybind.msg.Fencing", getOnOff(result));
    }
    if (shouldHandle(VOLUME_KEY) && Minecraft.getMinecraft().currentScreen == null) {
        final VolumeControlGui gui = new VolumeControlGui();
        Minecraft.getMinecraft().displayGuiScreen(gui);
    }
    if (shouldHandle(CHUNKBORDER_KEY)) {
        final boolean result = Minecraft.getMinecraft().debugRenderer.toggleChunkBorders();
        sendPlayerMessage("dsurround.cfg.keybind.msg.ChunkBorder", getOnOff(result));
    }
    if (shouldHandle(LIGHTLEVEL_KEY)) {
        if (GuiScreen.isCtrlKeyDown()) {
            // Only change mode when visible
            if (LightLevelHUD.showHUD) {
                ModOptions.lightlevel.llDisplayMode++;
                if (ModOptions.lightlevel.llDisplayMode >= Mode.values().length)
                    ModOptions.lightlevel.llDisplayMode = 0;
                sendPlayerMessage("dsurround.cfg.keybind.msg.LLDisplayMode", Mode.getMode(ModOptions.lightlevel.llDisplayMode).name());
            }
        } else if (GuiScreen.isShiftKeyDown()) {
            if (LightLevelHUD.showHUD) {
                ModOptions.lightlevel.llHideSafe = !ModOptions.lightlevel.llHideSafe;
                sendPlayerMessage("dsurround.cfg.keybind.msg.LLSafeBlocks", getOnOff(ModOptions.lightlevel.llHideSafe));
            }
        } else {
            LightLevelHUD.showHUD = !LightLevelHUD.showHUD;
            sendPlayerMessage("dsurround.cfg.keybind.msg.LLDisplay", getOnOff(LightLevelHUD.showHUD));
        }
    }
}
Also used : VolumeControlGui(org.blockartistry.DynSurround.client.gui.VolumeControlGui) EntityRenderer(net.minecraft.client.renderer.EntityRenderer) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

EntityRenderer (net.minecraft.client.renderer.EntityRenderer)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 VolumeControlGui (org.blockartistry.DynSurround.client.gui.VolumeControlGui)1