Prevented addition of channels with empty names.

This commit is contained in:
CrazyPants committed 2014-10-12 01:02:56 +08:00
1 parent f095e60982
commit fdbfba48e3
2 files changed
+4 -10

No files matched your search

@@ -237,13 +237,14 @@ public class ChannelTab implements ITabPanel {
Channel c = channelList.getSelectedElement();
if(c != null) {
ClientChannelRegister.instance.removeChannel(c);
PacketHandler.INSTANCE.sendToServer(new PacketAddRemoveChannel(c, false));
// transceiver.removeSendChanel(c);
// transceiver.removeRecieveChanel(c);
PacketHandler.INSTANCE.sendToServer(new PacketAddRemoveChannel(c, false));
}
}
private void addChannelPressed() {
if(newChannelTF.getText() == null || newChannelTF.getText().trim().isEmpty()) {
return;
}
Channel c;
if(privateButton.isSelected()) {
c = new Channel(newChannelTF.getText(), Minecraft.getMinecraft().thePlayer.getGameProfile().getName(), type);
@@ -34,10 +34,6 @@ public class GuiChannelList extends GuiScrollableList<Channel> {
channels = val;
}
// void setActiveChannel(Channel channel) {
// activeChannel = channel;
// }
@Override
public int getNumElements() {
return channels.size();
@@ -70,9 +66,6 @@ public class GuiChannelList extends GuiScrollableList<Channel> {
return;
}
int col = ColorUtil.getRGB(Color.white);
// if(c.equals(activeChannel)) {
// col = ColorUtil.getRGB(Color.cyan);
// }
parent.drawString(parent.getFontRenderer(), c.getName(), xPosition + margin, yPosition + margin / 2, col);
if(!c.isPublic()) {
IconEIO.PRIVATE.renderIcon(xPosition + width - 18, yPosition - 3, 16, 15, 0, true);