Skip to content

Commit

Permalink
Merge branch 'release/0.6.14-alpha'
Browse files Browse the repository at this point in the history
  • Loading branch information
micheljung committed Jun 25, 2016
2 parents f8137eb + 6084f95 commit 7856ba0
Show file tree
Hide file tree
Showing 69 changed files with 812 additions and 919 deletions.
24 changes: 0 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,12 @@

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*


### Gradle template
.gradle
build/
Expand All @@ -64,7 +44,3 @@ gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar



uid.log
10 changes: 10 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ apply plugin: 'distribution'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

version = '0.6.13-alpha'
version = '0.6.14-alpha'

class HttpBuilder extends HTTPBuilder {

Expand Down Expand Up @@ -273,4 +273,5 @@ dependencies {
compile 'com.nativelibs4java:bridj:0.7.0'
compile 'com.github.nocatch:nocatch:1.1'
compile 'org.javassist:javassist:3.20.0-GA'
compile 'io.sigpipe:jbsdiff:1.0'
}
3 changes: 2 additions & 1 deletion downlords-faf-client.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="downlords-faf-client" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.6.12-alpha" type="JAVA_MODULE" version="4">
<module external.linked.project.id="downlords-faf-client" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.6.13-alpha" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
Expand Down Expand Up @@ -82,6 +82,7 @@
<orderEntry type="library" scope="TEST" name="Gradle: net.bytebuddy:byte-buddy:0.6.14" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.objenesis:objenesis:2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-all:1.3" level="project" />
<orderEntry type="library" name="Gradle: io.sigpipe:jbsdiff:1.0" level="project" />
</component>
<component name="sonarModuleSettings">
<option name="alternativeWorkingDirPath" value="" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public class AudioControllerImpl implements AudioController {

@PostConstruct
void postConstruct() throws IOException {
mainController.getRoot().sceneProperty().addListener((observable, oldValue, newValue) -> {
playSounds = newValue != null;
});
mainController.getRoot().sceneProperty().addListener((observable, oldValue, newValue) ->
playSounds = newValue != null
);

notificationsPrefs = preferencesService.getPreferences().getNotification();
notificationsPrefs.soundsEnabledProperty().addListener((observable, oldValue, newValue) -> {
playSounds &= newValue;
});
notificationsPrefs.soundsEnabledProperty().addListener((observable, oldValue, newValue) ->
playSounds &= newValue
);

loadSounds();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import static com.faforever.client.chat.SocialStatus.FRIEND;
import static com.faforever.client.chat.SocialStatus.SELF;
import static com.google.common.html.HtmlEscapers.htmlEscaper;
import static java.util.Locale.US;
import static java.util.regex.Pattern.CASE_INSENSITIVE;
import static javafx.scene.AccessibleAttribute.ITEM_AT_INDEX;

Expand Down Expand Up @@ -252,9 +253,9 @@ void postConstruct() {
addFocusListeners();
addImagePasteListener();

unreadMessagesCount.addListener((observable, oldValue, newValue) -> {
chatService.incrementUnreadMessagesCount(newValue.intValue() - oldValue.intValue());
});
unreadMessagesCount.addListener((observable, oldValue, newValue) ->
chatService.incrementUnreadMessagesCount(newValue.intValue() - oldValue.intValue())
);
stage.focusedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener));
getRoot().selectedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener));
}
Expand Down Expand Up @@ -548,7 +549,7 @@ private void initializeAutoCompletion(TextInputControl messageTextField) {

possibleAutoCompletions.addAll(
playerService.getPlayerNames().stream()
.filter(playerName -> playerName.toLowerCase().startsWith(autoCompletePartialName.toLowerCase()))
.filter(playerName -> playerName.toLowerCase(US).startsWith(autoCompletePartialName.toLowerCase()))
.sorted()
.collect(Collectors.toList())
);
Expand Down Expand Up @@ -740,13 +741,10 @@ String getInlineStyle(String username) {
} else if (player != null && (player.getSocialStatus() == SELF || player.getSocialStatus() == FRIEND)) {
return "";
} else {
switch (chatPrefs.getChatColorMode()) {
case CUSTOM:
case RANDOM:
if (chatUser.getColor() != null) {
color = createInlineStyleFromColor(chatUser.getColor());
}
break;
ChatColorMode chatColorMode = chatPrefs.getChatColorMode();
if ((chatColorMode == ChatColorMode.CUSTOM || chatColorMode == ChatColorMode.RANDOM)
&& chatUser.getColor() != null) {
color = createInlineStyleFromColor(chatUser.getColor());
}
}

Expand Down
29 changes: 15 additions & 14 deletions src/main/java/com/faforever/client/chat/ChannelTabController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import javafx.collections.ObservableList;
import javafx.collections.SetChangeListener;
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.geometry.Bounds;
import javafx.scene.Node;
Expand Down Expand Up @@ -54,6 +53,7 @@ public class ChannelTabController extends AbstractChatTabController {
@VisibleForTesting
static final String CSS_CLASS_MODERATOR = "moderator";
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final String USER_CSS_CLASS_FORMAT = "user-%s";
/**
* Keeps track of which ChatUserControl in which pane belongs to which user.
*/
Expand Down Expand Up @@ -136,9 +136,9 @@ public void setChannelName(String channelName) {
} else if (change.wasRemoved()) {
onUserLeft(change.getValueRemoved().getUsername());
}
updateUserCount(channelName, change.getMap().size());
updateUserCount(change.getMap().size());
};
updateUserCount(channelName, chatService.getOrCreateChannel(channelName).getUsers().size());
updateUserCount(chatService.getOrCreateChannel(channelName).getUsers().size());

chatService.addUsersListener(channelName, usersChangeListener);

Expand All @@ -158,7 +158,7 @@ public void setChannelName(String channelName) {
addSearchFieldListener();
}

private void updateUserCount(String channelName, int count) {
private void updateUserCount(int count) {
Platform.runLater(() -> userSearchTextField.setPromptText(i18n.get("chat.userCount", count)));
}

Expand Down Expand Up @@ -245,6 +245,7 @@ public Tab getRoot() {
}

@PostConstruct
@Override
void postConstruct() {
super.postConstruct();

Expand Down Expand Up @@ -278,7 +279,7 @@ protected void onMention(ChatMessage chatMessage) {
protected String getMessageCssClass(String login) {
PlayerInfoBean playerInfoBean = playerService.getPlayerForUsername(login);
if (playerInfoBean != null
&& playerInfoBean != playerService.getCurrentPlayer()
&& !playerInfoBean.equals(playerService.getCurrentPlayer())
&& playerInfoBean.getModeratorForChannels().contains(channelName)) {
return CSS_CLASS_MODERATOR;
}
Expand Down Expand Up @@ -312,16 +313,16 @@ private void removeUserMessageClass(PlayerInfoBean playerInfoBean, String cssCla
if (cssClass.isEmpty()) {
return;
}
Platform.runLater(() -> getJsObject().call("removeUserMessageClass", String.format("user-%s", playerInfoBean.getUsername()), cssClass));
Platform.runLater(() -> getJsObject().call("removeUserMessageClass", String.format(USER_CSS_CLASS_FORMAT, playerInfoBean.getUsername()), cssClass));

}

private void setUserMessageClass(PlayerInfoBean playerInfoBean, String cssClass) {
Platform.runLater(() -> getJsObject().call("setUserMessageClass", String.format("user-%s", playerInfoBean.getUsername()), cssClass));
Platform.runLater(() -> getJsObject().call("setUserMessageClass", String.format(USER_CSS_CLASS_FORMAT, playerInfoBean.getUsername()), cssClass));
}

private void updateUserMessageDisplay(PlayerInfoBean playerInfoBean, String display) {
Platform.runLater(() -> getJsObject().call("updateUserMessageDisplay", String.format("user-%s", playerInfoBean.getUsername()), display));
Platform.runLater(() -> getJsObject().call("updateUserMessageDisplay", String.format(USER_CSS_CLASS_FORMAT, playerInfoBean.getUsername()), display));
}

private void onUserJoinedChannel(ChatUser chatUser) {
Expand Down Expand Up @@ -409,9 +410,9 @@ private void onUserJoinedChannel(ChatUser chatUser) {
}
});

chatUser.colorProperty().addListener((observable, oldValue, newValue) -> {
Platform.runLater(() -> updateUserMessageColor(chatUser));
});
chatUser.colorProperty().addListener((observable, oldValue, newValue) ->
Platform.runLater(() -> updateUserMessageColor(chatUser))
);

Collection<Pane> targetPanesForUser = getTargetPanesForUser(player);
userToChatUserControls.putIfAbsent(username, new HashMap<>(targetPanesForUser.size(), 1));
Expand Down Expand Up @@ -517,7 +518,7 @@ private Collection<Pane> getTargetPanesForUser(PlayerInfoBean playerInfoBean) {
@FXML
void onKeyReleased(KeyEvent event) {
if (event.getCode() == KeyCode.ESCAPE) {
onSearchFieldClose(event);
onSearchFieldClose();
} else if (event.isControlDown() && event.getCode() == KeyCode.F) {
searchField.clear();
searchField.setVisible(!searchField.isVisible());
Expand All @@ -526,14 +527,14 @@ void onKeyReleased(KeyEvent event) {
}

@FXML
void onSearchFieldClose(Event event) {
void onSearchFieldClose() {
searchField.setVisible(false);
searchField.clear();
}

public void addSearchFieldListener() {
searchField.textProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.isEmpty() || newValue.equals(" ")) {
if (newValue.trim().isEmpty()) {
getJsObject().call("removeHighlight");
} else {
getJsObject().call("highlightText", newValue);
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/com/faforever/client/chat/ChatController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.faforever.client.fx.JavaFxUtil;
import com.faforever.client.user.UserService;
import com.faforever.client.util.ProgrammingError;
import javafx.application.Platform;
import javafx.beans.InvalidationListener;
import javafx.collections.ListChangeListener;
Expand Down Expand Up @@ -69,6 +70,8 @@ void postConstruct() {
case CONNECTING:
onConnecting();
break;
default:
throw new ProgrammingError("Uncovered connection state: " + newValue);
}
});

Expand Down Expand Up @@ -131,7 +134,7 @@ private void addTab(String playerOrChannelName, AbstractChatTabController tabCon
}

@FXML
private void initialize() {
void initialize() {
onDisconnected();

chatsTabPane.getTabs().addListener((ListChangeListener<Tab>) change -> {
Expand Down Expand Up @@ -198,11 +201,12 @@ private void joinChannel(String channelName) {
}

private void onChatUserLeftChannel(String channelName, String username) {
if (username.equalsIgnoreCase(userService.getUsername())) {
AbstractChatTabController chatTab = nameToChatTabController.get(channelName);
if (chatTab != null) {
chatsTabPane.getTabs().remove(chatTab.getRoot());
}
if (!username.equalsIgnoreCase(userService.getUsername())) {
return;
}
AbstractChatTabController chatTab = nameToChatTabController.get(channelName);
if (chatTab != null) {
chatsTabPane.getTabs().remove(chatTab.getRoot());
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/faforever/client/chat/ChatUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
return obj instanceof ChatUser
return obj != null
&& obj.getClass() == this.getClass()
&& username.get().equalsIgnoreCase(((ChatUser) obj).username.get());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ void onUserInfo() {

@FXML
void onSendPrivateMessage() {
// FIXME implement
}

@FXML
Expand Down
Loading

0 comments on commit 7856ba0

Please sign in to comment.