public class CustomGUI
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.util.ArrayList<DrawCommand> |
backgroundCommands
A list of DrawCommands that are drawn first.
|
static java.util.HashMap<java.lang.String,CustomGUI> |
clientRegister
Map of registered GUIs.
|
java.util.ArrayList<GuiButton> |
controlList
Deprecated.
|
java.util.ArrayList<DrawCommand> |
initCommands
A list of DrawCommands that are drawn second.
|
static int |
lastIndex
Integer that stores the last GUI_ID, to prevent mismatches
|
static java.util.HashMap<java.lang.Integer,java.lang.String> |
registerIndex
Map of GUI_ID to GUI names
|
ServerInterface |
serverInterface
Server interface of GUI.
|
| Constructor and Description |
|---|
CustomGUI() |
| Modifier and Type | Method and Description |
|---|---|
static CustomGUI |
getActiveGUI(int index)
Returns the gui given its GUI_ID
Nonexistent GUIs return false;
Only retrieves registered guis.
|
static CustomGUI |
getActiveGUI(java.lang.String name)
Returns the gui, given its name.
|
GuiButton |
getButtonById(int id)
Deprecated.
|
static CustomGUI |
getGUI(java.lang.String name)
Returns a GUI, given its name.
|
int |
getIndex()
Returns the GUI_ID.
|
java.lang.String |
getName()
Returns the registered name of the GUI.
|
void |
initGui()
super commands
|
static boolean |
isRegistered(int index)
Returns whether the given index is registered.
|
static boolean |
isRegistered(java.lang.String name)
Returns whether the given name is registered.
|
void |
log(java.lang.String s)
Logs s to console.
|
void |
register() |
static void |
register(CustomGUI gui,
java.lang.String name)
Registeres gui with to string name.
Puts gui into clientRegister |
static void |
showGui(int index,
BridgePlayer player)
Shows a guiof given index to BridgePlayer p.
|
static void |
showGui(java.lang.String name,
BridgePlayer player)
Shows a registered GUI of given name to BridgePlayer p.
|
JSONObject |
toJSON()
Converts GUI into JSON object, to send to client.
|
public static java.util.HashMap<java.lang.String,CustomGUI> clientRegister
public static java.util.HashMap<java.lang.Integer,java.lang.String> registerIndex
public static int lastIndex
public java.util.ArrayList<DrawCommand> backgroundCommands
public java.util.ArrayList<DrawCommand> initCommands
@Deprecated public java.util.ArrayList<GuiButton> controlList
public ServerInterface serverInterface
public static CustomGUI getGUI(java.lang.String name)
name - public static boolean isRegistered(java.lang.String name)
name - public static boolean isRegistered(int index)
index - public static void register(CustomGUI gui, java.lang.String name)
gui - name - public static void showGui(java.lang.String name,
BridgePlayer player)
name - player - public static void showGui(int index,
BridgePlayer player)
index - player - public static CustomGUI getActiveGUI(int index)
index - public static CustomGUI getActiveGUI(java.lang.String name)
name - public void register()
public java.lang.String getName()
public int getIndex()
public void log(java.lang.String s)
s - public void initGui()
@Deprecated public GuiButton getButtonById(int id)
public JSONObject toJSON()