Compare commits

..

No commits in common. "9e88353bd56cdd5e8fba51c76ce3686f12d7c5ce" and "b01bb3cf7bf66eb6172c60efdafd47a7f280a57e" have entirely different histories.

2 changed files with 34 additions and 19 deletions

View File

@ -30,16 +30,18 @@ import com.jme3.system.AppSettings;
import com.simsilica.lemur.GuiGlobals; import com.simsilica.lemur.GuiGlobals;
import com.simsilica.lemur.style.BaseStyles; import com.simsilica.lemur.style.BaseStyles;
import pp.dialog.Dialog;
import pp.dialog.DialogBuilder; import pp.dialog.DialogBuilder;
import pp.dialog.DialogManager; import pp.dialog.DialogManager;
import pp.graphics.Draw; import pp.graphics.Draw;
import static pp.monopoly.Resources.lookup; import static pp.monopoly.Resources.lookup;
import pp.monopoly.client.gui.SettingsMenu; import pp.monopoly.client.gui.SettingsMenu;
import pp.monopoly.client.gui.StartMenu; import pp.monopoly.client.gui.StartMenu;
import pp.monopoly.client.gui.TestWorld;
import pp.monopoly.client.gui.popups.*;
import pp.monopoly.game.client.ClientGameLogic; import pp.monopoly.game.client.ClientGameLogic;
import pp.monopoly.game.client.MonopolyClient; import pp.monopoly.game.client.MonopolyClient;
import pp.monopoly.game.client.ServerConnection; import pp.monopoly.game.client.ServerConnection;
import pp.monopoly.message.client.NotificationAnswer;
import pp.monopoly.notification.ClientStateEvent; import pp.monopoly.notification.ClientStateEvent;
import pp.monopoly.notification.GameEventListener; import pp.monopoly.notification.GameEventListener;
import pp.monopoly.notification.InfoTextEvent; import pp.monopoly.notification.InfoTextEvent;
@ -121,10 +123,22 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
*/ */
private final ActionListener escapeListener = (name, isPressed, tpf) -> escape(isPressed); private final ActionListener escapeListener = (name, isPressed, tpf) -> escape(isPressed);
/** //TODO temp for testing
* Listener for handeling Demo Mode (Minas mode) private EventCardPopup eventCard;
*/ private BuildingPropertyCard buildingProperty;
private final ActionListener f8Listener = (name, isPressed, tpf) -> handleF8(isPressed); private FoodFieldCard foodField;
private GateFieldCard gateField;
private LooserPopUp looserpopup;
private Bankrupt bankrupt;
private TimeOut timeOut;
private SellHouse sellHouse;
private BuyHouse buyHouse;
private TakeMortage takeMortage;
private RepayMortage repayMortage;
private boolean isBuyCardPopupOpen = false;
private final ActionListener BListener = (name, isPressed, tpf) -> handleB(isPressed);
private TestWorld testWorld;
static { static {
// Configure logging // Configure logging
@ -253,20 +267,20 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
inputManager.setCursorVisible(false); inputManager.setCursorVisible(false);
inputManager.addMapping(ESC, new KeyTrigger(KeyInput.KEY_ESCAPE)); inputManager.addMapping(ESC, new KeyTrigger(KeyInput.KEY_ESCAPE));
inputManager.addMapping(CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addMapping(CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addMapping("F8", new KeyTrigger(KeyInput.KEY_F8));
inputManager.addListener(f8Listener, "F8");
inputManager.addListener(escapeListener, ESC); inputManager.addListener(escapeListener, ESC);
//TODO tmp for testing
// inputManager.addMapping("B", new KeyTrigger(KeyInput.KEY_B));
// inputManager.addListener(BListener, "B");
// inputManager.addMapping("T", new KeyTrigger(KeyInput.KEY_T));
} }
/** //logik zum wechselnden erscheinen und verschwinden beim drücken von B //TODO später entfernen
* Handles the action on alt m for demo mode private void handleB(boolean isPressed) {
* @param isPressed {@code true} is alt + m is pressed, {@code false} otherwise
*/
private void handleF8(boolean isPressed) {
if (isPressed) { if (isPressed) {
LOGGER.log(Level.INFO, "F detected."); // Debug logging Dialog tmp = new GulagInfo(this, 3);
getGameLogic().send(new NotificationAnswer("hack")); tmp.open();
} }
} }
@ -319,6 +333,11 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
dialogManager.update(tpf); dialogManager.update(tpf);
logic.update(tpf); logic.update(tpf);
stateManager.update(tpf); stateManager.update(tpf);
// //TODO testing replace later
// if (testWorld != null) {
// testWorld.update(tpf);
// }
} }
/** /**

View File

@ -103,8 +103,6 @@ public class Toolbar extends Dialog implements GameEventListener {
*/ */
private volatile DiceRollEvent latestDiceRollEvent = null; private volatile DiceRollEvent latestDiceRollEvent = null;
private boolean bankruptPopUp = false;
/** /**
* Constructs the toolbar for the Monopoly application. * Constructs the toolbar for the Monopoly application.
* <p> * <p>
@ -258,11 +256,9 @@ public class Toolbar extends Dialog implements GameEventListener {
endTurnButton.setPreferredSize(new Vector3f(150, 50, 0)); endTurnButton.setPreferredSize(new Vector3f(150, 50, 0));
endTurnButton.addClickCommands(s -> ifTopDialog(() -> { endTurnButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
if (app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getAccountBalance() < 0 && !bankruptPopUp) { if (app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getAccountBalance() < 0) {
new Bankrupt(app).open(); new Bankrupt(app).open();
bankruptPopUp = true;
} else { } else {
bankruptPopUp = false;
app.getGameLogic().send(new EndTurn()); app.getGameLogic().send(new EndTurn());
receivedEvent(new ButtonStatusEvent(false)); receivedEvent(new ButtonStatusEvent(false));
} }