moapi.gui
Class ModMenu

java.lang.Object
  extended by net.minecraft.src.Gui
      extended by net.minecraft.src.GuiScreen
          extended by moapi.gui.ModMenu

public class ModMenu
extends net.minecraft.src.GuiScreen

A scrollable screen for modoptionsapi

Since:
0.6

Field Summary
protected  net.minecraft.src.GuiButton curButton
          Currently selected button
protected  java.lang.String screenTitle
          Title of this menu
 
Fields inherited from class net.minecraft.src.GuiScreen
allowUserInput, controlList, fontRenderer, guiParticles, height, mc, width
 
Fields inherited from class net.minecraft.src.Gui
zLevel
 
Constructor Summary
ModMenu(net.minecraft.src.GuiIngameMenu guiscreen, java.lang.String name, boolean mult)
          Initialise world options menu with a named world
ModMenu(net.minecraft.src.GuiScreen guiscreen)
          Initilise options menu gui screen
ModMenu(net.minecraft.src.GuiScreen guiscreen, ModOptions options)
          Initialise a particular set of options gui
ModMenu(net.minecraft.src.GuiScreen guiscreen, ModOptions options, java.lang.String name, boolean multi)
          Initialise a particular set of options gui
 
Method Summary
protected  void actionPerformed(net.minecraft.src.GuiButton guibutton)
          Mouse has left clicked the given button
protected  void altActionPerformed(net.minecraft.src.GuiButton guibutton)
          Button right clicked on the given button
protected  boolean buttonPressed(net.minecraft.src.GuiButton btn, int i, int j)
          Check if a button has been pressed
protected  boolean buttonPressed(net.minecraft.src.GuiButton btn, int i, int j, boolean rightClick)
          Check if a button has been pressed
 void changeScreen(net.minecraft.src.GuiScreen screen)
          Change the screen and perform cleanup actions
 void drawScreen(int i, int j, float f)
          Draw our slider based options screen
 void initGui()
           
protected  void keyTyped(char c, int i)
          Ensures that when escape is pressed that the changed options are saved.
protected  void mouseClicked(int i, int j, int k)
          Control the mouse clicks so that we can let right click turn on "global" mode
protected  void mouseMovedOrUp(int i, int j, int k)
          More control over the mouse Called when mouse is unclicked
 void updateScreen()
          What to do on screen updates
 
Methods inherited from class net.minecraft.src.GuiScreen
confirmClicked, doesGuiPauseGame, drawBackground, drawDefaultBackground, drawWorldBackground, getClipboardString, handleInput, handleKeyboardInput, handleMouseInput, isCtrlKeyDown, isShiftKeyDown, onGuiClosed, setClipboardString, setWorldAndResolution
 
Methods inherited from class net.minecraft.src.Gui
drawCenteredString, drawGradientRect, drawHorizontalLine, drawRect, drawString, drawTexturedModalRect, drawVerticalLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

curButton

protected net.minecraft.src.GuiButton curButton
Currently selected button


screenTitle

protected java.lang.String screenTitle
Title of this menu

Constructor Detail

ModMenu

public ModMenu(net.minecraft.src.GuiScreen guiscreen)
Initilise options menu gui screen


ModMenu

public ModMenu(net.minecraft.src.GuiIngameMenu guiscreen,
               java.lang.String name,
               boolean mult)
Initialise world options menu with a named world


ModMenu

public ModMenu(net.minecraft.src.GuiScreen guiscreen,
               ModOptions options,
               java.lang.String name,
               boolean multi)
Initialise a particular set of options gui

Parameters:
name - Name of world loaded
multi - True if in a multiplayer world

ModMenu

public ModMenu(net.minecraft.src.GuiScreen guiscreen,
               ModOptions options)
Initialise a particular set of options gui

Method Detail

initGui

public void initGui()
Overrides:
initGui in class net.minecraft.src.GuiScreen

drawScreen

public void drawScreen(int i,
                       int j,
                       float f)
Draw our slider based options screen

Overrides:
drawScreen in class net.minecraft.src.GuiScreen

mouseClicked

protected void mouseClicked(int i,
                            int j,
                            int k)
Control the mouse clicks so that we can let right click turn on "global" mode

Overrides:
mouseClicked in class net.minecraft.src.GuiScreen
Parameters:
i - x pos
j - y pos
k - 1 for right click, 0 for left

keyTyped

protected void keyTyped(char c,
                        int i)
Ensures that when escape is pressed that the changed options are saved.

Overrides:
keyTyped in class net.minecraft.src.GuiScreen

actionPerformed

protected void actionPerformed(net.minecraft.src.GuiButton guibutton)
Mouse has left clicked the given button

Overrides:
actionPerformed in class net.minecraft.src.GuiScreen
Parameters:
guibutton - Button left clicked

altActionPerformed

protected void altActionPerformed(net.minecraft.src.GuiButton guibutton)
Button right clicked on the given button

Parameters:
guibutton - button pressed

mouseMovedOrUp

protected void mouseMovedOrUp(int i,
                              int j,
                              int k)
More control over the mouse Called when mouse is unclicked

Overrides:
mouseMovedOrUp in class net.minecraft.src.GuiScreen
Parameters:
i - x pos
j - y pos
k - 1 for right click, 0 for left

updateScreen

public void updateScreen()
What to do on screen updates

Overrides:
updateScreen in class net.minecraft.src.GuiScreen

changeScreen

public void changeScreen(net.minecraft.src.GuiScreen screen)
Change the screen and perform cleanup actions

Parameters:
screen -

buttonPressed

protected boolean buttonPressed(net.minecraft.src.GuiButton btn,
                                int i,
                                int j)
Check if a button has been pressed

Parameters:
btn - Button
Returns:
true if pressed

buttonPressed

protected boolean buttonPressed(net.minecraft.src.GuiButton btn,
                                int i,
                                int j,
                                boolean rightClick)
Check if a button has been pressed

Parameters:
btn - Button
rightClick - True if right click
Returns:
true if pressed