public class CustomGUI extends Object implements com.mindlin.clientBridge.api.JSONifiable
| Modifier and Type | Field and Description |
|---|---|
ArrayList<com.mindlin.clientBridge.api.DrawCommand> |
backgroundCommands
A list of DrawCommands that are drawn first.
|
static HashMap<String,CustomGUI> |
clientRegister
Map of registered GUIs.
|
ArrayList<com.mindlin.clientBridge.api.GuiButton> |
controlList
Deprecated.
|
ArrayList<com.mindlin.clientBridge.api.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
|
com.mindlin.clientBridge.api.ServerInterface |
serverInterface
Server interface of GUI.
|
| Constructor and Description |
|---|
CustomGUI() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(com.mindlin.clientBridge.api.GUIListener handler) |
boolean |
build(org.json.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(com.mindlin.clientBridge.api.event.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.
|
com.mindlin.clientBridge.api.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.
|
static org.json.JSONArray |
produceIntList(int length) |
void |
register() |
static void |
register(CustomGUI gui,
String name)
Registeres gui with to string name.
Puts gui into clientRegister |
org.json.JSONObject |
serialize(boolean compress)
Serialization, as specified in
JSONifiable.serialize(boolean) |
static void |
showGui(int index,
com.mindlin.clientBridge.api.BridgePlayer player)
Shows a guiof given index to BridgePlayer p.
|
static void |
showGui(String name,
com.mindlin.clientBridge.api.BridgePlayer player)
Shows a registered GUI of given name to BridgePlayer p.
|
org.json.JSONObject |
toJSON()
Deprecated.
|
public static HashMap<String,CustomGUI> clientRegister
public static int lastIndex
public ArrayList<com.mindlin.clientBridge.api.DrawCommand> backgroundCommands
public ArrayList<com.mindlin.clientBridge.api.DrawCommand> initCommands
@Deprecated public ArrayList<com.mindlin.clientBridge.api.GuiButton> controlList
public com.mindlin.clientBridge.api.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, com.mindlin.clientBridge.api.BridgePlayer player)
name - player - public static void showGui(int index,
com.mindlin.clientBridge.api.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 com.mindlin.clientBridge.api.GuiButton getButtonById(int id)
@Deprecated public org.json.JSONObject toJSON()
serialize(boolean)serialize(boolean)public boolean build(String s)
com.mindlin.clientBridge.api.JSONifiablebuild in interface com.mindlin.clientBridge.api.JSONifiables - (JSON string from serialize())public boolean build(org.json.JSONObject json)
build in interface com.mindlin.clientBridge.api.JSONifiablepublic org.json.JSONObject serialize(boolean compress)
JSONifiable.serialize(boolean)serialize in interface com.mindlin.clientBridge.api.JSONifiablecompress - public static org.json.JSONArray produceIntList(int length)
public void addEventListener(com.mindlin.clientBridge.api.GUIListener handler)
public void callEvent(com.mindlin.clientBridge.api.event.ClientGuiEvent ev)