mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +00:00
Renamed assetmanager to resourcemanager
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package org.toop;
|
||||
|
||||
import org.toop.app.App;
|
||||
import org.toop.framework.asset.AssetLoader;
|
||||
import org.toop.framework.asset.AssetManager;
|
||||
import org.toop.framework.asset.ResourceLoader;
|
||||
import org.toop.framework.asset.ResourceManager;
|
||||
import org.toop.framework.audio.SoundManager;
|
||||
import org.toop.framework.networking.NetworkingClientManager;
|
||||
import org.toop.framework.networking.NetworkingInitializationException;
|
||||
@@ -14,7 +14,7 @@ public final class Main {
|
||||
}
|
||||
|
||||
private static void initSystems() throws NetworkingInitializationException {
|
||||
AssetManager.loadAssets(new AssetLoader("app/src/main/resources/assets"));
|
||||
ResourceManager.loadAssets(new ResourceLoader("app/src/main/resources/assets"));
|
||||
new Thread(NetworkingClientManager::new).start();
|
||||
new Thread(SoundManager::new).start();
|
||||
}
|
||||
|
||||
@@ -13,8 +13,10 @@ import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.stage.Stage;
|
||||
import org.toop.framework.asset.AssetManager;
|
||||
import org.toop.framework.asset.ResourceManager;
|
||||
import org.toop.framework.asset.resources.CssAsset;
|
||||
import org.toop.framework.audio.events.AudioEvents;
|
||||
import org.toop.framework.eventbus.EventFlow;
|
||||
|
||||
public final class App extends Application {
|
||||
private static Stage stage;
|
||||
@@ -44,7 +46,8 @@ public final class App extends Application {
|
||||
box.setMaxHeight(200);
|
||||
|
||||
pane = new StackPane(background, box);
|
||||
pane.getStylesheets().add(((CssAsset)AssetManager.get("quit.css")).getUrl());
|
||||
pane.getStylesheets().add(ResourceManager.get(CssAsset.class, "quit.css").getUrl());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +60,7 @@ public final class App extends Application {
|
||||
final StackPane root = new StackPane(new MainMenu().getPane());
|
||||
|
||||
final Scene scene = new Scene(root);
|
||||
scene.getStylesheets().add(((CssAsset)AssetManager.get("app.css")).getUrl());
|
||||
scene.getStylesheets().add(((CssAsset) ResourceManager.get("app.css")).getUrl());
|
||||
|
||||
stage.setTitle("pism");
|
||||
stage.setMinWidth(1080);
|
||||
@@ -82,6 +85,9 @@ public final class App extends Application {
|
||||
App.width = (int)stage.getWidth();
|
||||
App.height = (int)stage.getHeight();
|
||||
|
||||
new EventFlow().addPostEvent(new AudioEvents.StartBackgroundMusic()).asyncPostEvent();
|
||||
new EventFlow().addPostEvent(new AudioEvents.ChangeVolume(0.1)).asyncPostEvent();
|
||||
|
||||
App.isQuitting = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package org.toop.app.menu;
|
||||
|
||||
import org.toop.framework.asset.AssetManager;
|
||||
import org.toop.framework.asset.ResourceManager;
|
||||
import org.toop.framework.asset.resources.LocalizationAsset;
|
||||
import org.toop.local.AppContext;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public final class CreditsMenu extends Menu {
|
||||
private Locale currentLocale = AppContext.getLocale();
|
||||
private LocalizationAsset loc = AssetManager.get("localization.properties");
|
||||
private LocalizationAsset loc = ResourceManager.get("localization.properties");
|
||||
public CreditsMenu() {
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
package org.toop.app.menu;
|
||||
|
||||
import org.toop.framework.asset.AssetManager;
|
||||
import org.toop.framework.asset.ResourceManager;
|
||||
import org.toop.framework.asset.resources.LocalizationAsset;
|
||||
import org.toop.local.AppContext;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public final class OptionsMenu extends Menu {
|
||||
private Locale currentLocale = AppContext.getLocale();
|
||||
private LocalizationAsset loc = AssetManager.get("localization.properties");
|
||||
private LocalizationAsset loc = ResourceManager.get("localization.properties");
|
||||
public OptionsMenu() {
|
||||
}
|
||||
}
|
||||
@@ -6,16 +6,14 @@ import org.toop.game.Player;
|
||||
import org.toop.game.tictactoe.TicTacToe;
|
||||
import org.toop.game.tictactoe.TicTacToeAI;
|
||||
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import javax.management.RuntimeErrorException;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
public final class TicTacToeMenu extends GameMenu {
|
||||
private final TicTacToe game;
|
||||
private final TicTacToeAI ai;
|
||||
|
||||
private final ExecutorService executor = Executors.newFixedThreadPool(1);
|
||||
// private final ExecutorService executor = Executors.newFixedThreadPool(1);
|
||||
private final BlockingQueue<Game.Move> moveQueue = new LinkedBlockingQueue<>();
|
||||
|
||||
public TicTacToeMenu(TicTacToe game) {
|
||||
@@ -43,7 +41,7 @@ public final class TicTacToeMenu extends GameMenu {
|
||||
}
|
||||
});
|
||||
|
||||
this.executor.submit(this::gameThread);
|
||||
new Thread(this::gameThread).start();
|
||||
}
|
||||
|
||||
private void play(Game.Move move) {
|
||||
@@ -130,8 +128,6 @@ public final class TicTacToeMenu extends GameMenu {
|
||||
} catch (RuntimeException e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
executor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
windowTitle=ISY Games Selector
|
||||
|
||||
# Main Menu buttons
|
||||
mainMenuSelectTicTacToe=Tic Tac Toe\u5426
|
||||
mainMenuSelectReversi=Reversi\u5426
|
||||
mainMenuSelectTicTacToe=Tic Tac Toe
|
||||
mainMenuSelectReversi=Reversi
|
||||
mainMenuSelectSudoku=Sudoku
|
||||
mainMenuSelectBattleship=Battleship
|
||||
mainMenuSelectOther=Other
|
||||
|
||||
Reference in New Issue
Block a user