Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Commit

Permalink
New channel join/leave icon and making the join/leave button more smo…
Browse files Browse the repository at this point in the history
…oth.

Also, active channel icon is now round instead of star-ish.
Also, updated the local suggest-channels.json fallback on this branch.

Fixes #206
  • Loading branch information
BlayTheNinth committed Apr 11, 2015
1 parent 37f9610 commit 5a62007
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 48 deletions.
Binary file modified assets-raw/button_join.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets-raw/button_part.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets-raw/icon_active.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -189,11 +189,10 @@ public void actionPerformed(GuiButton button) {
ChannelConfig channelConfig = lstChannels.getSelectedItem().getConfig();
if (connection.getChannel(channelConfig.getName()) != null) {
connection.part(channelConfig.getName());
setChannelJoinLeaveButtonState(false);
} else {
connection.join(channelConfig.getName(), channelConfig.getPassword());
setChannelJoinLeaveButtonState(true);
}
btnChannelJoinLeave.enabled = false;
}
}
} else if(button == btnDelete) {
Expand Down Expand Up @@ -224,6 +223,7 @@ public void onChannelJoined(IRCChannelJoinedEvent event) {
entry.setJoined(true);
}
}
updateButtonStates();
}

@SubscribeEvent
Expand All @@ -233,6 +233,7 @@ public void onChannelLeft(IRCChannelLeftEvent event) {
entry.setJoined(false);
}
}
updateButtonStates();
}

@SubscribeEvent
Expand All @@ -243,6 +244,7 @@ public void onDisconnect(IRCDisconnectEvent event) {
for(GuiListEntryChannel entry : lstChannels.getEntries()) {
entry.setJoined(false);
}
updateButtonStates();
}
}

Expand Down Expand Up @@ -278,21 +280,26 @@ public void keyTyped(char unicode, int keyCode) throws IOException {
}
}

