merge dev into test #33
@@ -118,8 +118,11 @@ else if(boardSelect != null) {
|
|||||||
}
|
}
|
||||||
if(name.equals("Test") &&isPressed){
|
if(name.equals("Test") &&isPressed){
|
||||||
if(app.getView() instanceof GameView gameView){
|
if(app.getView() instanceof GameView gameView){
|
||||||
// app.getNotificationSynchronizer().addTestNotification(new FinishNotification(Color.NAVY));
|
gameView.getGuiHandler().rollRankingResult(Color.AIRFORCE, 1);
|
||||||
// app.getNotificationSynchronizer().addTestNotification(new MovePieceNotification());
|
gameView.getGuiHandler().rollRankingResult(Color.ARMY, 2);
|
||||||
|
gameView.getGuiHandler().rollRankingResult(Color.NAVY, 3);
|
||||||
|
gameView.getGuiHandler().rollRankingResult(Color.CYBER, 4);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public void simpleInitApp() {
|
|||||||
gameView = new GameView(this);
|
gameView = new GameView(this);
|
||||||
ceremonyView = new CeremonyView(this);
|
ceremonyView = new CeremonyView(this);
|
||||||
|
|
||||||
enter(MdgaState.GAME);
|
enter(MdgaState.MAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,19 +10,20 @@
|
|||||||
import pp.mdga.client.animation.ZoomControl;
|
import pp.mdga.client.animation.ZoomControl;
|
||||||
import pp.mdga.game.Color;
|
import pp.mdga.game.Color;
|
||||||
|
|
||||||
public class ActionTextHandler {
|
class ActionTextHandler {
|
||||||
private Node root;
|
private Node root;
|
||||||
private BitmapFont font;
|
private BitmapFont font;
|
||||||
private AppSettings appSettings;
|
private AppSettings appSettings;
|
||||||
|
private int ranking;
|
||||||
|
|
||||||
public ActionTextHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings){
|
ActionTextHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings){
|
||||||
root = new Node("actionTextRoot");
|
root = new Node("actionTextRoot");
|
||||||
guiNode.attachChild(root);
|
guiNode.attachChild(root);
|
||||||
|
|
||||||
root.setLocalTranslation(center(appSettings.getWidth(), appSettings.getHeight(), Vector3f.ZERO));
|
root.setLocalTranslation(center(appSettings.getWidth(), appSettings.getHeight(), Vector3f.ZERO));
|
||||||
font = assetManager.loadFont("Fonts/Gunplay.fnt");
|
font = assetManager.loadFont("Fonts/Gunplay.fnt");
|
||||||
this.appSettings = appSettings;
|
this.appSettings = appSettings;
|
||||||
|
ranking = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Node createTextWithSpacing(String[] textArr, float spacing, float size, ColorRGBA[] colorArr) {
|
private Node createTextWithSpacing(String[] textArr, float spacing, float size, ColorRGBA[] colorArr) {
|
||||||
@@ -74,48 +75,48 @@ private Vector3f centerText(float width, float height, Vector3f pos){
|
|||||||
return center(-width, height, pos);
|
return center(-width, height, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void activePlayer(String name, Color color){
|
void activePlayer(String name, Color color){
|
||||||
createTopText(new String[]{name," ist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
createTopText(new String[]{name," ist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ownActive(Color color){
|
void ownActive(Color color){
|
||||||
createTopText(new String[]{"Du"," bist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
createTopText(new String[]{"Du"," bist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void diceNum(int diceNum, String name, Color color){
|
void diceNum(int diceNum, String name, Color color){
|
||||||
createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0);
|
createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0);
|
||||||
|
|
||||||
createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 100);
|
createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 100);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void diceNumMult(int diceNum,int mult, String name, Color color){
|
void diceNumMult(int diceNum,int mult, String name, Color color){
|
||||||
createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0);
|
createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0);
|
||||||
|
|
||||||
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 100);
|
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ownDice(int diceNum){
|
void ownDice(int diceNum){
|
||||||
createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 0);
|
createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ownDiceMult(int diceNum, int mult){
|
void ownDiceMult(int diceNum, int mult){
|
||||||
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 0);
|
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawCard(String name, Color color){
|
void drawCard(String name, Color color){
|
||||||
createTopText(new String[]{name," erhält eine Bonuskarte"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
createTopText(new String[]{name," erhält eine Bonuskarte"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawCardOwn(Color color){
|
void drawCardOwn(Color color){
|
||||||
createTopText(new String[]{"Du"," erhälst eine Bonuskarte"}, 5,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
createTopText(new String[]{"Du"," erhälst eine Bonuskarte"}, 5,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishText(String name, Color color){
|
void finishText(String name, Color color){
|
||||||
createTopText(new String[]{name," ist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
createTopText(new String[]{name," ist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishTextOwn(Color color){
|
void finishTextOwn(Color color){
|
||||||
createTopText(new String[]{"Du", " bist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
createTopText(new String[]{"Du", " bist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,9 +132,22 @@ private ColorRGBA playerColorToColorRGBA(Color color){
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hide(){
|
void hide(){
|
||||||
|
ranking = 0;
|
||||||
root.detachAllChildren();
|
root.detachAllChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float paddingRanked = 100;
|
||||||
|
|
||||||
|
void rollRankingResult(String name, Color color, int eye){
|
||||||
|
createTopText(new String[]{name,": "+eye}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, paddingRanked*ranking);
|
||||||
|
ranking++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rollRankingResultOwn(Color color, int eye){
|
||||||
|
createTopText(new String[]{"Du",": "+eye}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, paddingRanked*ranking);
|
||||||
|
ranking++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,5 +134,10 @@ public void finish(Color color){
|
|||||||
else actionTextHandler.finishText(playerNameHandler.getName(color), color);
|
else actionTextHandler.finishText(playerNameHandler.getName(color), color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void rollRankingResult(Color color, int eye){
|
||||||
|
if(ownColor == color) actionTextHandler.rollRankingResultOwn(color, eye);
|
||||||
|
else actionTextHandler.rollRankingResult(playerNameHandler.getName(color), color, eye);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ public void setActivePlayer(Color color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName(Color color){
|
public String getName(Color color){
|
||||||
|
if(!colorNameMap.containsKey(color)) throw new RuntimeException("color is not in colorNameMap");
|
||||||
return colorNameMap.get(color);
|
return colorNameMap.get(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,8 +65,12 @@ public void onEnter() {
|
|||||||
|
|
||||||
app.getAcousticHandler().playSound(MdgaSound.START);
|
app.getAcousticHandler().playSound(MdgaSound.START);
|
||||||
|
|
||||||
app.getNotificationSynchronizer().addTestNotification(new AcquireCardNotification(BonusCard.SHIELD));
|
// guiHandler.addPlayer(Color.AIRFORCE, "Cedric");
|
||||||
app.getNotificationSynchronizer().addTestNotification(new SelectableCardsNotification(List.of(BonusCard.SHIELD)));
|
// guiHandler.addPlayer(Color.ARMY, "Ben");
|
||||||
|
// guiHandler.addPlayer(Color.CYBER, "Felix");
|
||||||
|
// guiHandler.addPlayer(Color.NAVY, "Daniel");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user