Skip to content

Commit

Permalink
Merge 4b21ad6 into 9709d38
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Nov 26, 2020
2 parents 9709d38 + 4b21ad6 commit 0b91d31
Show file tree
Hide file tree
Showing 32 changed files with 139 additions and 104 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ dependencies {
compile("com.github.rutledgepaulv:q-builders:${qBuildersVersion}")
compile("com.github.nsp:JSkills:${jSkillsVersion}")
compile("com.github.jasminb:jsonapi-converter:${jsonapiConverterVersion}")
compile("com.jfoenix:jfoenix:${jfoenixVersion}")
compile("javax.annotation:javax.annotation-api:1.3.1")
compile("com.github.ben-manes.caffeine:caffeine")
compile("org.apache.httpcomponents:httpclient")
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ qBuildersVersion=1.6
jSkillsVersion=8b333ec63d
jsonapiConverterVersion=0.10
install4jRuntimeVersion=7.0.7
jfoenixVersion=9.0.10
javassist.version=3.23.1-GA
javafxVersion=11.0.2
coverallsGradlePluginVersion=2.10.1
Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ Post a bounty on Issue Hunt. You can reward and financially help developers that
1. Compile and start the application by pressing the play button

A video tutorial is available [here](https://www.youtube.com/watch?v=_kJoRehdBcM). Don't forget step 5.
If you want to use the Scene Builder, please import [jfoenix](https://www.youtube.com/watch?v=Di9f_eP_x9I).

### Linux
Learn how to install the client on Linux [here](https://github.com/FAForever/downlords-faf-client/wiki/Install-on-Linux)

## Open Source licenses
## Open Source licenses
| | |
|----------------|-------------------------------|
|<img src="https://www.ej-technologies.com/images/product_banners/install4j_large.png" width="128">|Thanks to [ej-technologies](https://www.ej-technologies.com) for their [open source license](https://www.ej-technologies.com/buy/install4j/openSource). We use Install4j to build installers.|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ public void initialize() {
removeCustomColorButton.managedProperty().bind(removeCustomColorButton.visibleProperty());

avatarPickerMenuItem.visibleProperty().bind(Bindings.createBooleanBinding(() -> !avatarComboBox.getItems().isEmpty(), avatarComboBox.getItems()));

// Workaround for the issue that the popup gets closed when the "custom color" button is clicked, causing an NPE
// in the custom color popup window.
colorPicker.focusedProperty().addListener((observable, oldValue, newValue) -> chatUserContextMenuRoot.setAutoHide(!newValue));
}

@NotNull
Expand Down Expand Up @@ -171,7 +167,6 @@ public void setChatUser(ChatChannelUser chatUser) {
chatPrefs.getUserToColor().put(lowerUsername, newValue);
}
chatUser.setColor(newValue);
chatUserContextMenuRoot.hide();
});

removeCustomColorButton.visibleProperty().bind(chatPrefs.chatColorModeProperty().isEqualTo(CUSTOM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.faforever.client.util.IdenticonUtil;
import com.faforever.client.vault.review.Review;
import com.faforever.client.vault.review.StarsController;
import com.jfoenix.controls.JFXRippler;
import javafx.application.Platform;
import javafx.beans.InvalidationListener;
import javafx.beans.WeakInvalidationListener;
Expand Down Expand Up @@ -57,10 +56,8 @@ public class MapCardController implements Controller<Node> {
private Consumer<MapBean> onOpenDetailListener;
private ListChangeListener<MapBean> installStatusChangeListener;
private final InvalidationListener reviewsChangedListener = observable -> populateReviews();
private JFXRippler jfxRippler;

public void initialize() {
jfxRippler = new JFXRippler(mapTileRoot);
installButton.managedProperty().bind(installButton.visibleProperty());
uninstallButton.managedProperty().bind(uninstallButton.visibleProperty());
installStatusChangeListener = change -> {
Expand Down Expand Up @@ -150,7 +147,7 @@ private void setInstalled(boolean installed) {
}

public Node getRoot() {
return jfxRippler;
return mapTileRoot;
}

public void setOnOpenDetailListener(Consumer<MapBean> onOpenDetailListener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.faforever.client.util.TimeService;
import com.faforever.client.vault.review.Review;
import com.faforever.client.vault.review.StarsController;
import com.jfoenix.controls.JFXRippler;
import javafx.application.Platform;
import javafx.beans.InvalidationListener;
import javafx.beans.WeakInvalidationListener;
Expand Down Expand Up @@ -53,7 +52,6 @@ public class ModCardController implements Controller<Node> {
private ListChangeListener<ModVersion> installStatusChangeListener;
public StarsController starsController;
private final InvalidationListener reviewsChangedListener = observable -> populateReviews();
private JFXRippler jfxRippler;

private void populateReviews() {
ObservableList<Review> reviews = modVersion.getReviews();
Expand All @@ -64,7 +62,6 @@ private void populateReviews() {
}

public void initialize() {
jfxRippler = new JFXRippler(modTileRoot);
installButton.managedProperty().bind(installButton.visibleProperty());
uninstallButton.managedProperty().bind(uninstallButton.visibleProperty());
installStatusChangeListener = change -> {
Expand Down Expand Up @@ -134,7 +131,7 @@ public void setModVersion(ModVersion modVersion) {
}

public Node getRoot() {
return jfxRippler;
return modTileRoot;
}

public void setOnOpenDetailListener(Consumer<ModVersion> onOpenDetailListener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.faforever.client.util.TimeService;
import com.faforever.client.vault.review.Review;
import com.faforever.client.vault.review.StarsController;
import com.jfoenix.controls.JFXRippler;
import javafx.application.Platform;
import javafx.beans.InvalidationListener;
import javafx.beans.WeakInvalidationListener;
Expand Down Expand Up @@ -62,12 +61,6 @@ public class ReplayCardController implements Controller<Node> {
private Replay replay;
private final InvalidationListener reviewsChangedListener = observable -> populateReviews();
private Consumer<Replay> onOpenDetailListener;
private JFXRippler jfxRippler;

@Override
public void initialize() {
jfxRippler = new JFXRippler(replayTileRoot);
}

public void setReplay(Replay replay) {
this.replay = replay;
Expand Down Expand Up @@ -141,7 +134,7 @@ private void populateReviews() {
}

public Node getRoot() {
return jfxRippler;
return replayTileRoot;
}

public void setOnOpenDetailListener(Consumer<Replay> onOpenDetailListener) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.faforever.client.ui.alert.animation;

import com.jfoenix.transitions.CachedTransition;
import com.faforever.client.ui.transitions.CachedTransition;
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.faforever.client.ui.alert.animation;

import com.jfoenix.transitions.CachedTransition;
import com.faforever.client.ui.transitions.CachedTransition;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.faforever.client.ui.alert.animation;

import com.jfoenix.transitions.CachedTransition;
import com.faforever.client.ui.transitions.CachedTransition;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.faforever.client.ui.alert.animation;

import com.jfoenix.transitions.CachedTransition;
import com.faforever.client.ui.transitions.CachedTransition;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package com.faforever.client.ui.transitions;

import javafx.scene.CacheHint;
import javafx.scene.Node;
import javafx.scene.layout.Region;

import java.util.concurrent.atomic.AtomicBoolean;

/** Ported from JFoenix since we wanted to get rid of the JFoenix dependency */
public class CacheMemento {
private boolean cache;
private boolean cacheShape;
private boolean snapToPixel;
private CacheHint cacheHint = CacheHint.DEFAULT;
private Node node;
private AtomicBoolean isCached = new AtomicBoolean(false);

public CacheMemento(Node node) {
this.node = node;
}

/**
* this method will cache the node only if it wasn't cached before
*/
public void cache() {
if (!isCached.getAndSet(true)) {
this.cache = node.isCache();
this.cacheHint = node.getCacheHint();
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
if (node instanceof Region) {
this.cacheShape = ((Region) node).isCacheShape();
this.snapToPixel = ((Region) node).isSnapToPixel();
((Region) node).setCacheShape(true);
((Region) node).setSnapToPixel(true);
}
}
}

public void restore() {
if (isCached.getAndSet(false)) {
node.setCache(cache);
node.setCacheHint(cacheHint);
if (node instanceof Region) {
((Region) node).setCacheShape(cacheShape);
((Region) node).setSnapToPixel(snapToPixel);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.faforever.client.ui.transitions;

import com.jfoenix.transitions.CacheMemento;
import javafx.animation.Timeline;
import javafx.animation.Transition;
import javafx.beans.property.ObjectProperty;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ theme.needsRestart.message=Changing the theme to ''{0}'' might require a restart
theme.needsRestart.quit=Quit
discord.join=Join FAF on Discord
chat.filter.countryPrompt=Country code
chat.userColor=Color
games.create.enforceRating=Enforce rating
label.copy=copy
gameUpdate.error.gameNotWritableAllowMultiOn=The game could not be patched to the required version for this game launch. You are trying to watch a replay or open a game of a conflicting version to the one you have already opened.
6 changes: 3 additions & 3 deletions src/main/resources/theme/achievement_item.fxml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXProgressBar?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
Expand All @@ -27,8 +27,8 @@
GridPane.columnSpan="2147483647" GridPane.rowIndex="1"/>
<Label fx:id="pointsLabel" text="&lt;Points&gt;" visible="false" GridPane.columnIndex="2"
GridPane.halignment="RIGHT"/>
<JFXProgressBar fx:id="progressBar" maxWidth="1.7976931348623157E308" progress="0.0" GridPane.columnIndex="1"
GridPane.rowIndex="2"/>
<ProgressBar fx:id="progressBar" maxWidth="1.7976931348623157E308" progress="0.0" GridPane.columnIndex="1"
GridPane.rowIndex="2"/>
<Label fx:id="progressLabel" text="&lt;progress&gt;" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
<ImageView fx:id="imageView" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true"
GridPane.halignment="CENTER" GridPane.rowSpan="2147483647" GridPane.valignment="CENTER"/>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/theme/chat/chat.fxml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXSpinner?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressIndicator?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TextField?>
Expand Down Expand Up @@ -33,7 +33,7 @@
AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<JFXSpinner prefHeight="80.0" prefWidth="80.0"/>
<ProgressIndicator prefHeight="80.0" prefWidth="80.0"/>
<Label text="%chat.connecting.message">
<VBox.margin>
<Insets bottom="28.0" top="14.0"/>
Expand Down
8 changes: 5 additions & 3 deletions src/main/resources/theme/chat/chat_user_context_menu.fxml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXColorPicker?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ColorPicker?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.ContextMenu?>
<?import javafx.scene.control.CustomMenuItem?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.layout.HBox?>
Expand All @@ -22,9 +23,10 @@
<content>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<JFXColorPicker fx:id="colorPicker" HBox.hgrow="ALWAYS"/>
<Label text="%chat.userColor"/>
<ColorPicker fx:id="colorPicker" styleClass="button" HBox.hgrow="ALWAYS"/>
<Button fx:id="removeCustomColorButton" onAction="#onRemoveCustomColor" styleClass="icon,small"
text="" HBox.hgrow="NEVER"/>
text="" HBox.hgrow="NEVER"/>
</children>
</HBox>
</content>
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/theme/leaderboard/leaderboard.fxml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXSpinner?>
<?import javafx.scene.control.TextField?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressIndicator?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<VBox xmlns:fx="http://javafx.com/fxml/1" fx:id="leaderboardRoot" alignment="CENTER" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" xmlns="http://javafx.com/javafx/8.0.60"
fx:controller="com.faforever.client.leaderboard.LeaderboardController">
Expand Down Expand Up @@ -46,7 +46,7 @@
</VBox>
<VBox fx:id="connectionProgressPane" alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" spacing="10.0" VBox.vgrow="ALWAYS">
<children>
<JFXSpinner prefHeight="80.0" prefWidth="80.0"/>
<ProgressIndicator prefHeight="80.0" prefWidth="80.0"/>
<Label text="%leaderboard.loading">
<VBox.margin>
<Insets />
Expand Down
12 changes: 4 additions & 8 deletions src/main/resources/theme/login.fxml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXSpinner?>
<?import java.lang.String?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.ProgressIndicator?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.SVGPath?>
<?import javafx.scene.text.Text?>

<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<VBox fx:id="loginRoot" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" styleClass="login-root" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.faforever.client.login.LoginController">
<children>
<VBox alignment="CENTER" maxWidth="1.7976931348623157E308" VBox.vgrow="ALWAYS">
Expand All @@ -33,7 +29,7 @@
</StackPane>
<VBox fx:id="loginProgressPane" alignment="CENTER" maxWidth="1.7976931348623157E308">
<children>
<JFXSpinner prefHeight="80.0" prefWidth="80.0" />
<ProgressIndicator prefHeight="80.0" prefWidth="80.0"/>
<Label text="%login.progress.message">
<VBox.margin>
<Insets top="14.0" />
Expand Down
Loading

0 comments on commit 0b91d31

Please sign in to comment.