Skip to content

Commit

Permalink
Update GameMenu.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirosakiMio committed Mar 29, 2024
1 parent 266f90f commit 71f90cc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions FCL/src/main/java/com/tungsten/fcl/control/GameMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.tungsten.fcl.control.view.ViewManager;
import com.tungsten.fcl.setting.Controller;
import com.tungsten.fcl.setting.Controllers;
import com.tungsten.fcl.setting.GameOption;
import com.tungsten.fcl.setting.MenuSetting;
import com.tungsten.fcl.util.AndroidUtils;
import com.tungsten.fcl.util.FXUtils;
Expand Down Expand Up @@ -389,7 +390,10 @@ private void initRightMenu() {
protected void invalidated() {
super.invalidated();
menuSetting.setItemBarScale(get());
gameItemBar.getOptionListener().onOptionChanged();
GameOption.GameOptionListener optionListener = gameItemBar.getOptionListener();
if (optionListener != null) {
optionListener.onOptionChanged();
}
}
};
itemBarScaleSeekbar.progressProperty().bindBidirectional(itemBarScaleProperty);
Expand All @@ -403,8 +407,10 @@ protected void invalidated() {
menuSetting.setWindowScale(doubleValue);
int screenWidth = AndroidUtils.getScreenWidth(FCLApplication.getCurrentActivity());
int screenHeight = AndroidUtils.getScreenHeight(FCLApplication.getCurrentActivity());
getBridge().setScaleFactor(doubleValue);
fclBridge.getSurfaceTexture().setDefaultBufferSize((int) (screenWidth * doubleValue), (int) (screenHeight*doubleValue));
if (fclBridge != null) {
fclBridge.setScaleFactor(doubleValue);
fclBridge.getSurfaceTexture().setDefaultBufferSize((int) (screenWidth * doubleValue), (int) (screenHeight * doubleValue));
}
}
};
windowScaleSeekbar.progressProperty().bindBidirectional(windowScaleProperty);
Expand Down

0 comments on commit 71f90cc

Please sign in to comment.