public class CustomGUI extends Object implements JSONifiable
| Modifier and Type | Field and Description |
|---|---|
ArrayList<DrawCommand> |
backgroundCommands
A list of DrawCommands that are drawn first.
|
static HashMap<String,CustomGUI> |
clientRegister
Map of registered GUIs.
|
ArrayList<GuiButton> |
controlList
Deprecated.
|
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 HashMap<Integer,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 |
|---|---|
void |
addEventListener(GUIListener handler) |
boolean |
build(JSONObject json) |
boolean |
build(String s)
Build itself such that for Object o that implements JSONifiable, the following
conditions will be true:
o.build(o.serialize(false))==o o.build(o.serialize(true))==o |
void |
callEvent(ClientGuiEvent ev) |
static CustomGUI |
getActiveGUI(int index)
Returns the gui given its GUI_ID
Nonexistent GUIs return false;
Only retrieves registered guis.
|
static CustomGUI |
getActiveGUI(String name)
Returns the gui, given its name.
|
GuiButton |
getButtonById(int id)
Deprecated.
|
static CustomGUI |
getGUI(String name)
Returns a GUI, given its name.
|
int |
getIndex()
Returns the GUI_ID.
|
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(String name)
Returns whether the given name is registered.
|
void |
log(String s)
Logs s to console.
|
void |
register() |
static void |
register(CustomGUI gui,
String name)
Registeres gui with to string name.
Puts gui into clientRegister |
JSONObject |
serialize(boolean compress)
Serialization, as specified in
JSONifiable.serialize(boolean) |
static void |
showGui(int index,
BridgePlayer player)
Shows a guiof given index to BridgePlayer p.
|
static void |
showGui(String name,
BridgePlayer player)
Shows a registered GUI of given name to BridgePlayer p.
|
JSONObject |
toJSON()
Deprecated.
|
public static HashMap<String,CustomGUI> clientRegister
public static int lastIndex
public ArrayList<DrawCommand> backgroundCommands
public ArrayList<DrawCommand> initCommands
@Deprecated public ArrayList<GuiButton> controlList
public ServerInterface serverInterface
public static CustomGUI getGUI(String name)
name - public static boolean isRegistered(String name)
name - public static boolean isRegistered(int index)
index - public static void register(CustomGUI gui, String name)
gui - name - public static void showGui(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(String name)
name - public void register()
public String getName()
public int getIndex()
public void log(String s)
s - public void initGui()
@Deprecated public GuiButton getButtonById(int id)
@Deprecated public JSONObject toJSON()
serialize(boolean)serialize(boolean)public boolean build(String s)
JSONifiablebuild in interface JSONifiables - (JSON string from serialize())public boolean build(JSONObject json)
build in interface JSONifiablepublic JSONObject serialize(boolean compress)
JSONifiable.serialize(boolean)serialize in interface JSONifiablecompress - public void addEventListener(GUIListener handler)
public void callEvent(ClientGuiEvent ev)