Skip to content

Commit a080398

Browse files
committed
Merge branch 'release/v0.6.15-alpha'
2 parents 7856ba0 + a9646a8 commit a080398

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+635
-314
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
*.jpg binary
88
*.mp3 binary
99
*.zip binary
10+
*.exe binary

.idea/codeStyleSettings.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

downlords-faf-client.iml renamed to .idea/modules/downlords-faf-client.iml

Lines changed: 14 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/FAF_Client_Prod.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/FAF_Client_Prod_NoUpdate.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/FAF_Client_Test.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LIBEAY32.dll

-1.13 MB
Binary file not shown.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ apply plugin: 'distribution'
3838
sourceCompatibility = JavaVersion.VERSION_1_8
3939
targetCompatibility = JavaVersion.VERSION_1_8
4040

41-
version = '0.6.14-alpha'
41+
version = '0.6.15-alpha'
4242

4343
class HttpBuilder extends HTTPBuilder {
4444

downlords-faf-client.install4j

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<versionLine x="370" y="273" text="v${compiler:sys.version}" fontSize="16" fontColor="255,255,255" bold="true" />
4242
</text>
4343
</splashScreen>
44-
<java mainClass="com.faforever.client.Main" vmParameters="-javaagent:lib/webview-patch-agent.jar" arguments="" allowVMPassthroughParameters="true" preferredVM="client" bundleRuntime="true">
44+
<java mainClass="com.faforever.client.Main" vmParameters="-javaagent:lib/webview-patch-agent.jar -Duid.dir=lib" arguments="" allowVMPassthroughParameters="true" preferredVM="client" bundleRuntime="true">
4545
<classPath>
4646
<scanDirectory location="lib" failOnError="true" />
4747
</classPath>
@@ -447,7 +447,9 @@
447447
<excludedLaunchers />
448448
<excludedBeans />
449449
<overriddenPrincipalLanguage id="en" customLocalizationFile="" />
450-
<exclude />
450+
<exclude>
451+
<entry location="lib/uid" fileType="regular" />
452+
</exclude>
451453
<variables />
452454
<autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
453455
<commentFiles />

mfc100u.dll

-4.17 MB
Binary file not shown.

msvcp100.dll

-411 KB
Binary file not shown.

src/main/java/com/faforever/client/Main.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.faforever.client.main.MainController;
1212
import com.faforever.client.preferences.PreferencesService;
1313
import com.faforever.client.theme.ThemeService;
14+
import com.faforever.client.util.SslUtil;
1415
import com.google.common.annotations.VisibleForTesting;
1516
import javafx.application.Application;
1617
import javafx.scene.image.Image;
@@ -32,6 +33,7 @@ public Main() {
3233
public void start(Stage stage) {
3334
Font.loadFont(getClass().getResourceAsStream("/font/fontawesome-webfont.ttf"), 0);
3435
JavaFxUtil.fixTooltipDuration();
36+
SslUtil.loadTruststores();
3537

3638
initApplicationContext(stage);
3739
initStage(stage, context.getBean(ThemeService.class));

src/main/java/com/faforever/client/chat/AbstractChatTabController.java

Lines changed: 10 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@
7676
import java.util.List;
7777
import java.util.regex.Matcher;
7878
import java.util.regex.Pattern;
79-
import java.util.stream.Collectors;
8079

8180
import static com.faforever.client.chat.SocialStatus.FOE;
8281
import static com.faforever.client.chat.SocialStatus.FRIEND;
8382
import static com.faforever.client.chat.SocialStatus.SELF;
8483
import static com.google.common.html.HtmlEscapers.htmlEscaper;
85-
import static java.util.Locale.US;
8684
import static java.util.regex.Pattern.CASE_INSENSITIVE;
8785
import static javafx.scene.AccessibleAttribute.ITEM_AT_INDEX;
8886

@@ -156,6 +154,9 @@ public abstract class AbstractChatTabController {
156154
MainController mainController;
157155
@Resource
158156
ThemeService themeService;
157+
@Resource
158+
AutoCompletionHelper autoCompletionHelper;
159+
159160
private boolean isChatReady;
160161
private WebEngine engine;
161162
private double lastMouseX;
@@ -168,14 +169,7 @@ public abstract class AbstractChatTabController {
168169
* Either a channel like "#aeolus" or a user like "Visionik".
169170
*/
170171
private String receiver;
171-
/**
172-
* Stores possible values for autocompletion (when strted typing a name, then pressing TAB). This value needs to be
173-
* set to {@code null} after the message has been sent or the caret has been moved in order to restart the
174-
* autocompletion on next TAB press.
175-
*/
176-
private List<String> possibleAutoCompletions;
177-
private int nextAutoCompleteIndex;
178-
private String autoCompletePartialName;
172+
179173
private Pattern mentionPattern;
180174
private Popup playerCardTooltip;
181175
private Tooltip linkPreviewTooltip;
@@ -240,6 +234,10 @@ protected void incrementUnreadMessagesCount(int delta) {
240234
}
241235
}
242236

237+
public String getReceiver() {
238+
return receiver;
239+
}
240+
243241
public void setReceiver(String receiver) {
244242
this.receiver = receiver;
245243
}
@@ -258,6 +256,8 @@ void postConstruct() {
258256
);
259257
stage.focusedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener));
260258
getRoot().selectedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener));
259+
260+
autoCompletionHelper.bindTo(getMessageTextField());
261261
}
262262

