added clickDice Action + modelSync
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
import pp.mdga.client.board.OutlineControl;
|
||||
import pp.mdga.client.board.PieceControl;
|
||||
import pp.mdga.client.gui.CardControl;
|
||||
import pp.mdga.client.gui.DiceControl;
|
||||
import pp.mdga.client.view.GameView;
|
||||
import pp.mdga.game.BonusCard;
|
||||
import pp.mdga.game.Color;
|
||||
@@ -93,10 +94,15 @@ public void onAction(String name, boolean isPressed, float tpf) {
|
||||
}
|
||||
if(name.equals("Click") && isPressed) {
|
||||
if (app.getView() instanceof GameView gameView) {
|
||||
DiceControl diceSelect = checkHover(gameView.getGuiHandler().getCardLayerCamera(), gameView.getGuiHandler().getCardLayerRootNode(), DiceControl.class);
|
||||
CardControl cardLayerSelect = checkHover(gameView.getGuiHandler().getCardLayerCamera(), gameView.getGuiHandler().getCardLayerRootNode(), CardControl.class);
|
||||
OutlineControl boardSelect = checkHover(app.getCamera(), app.getRootNode(), OutlineControl.class);
|
||||
|
||||
if(cardLayerSelect != null) {
|
||||
if(diceSelect != null) {
|
||||
app.getModelSynchronize().rolledDice();
|
||||
gameView.getGuiHandler().hideText();
|
||||
}
|
||||
else if(cardLayerSelect != null) {
|
||||
//cardSelect
|
||||
if(cardLayerSelect.isSelectable()) gameView.getGuiHandler().selectCard(cardLayerSelect);
|
||||
}
|
||||
@@ -118,11 +124,11 @@ else if(boardSelect != null) {
|
||||
}
|
||||
if(name.equals("Test") &&isPressed){
|
||||
if(app.getView() instanceof GameView gameView){
|
||||
gameView.getGuiHandler().rollRankingResult(Color.AIRFORCE, 1);
|
||||
gameView.getGuiHandler().rollRankingResult(Color.ARMY, 2);
|
||||
gameView.getGuiHandler().rollRankingResult(Color.NAVY, 3);
|
||||
gameView.getGuiHandler().rollRankingResult(Color.CYBER, 4);
|
||||
|
||||
// gameView.getGuiHandler().rollRankingResult(Color.AIRFORCE, 1);
|
||||
// gameView.getGuiHandler().rollRankingResult(Color.ARMY, 2);
|
||||
// gameView.getGuiHandler().rollRankingResult(Color.NAVY, 3);
|
||||
// gameView.getGuiHandler().rollRankingResult(Color.CYBER, 4);
|
||||
gameView.getGuiHandler().showDice();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,5 +149,8 @@ void rollRankingResultOwn(Color color, int eye){
|
||||
ranking++;
|
||||
}
|
||||
|
||||
void diceNow(){
|
||||
createTopText("Klicke zum Würfeln", 5, 80, ColorRGBA.White, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ public void showRolledDice(int rollNum, Color color) {
|
||||
|
||||
public void showDice() {
|
||||
cardLayerHandler.showDice();
|
||||
actionTextHandler.diceNow();
|
||||
}
|
||||
|
||||
public void hideDice() {
|
||||
|
||||
Reference in New Issue
Block a user