Skip to content

Commit

Permalink
keep log window
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirosakiMio committed Mar 18, 2024
1 parent 32ebf25 commit e44c70a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
9 changes: 8 additions & 1 deletion FCL/src/main/java/com/tungsten/fcl/control/GameMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import com.tungsten.fclauncher.utils.FCLPath;
import com.tungsten.fclauncher.bridge.FCLBridge;
import com.tungsten.fclauncher.bridge.FCLBridgeCallback;
import com.tungsten.fclcore.fakefx.beans.InvalidationListener;
import com.tungsten.fclcore.fakefx.beans.Observable;
import com.tungsten.fclcore.fakefx.beans.binding.Bindings;
import com.tungsten.fclcore.fakefx.beans.property.BooleanProperty;
import com.tungsten.fclcore.fakefx.beans.property.IntegerProperty;
Expand Down Expand Up @@ -343,7 +345,12 @@ private void initRightMenu() {
FXUtils.bindBoolean(disableGestureSwitch, menuSetting.disableGestureProperty());
FXUtils.bindBoolean(disableBEGestureSwitch, menuSetting.disableBEGestureProperty());
FXUtils.bindBoolean(gyroSwitch, menuSetting.enableGyroscopeProperty());
FXUtils.bindBoolean(showLogSwitch, logWindow.visibilityProperty());
FXUtils.bindBoolean(showLogSwitch, menuSetting.showLogProperty());

logWindow.visibilityProperty().setValue(menuSetting.isshowLog());
menuSetting.showLogProperty().addListener(observable -> {
logWindow.visibilityProperty().setValue(menuSetting.isshowLog());
});

ArrayList<GestureMode> gestureModeDataList = new ArrayList<>();
gestureModeDataList.add(GestureMode.BUILD);
Expand Down
17 changes: 17 additions & 0 deletions FCL/src/main/java/com/tungsten/fcl/setting/MenuSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ public void setDisableSoftKeyAdjust(boolean disableSoftKeyAdjust) {
this.disableSoftKeyAdjustProperty.set(disableSoftKeyAdjust);
}

private final BooleanProperty showLogProperty = new SimpleBooleanProperty(this, "showLog", false);

public BooleanProperty showLogProperty() {
return showLogProperty;
}

public boolean isshowLog() {
return showLogProperty.get();
}

public void setShowLog(boolean showLog) {
this.showLogProperty.set(showLog);
}

private final DoubleProperty menuPositionXProperty = new SimpleDoubleProperty(this, "menuPositionX", 0.5d);

public DoubleProperty menuPositionXProperty() {
Expand Down Expand Up @@ -242,6 +256,7 @@ public void addPropertyChangedListener(InvalidationListener listener) {
autoFitDistProperty.addListener(listener);
lockMenuViewProperty.addListener(listener);
disableSoftKeyAdjustProperty.addListener(listener);
showLogProperty.addListener(listener);
menuPositionXProperty.addListener(listener);
menuPositionYProperty.addListener(listener);
disableGestureProperty.addListener(listener);
Expand All @@ -265,6 +280,7 @@ public JsonElement serialize(MenuSetting src, Type typeOfSrc, JsonSerializationC
obj.addProperty("autoFitDist", src.getAutoFitDist());
obj.addProperty("lockMenuView", src.isLockMenuView());
obj.addProperty("disableSoftKeyAdjust", src.isDisableSoftKeyAdjust());
obj.addProperty("showLog", src.isshowLog());
obj.addProperty("menuPositionX", src.getMenuPositionX());
obj.addProperty("menuPositionY", src.getMenuPositionY());
obj.addProperty("disableGesture", src.isDisableGesture());
Expand All @@ -291,6 +307,7 @@ public MenuSetting deserialize(JsonElement json, Type typeOfT, JsonDeserializati
ms.setAutoFitDist(Optional.ofNullable(obj.get("autoFitDist")).map(JsonElement::getAsInt).orElse(0));
ms.setLockMenuView(Optional.ofNullable(obj.get("lockMenuView")).map(JsonElement::getAsBoolean).orElse(false));
ms.setDisableSoftKeyAdjust(Optional.ofNullable(obj.get("disableSoftKeyAdjust")).map(JsonElement::getAsBoolean).orElse(false));
ms.setShowLog(Optional.ofNullable(obj.get("showLog")).map(JsonElement::getAsBoolean).orElse(false));
ms.setMenuPositionX(Optional.ofNullable(obj.get("menuPositionX")).map(JsonElement::getAsDouble).orElse(0.5d));
ms.setMenuPositionY(Optional.ofNullable(obj.get("menuPositionY")).map(JsonElement::getAsDouble).orElse(0.5d));
ms.setDisableGesture(Optional.ofNullable(obj.get("disableGesture")).map(JsonElement::getAsBoolean).orElse(false));
Expand Down

0 comments on commit e44c70a

Please sign in to comment.