public class Console extends java.lang.Object implements CommandsInterface
Constructor and Description |
---|
Console(com.badlogic.gdx.scenes.scene2d.ui.Skin skin,
int xPos,
int yPos) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String message)
Adds a message with the sender "System"
|
void |
add(java.lang.String message,
java.lang.String sender) |
void |
add(java.lang.String message,
java.lang.String sender,
int importance) |
void |
autoSuggestion()
suggests a cvar
|
void |
enter()
when a message is entered
|
boolean |
executeCommand(java.lang.String command)
Tries executing a command.
|
java.lang.String |
getLastMessage()
Returns the last Message
|
java.lang.String |
getLastMessage(java.lang.String sender)
Returns the last Message
|
boolean |
isActive()
Is the window open?
|
void |
setCustomCommands(CommandsInterface externalCommands)
Set the factory for custom commands for delegation.
|
void |
setGameplayRef(GameplayScreen gameplayRef)
the gameplay on which the commands are executed
|
void |
setText(java.lang.String text)
Set the text in the box.
|
void |
update(float dt)
Updates the Message System.
|
public Console(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, int xPos, int yPos)
skin
- xPos
- yPos
- public void setGameplayRef(GameplayScreen gameplayRef)
CommandsInterface
setGameplayRef
in interface CommandsInterface
gameplayRef
- public void add(java.lang.String message)
message
- public void add(java.lang.String message, java.lang.String sender)
message
- sender
- public void add(java.lang.String message, java.lang.String sender, int importance)
message
- sender
- importance
- public void update(float dt)
dt
- time in mspublic void enter()
public boolean isActive()
public java.lang.String getLastMessage()
public java.lang.String getLastMessage(java.lang.String sender)
sender
- filter by the sender, e.g. if you want the last message of a specific playerpublic void setText(java.lang.String text)
text
- public void autoSuggestion()
public void setCustomCommands(CommandsInterface externalCommands)
externalCommands
- public boolean executeCommand(java.lang.String command)
executeCommand
in interface CommandsInterface
command
-