263263
/**
@@ -380,12 +380,6 @@ protected JSObject getJsObject() {
380380
return (JSObject) engine.executeScript("window");
381381
}
382382

383-
private void resetAutoCompletion() {
384-
possibleAutoCompletions = null;
385-
nextAutoCompleteIndex = -1;
386-
autoCompletePartialName = null;
387-
}
388-
389383
/**
390384
* Called from JavaScript when user hovers over a user name.
391385
*/
@@ -475,84 +469,6 @@ void onSendMessage() {
475469
} else {
476470
sendMessage();
477471
}
478-
479-
resetAutoCompletion();
480-
}
481-
482-
@FXML
483-
void onKeyPressed(KeyEvent keyEvent) {
484-
if (!keyEvent.isControlDown() && keyEvent.getCode() == KeyCode.TAB) {
485-
keyEvent.consume();
486-
autoComplete();
487-
}
488-
}
489-
490-
// TODO extract to helper class
491-
private void autoComplete() {
492-
TextInputControl messageTextField = getMessageTextField();
493-
494-
if (messageTextField.getText().isEmpty()) {
495-
return;
496-
}
497-
498-
if (possibleAutoCompletions == null) {
499-
initializeAutoCompletion(messageTextField);
500-
501-
if (possibleAutoCompletions.isEmpty()) {
502-
// There are no autocompletion matches
503-
resetAutoCompletion();
504-
return;
505-
}
506-
507-
// It's the first autocomplete event at this location, just replace the text with the first user name
508-
messageTextField.selectPreviousWord();
509-
messageTextField.replaceSelection(possibleAutoCompletions.get(nextAutoCompleteIndex++));
510-
return;
511-
}
512-
513-
// At this point, it's a subsequent auto complete event
514-
String wordBeforeCaret = getWordBeforeCaret(messageTextField);
515-
516-
/*
517-
* We have to check if the previous word is the one we auto completed. If not we reset and start all over again
518-
* as the user started auto completion on another word.
519-
*/
520-
if (!wordBeforeCaret.equals(possibleAutoCompletions.get(nextAutoCompleteIndex - 1))) {
521-
resetAutoCompletion();
522-
autoComplete();
523-
return;
524-
}
525-
526-
if (possibleAutoCompletions.size() == 1) {
527-
// No need to cycle since there was only one match
528-
return;
529-
}
530-
531-
if (possibleAutoCompletions.size() <= nextAutoCompleteIndex) {
532-
// Start over again in order to cycle
533-
nextAutoCompleteIndex = 0;
534-
}
535-
536-
messageTextField.selectPreviousWord();
537-
messageTextField.replaceSelection(possibleAutoCompletions.get(nextAutoCompleteIndex++));
538-
}
539-
540-
private void initializeAutoCompletion(TextInputControl messageTextField) {
541-
possibleAutoCompletions = new ArrayList<>();
542-
543-
autoCompletePartialName = getWordBeforeCaret(messageTextField);
544-
if (autoCompletePartialName.isEmpty()) {
545-
return;
546-
}
547-
548-
nextAutoCompleteIndex = 0;
549-
550-
possibleAutoCompletions.addAll(
551-
playerService.getPlayerNames().stream()
552-
.filter(playerName -> playerName.toLowerCase(US).startsWith(autoCompletePartialName.toLowerCase()))
553-
.sorted()
554-
.collect(Collectors.toList())
555-
);
556472
}
557473

558474
private String getWordBeforeCaret(TextInputControl messageTextField) {

0 commit comments

Comments
 (0)