private void setChannelJoinLeaveButtonState(boolean state) {
if(state) {
btnChannelJoinLeave.setTextureRegion(EiraGui.atlas.findRegion("button_part"));
private void updateButtonStates() {
if(lstChannels.hasSelection()) {
IRCConnection connection = EiraIRC.instance.getConnectionManager().getConnection(config.getAddress());
ChannelConfig channelConfig = lstChannels.getSelectedItem().getConfig();
if(connection != null && channelConfig != null && connection.getChannel(channelConfig.getName()) != null) {
btnChannelJoinLeave.setTextureRegion(EiraGui.atlas.findRegion("button_part"));
} else {
btnChannelJoinLeave.setTextureRegion(EiraGui.atlas.findRegion("button_join"));
}
btnChannelDelete.enabled = true;
btnChannelJoinLeave.enabled = true;
} else {
btnChannelDelete.enabled = false;
btnChannelJoinLeave.enabled = false;
btnChannelJoinLeave.setTextureRegion(EiraGui.atlas.findRegion("button_join"));
}
}

public void channelSelected(ChannelConfig channelConfig) {
IRCConnection connection = EiraIRC.instance.getConnectionManager().getConnection(config.getAddress());
if(connection != null && connection.getChannel(channelConfig.getName()) != null) {
setChannelJoinLeaveButtonState(true);
} else {
setChannelJoinLeaveButtonState(false);
}
updateButtonStates();
}

public void channelClicked(ChannelConfig channelConfig) {
Expand Down
Expand Up @@ -262,11 +262,10 @@ public void join(String channelName, String channelKey) {
@Override
public void part(String channelName) {
if(irc("PART " + channelName)) {
IRCChannel channel = getChannel(channelName);
IRCChannel channel = channels.remove(channelName.toLowerCase());
if(channel != null) {
MinecraftForge.EVENT_BUS.post(new IRCChannelLeftEvent(this, channel));
}
channels.remove(channelName.toLowerCase());
}
}

Expand Down
70 changes: 35 additions & 35 deletions src/main/resources/assets/eirairc/gfx/eiragui.pack
Expand Up @@ -5,196 +5,196 @@ filter: Nearest,Nearest
repeat: none
menu_cat
rotate: false
xy: 0, 192
xy: 0, 185
size: 64, 64
orig: 64, 64
offset: 0, 0
index: -1
menu_friends
rotate: false
xy: 0, 128
xy: 0, 119
size: 64, 64
orig: 64, 64
offset: 0, 0
index: -1
menu_screenshots
rotate: false
xy: 64, 192
xy: 64, 185
size: 64, 64
orig: 64, 64
offset: 0, 0
index: -1
menu_servers
rotate: false
xy: 0, 64
xy: 0, 53
size: 64, 64
orig: 64, 64
offset: 0, 0
index: -1
menu_settings
rotate: false
xy: 0, 0
xy: 64, 119
size: 64, 64
orig: 64, 64
offset: 0, 0
index: -1
menu_twitch
rotate: false
xy: 64, 128
xy: 128, 185
size: 64, 64
orig: 64, 64
offset: 0, 0
index: -1
button_clipboard
rotate: false
xy: 128, 224
xy: 0, 19
size: 32, 32
orig: 32, 32
offset: 0, 0
index: -1
button_delete
rotate: false
xy: 64, 96
xy: 64, 85
size: 32, 32
orig: 32, 32
offset: 0, 0
index: -1
button_favorite
rotate: false
xy: 128, 192
xy: 128, 151
size: 32, 32
orig: 32, 32
offset: 0, 0
index: -1
button_unfavorite
rotate: false
xy: 160, 224
xy: 192, 217
size: 32, 32
orig: 32, 32
offset: 0, 0
index: -1
button_upload
rotate: false
xy: 64, 64
xy: 224, 217
size: 32, 32
orig: 32, 32
offset: 0, 0
index: -1
button_zoom
rotate: false
xy: 96, 96
xy: 32, 19
size: 32, 32
orig: 32, 32
offset: 0, 0
index: -1
tab_bg_bottomleft
rotate: false
xy: 128, 176
xy: 0, 1
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
tab_bg_bottomright
rotate: false
xy: 160, 208
xy: 64, 67
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
tab_bg_content
rotate: false
xy: 192, 240
xy: 96, 101
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
tab_bg_topright
rotate: false
xy: 64, 48
xy: 128, 133
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
tab_header_left
rotate: false
xy: 96, 80
xy: 160, 167
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
tab_header_middle
rotate: false
xy: 128, 160
xy: 192, 199
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
tab_header_right
rotate: false
xy: 144, 176
xy: 16, 1
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
button_join
button_add
rotate: false
xy: 160, 196
size: 9, 12
orig: 9, 12
xy: 64, 55
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
button_add
button_first
rotate: false
xy: 176, 214
xy: 80, 73
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
button_first
button_join
rotate: false
xy: 192, 230
xy: 96, 89
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
button_last
rotate: false
xy: 208, 246
xy: 112, 107
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
button_part
rotate: false
xy: 64, 36
size: 8, 12
orig: 8, 12
xy: 128, 121
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
button_remove
rotate: false
xy: 80, 54
xy: 144, 139
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
icon_active
rotate: false
xy: 96, 70
xy: 160, 155
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
button_next
rotate: false
xy: 112, 86
xy: 176, 173
size: 6, 10
orig: 6, 10
offset: 0, 0
index: -1
button_prev
rotate: false
xy: 128, 150
xy: 192, 187
size: 6, 10
orig: 6, 10
offset: 0, 0
Expand Down
Binary file modified src/main/resources/assets/eirairc/gfx/eiragui.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/main/resources/assets/eirairc/suggested-channels.json
Expand Up @@ -27,6 +27,13 @@
"description": "The official Feed The Beast IRC channel.",
"recommended": true
},
{
"server": "irc.esper.net",
"channel": "#Unabridged",
"modpack-display": "Unabridged Modpack",
"modpack-id": "Unabridged",
"description": "Official IRC channel for the 'Unabridged' modpack. http://www.reddit.com/r/MinecraftUnabridged/"
},
{
"server": "irc.esper.net",
"channel": "#digtobuild",
Expand Down Expand Up @@ -66,5 +73,16 @@
"channel": "#Pandamonium",
"modpack-display": "South Korean Community",
"description": "Pandamonium is a small South Korean community. We use Korean for our common communication because most of our members can't speak English."
},
{
"server": "irc.esper.net",
"channel": "#Minecraft",
"description": "The official Minecraft IRC channel. Requires NickServ authentication to talk."
},
{
"server": "irc.esper.net",
"channel": "#rftools",
"modpack-display": "RF-Tools Mod",
"description": "The IRC channel for the RFTools mod."
}
]

0 comments on commit 5a62007

Please sign in to comment.