trigger demo mode

This commit is contained in:
Johannes Schmelz 2024-12-03 00:12:22 +01:00
parent b01bb3cf7b
commit 6db96f0a1d

View File

@ -30,18 +30,16 @@ 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;
@ -123,22 +121,10 @@ 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 /**
private EventCardPopup eventCard; * Listener for handeling Demo Mode (Minas mode)
private BuildingPropertyCard buildingProperty; */
private FoodFieldCard foodField; private final ActionListener f8Listener = (name, isPressed, tpf) -> handleF8(isPressed);
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
@ -267,20 +253,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 /**
private void handleB(boolean isPressed) { * Handles the action on alt m for demo mode
* @param isPressed {@code true} is alt + m is pressed, {@code false} otherwise
*/
private void handleF8(boolean isPressed) {
if (isPressed) { if (isPressed) {
Dialog tmp = new GulagInfo(this, 3); LOGGER.log(Level.INFO, "F detected."); // Debug logging
tmp.open(); getGameLogic().send(new NotificationAnswer("hack"));
} }
} }
@ -333,11 +319,6 @@ 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);
// }
} }
/** /**