moapi.gui
Class Slider

java.lang.Object
  extended by net.minecraft.src.Gui
      extended by net.minecraft.src.GuiButton
          extended by moapi.gui.Slider

public class Slider
extends net.minecraft.src.GuiButton

A replacement for the default MC Slider.

Since:
0.5

Field Summary
 boolean dragging
           
 
Fields inherited from class net.minecraft.src.GuiButton
displayString, drawButton, enabled, height, id, width, xPosition, yPosition
 
Fields inherited from class net.minecraft.src.Gui
zLevel
 
Constructor Summary
Slider(int i, int j, int k, ModSliderOption op, GuiController gui, boolean worldMode)
          Construct a gui slider
 
Method Summary
 boolean altMousePressed(net.minecraft.client.Minecraft minecraft, int i, int j, boolean rightClick)
          Alternate Mouse press action to avoid issues with the obfuscator and to allow right click checks
protected  int getHoverState(boolean flag)
           
 java.lang.String getName()
          Return the name for this slider button
protected  void mouseDragged(net.minecraft.client.Minecraft minecraft, int i, int j)
          Perform action on mouse drag
 boolean mousePressed(net.minecraft.client.Minecraft minecraft, int i, int j)
          Mouse press action
 void mouseReleased(int i, int j)
           
 void setWide(boolean wide)
          Set this slider to "wide" mode
 void updateDisplayString()
          Update the display string
 
Methods inherited from class net.minecraft.src.GuiButton
drawButton
 
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

dragging

public boolean dragging
Constructor Detail

Slider

public Slider(int i,
              int j,
              int k,
              ModSliderOption op,
              GuiController gui,
              boolean worldMode)
Construct a gui slider

Parameters:
op - Option Object this represents
gui - Gui representing this object
worldMode - True when using world values
Method Detail

getName

public java.lang.String getName()
Return the name for this slider button

Returns:
Slider name

setWide

public void setWide(boolean wide)
Set this slider to "wide" mode

Parameters:
wide - Whether to be wide or not

mouseDragged

protected void mouseDragged(net.minecraft.client.Minecraft minecraft,
                            int i,
                            int j)
Perform action on mouse drag

Overrides:
mouseDragged in class net.minecraft.src.GuiButton
Parameters:
minecraft - Game instance
i - x position of drag end
j - y position of drag end

altMousePressed

public boolean altMousePressed(net.minecraft.client.Minecraft minecraft,
                               int i,
                               int j,
                               boolean rightClick)
Alternate Mouse press action to avoid issues with the obfuscator and to allow right click checks

Parameters:
minecraft - Game instance
i - x position of click
j - y position of click
rightClick - True if a right click
Returns:
Keep changes

mousePressed

public boolean mousePressed(net.minecraft.client.Minecraft minecraft,
                            int i,
                            int j)
Mouse press action

Overrides:
mousePressed in class net.minecraft.src.GuiButton
Parameters:
minecraft - Game instance
i - x position of click
j - y position of click
Returns:
Keep changes

updateDisplayString

public void updateDisplayString()
Update the display string


mouseReleased

public void mouseReleased(int i,
                          int j)
Overrides:
mouseReleased in class net.minecraft.src.GuiButton

getHoverState

protected int getHoverState(boolean flag)
Overrides:
getHoverState in class net.minecraft.src.GuiButton