made webchat prefix to configurable

This commit is contained in:
Arthur Mayer 2011-05-31 23:10:16 +02:00
parent aa7d80407f
commit cd02926fb0
6 changed files with 6 additions and 4 deletions

View File

@ -104,6 +104,7 @@ showplayerfacesinmenu: true
joinmessage: "%playername% joined"
quitmessage: "%playername% quit"
spammessage: "You may only chat once every %interval% seconds."
webprefix: "[WEB] "
defaultzoom: 0
defaultworld: world

View File

@ -19,6 +19,7 @@ public class ClientConfigurationComponent extends Component {
s(t, "joinmessage", c.getString("joinmessage", "%playername% joined"));
s(t, "quitmessage", c.getString("quitmessage", "%playername% quit"));
s(t, "spammessage", c.getString("spammessage", "You may only chat once every %interval% seconds."));
s(t, "webprefix", c.getString("webprefix", "[WEB] "));
s(t, "defaultzoom", c.getInteger("defaultzoom", 0));
s(t, "sidebaropened", c.getBoolean("sidebaropened", false));

View File

@ -44,7 +44,7 @@ public class InternalClientUpdateComponent extends ClientUpdateComponent {
protected void webChat(String name, String message) {
// TODO: Change null to something meaningful.
plugin.mapManager.pushUpdate(new Client.ChatMessage("web", null, name, message, null));
Log.info("[WEB]" + name + ": " + message);
Log.info(plugin.configuration.getString("webprefix", "[WEB] ") + name + ": " + message);
ChatEvent event = new ChatEvent("web", name, message);
plugin.events.trigger("webchat", event);
}

View File

@ -158,7 +158,7 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
protected void webChat(String name, String message) {
// TODO: Change null to something meaningful.
plugin.mapManager.pushUpdate(new Client.ChatMessage("web", null, name, message, null));
Log.info("[WEB]" + name + ": " + message);
Log.info(plugin.configuration.getString("webprefix", "[WEB] ") + name + ": " + message);
ChatEvent event = new ChatEvent("web", name, message);
plugin.events.trigger("webchat", event);
}

View File

@ -16,7 +16,7 @@ public class SimpleWebChatComponent extends Component {
plugin.events.addListener("webchat", new Event.Listener<ChatEvent>() {
@Override
public void triggered(ChatEvent t) {
plugin.getServer().broadcastMessage("[WEB]" + t.name + ": " + t.message);
plugin.getServer().broadcastMessage(plugin.configuration.getString("webprefix", "[WEB] ") + t.name + ": " + t.message);
}
});

View File

@ -24,7 +24,7 @@ public class HeroWebChatComponent extends Component {
public void triggered(ChatEvent t) {
/* Let HeroChat take a look - only broadcast to players if it doesn't handle it */
if (!handler.sendWebMessageToHeroChat(t.name, t.message)) {
plugin.getServer().broadcastMessage("[WEB]" + t.name + ": " + t.message);
plugin.getServer().broadcastMessage(plugin.configuration.getString("webprefix", "[WEB] ") + t.name + ": " + t.message);
}
}
});