Finish merge
This commit is contained in:
		@@ -2,6 +2,8 @@
 | 
			
		||||
 | 
			
		||||
import com.jme3.renderer.Camera;
 | 
			
		||||
import com.jme3.scene.Node;
 | 
			
		||||
import com.jme3.texture.FrameBuffer;
 | 
			
		||||
import com.jme3.texture.Image;
 | 
			
		||||
import com.jme3.texture.Texture2D;
 | 
			
		||||
import pp.mdga.client.MdgaApp;
 | 
			
		||||
import pp.mdga.game.Color;
 | 
			
		||||
@@ -15,9 +17,17 @@ public class GuiHandler {
 | 
			
		||||
    private final ActionTextHandler actionTextHandler;
 | 
			
		||||
    private final Color ownColor;
 | 
			
		||||
 | 
			
		||||
    public GuiHandler(MdgaApp app, Node guiNode, Texture2D backTexture, Color ownColor) {
 | 
			
		||||
    private FrameBuffer backFrameBuffer;
 | 
			
		||||
 | 
			
		||||
    public GuiHandler(MdgaApp app, Node guiNode, Color ownColor) {
 | 
			
		||||
        this.app = app;
 | 
			
		||||
        this.ownColor = ownColor;
 | 
			
		||||
 | 
			
		||||
        backFrameBuffer = new FrameBuffer(app.getCamera().getWidth(), app.getCamera().getHeight(), 1);
 | 
			
		||||
        Texture2D backTexture = new Texture2D(app.getCamera().getWidth(), app.getCamera().getHeight(), Image.Format.RGBA8);
 | 
			
		||||
        backFrameBuffer.setDepthTarget(FrameBuffer.FrameBufferTarget.newTarget(Image.Format.Depth));
 | 
			
		||||
        backFrameBuffer.addColorTarget(FrameBuffer.FrameBufferTarget.newTarget(backTexture));
 | 
			
		||||
 | 
			
		||||
        cardLayerHandler = new CardLayerHandler(app, backTexture);
 | 
			
		||||
        playerNameHandler = new PlayerNameHandler(guiNode, app.getAssetManager(), app.getContext().getSettings());
 | 
			
		||||
        actionTextHandler = new ActionTextHandler(guiNode, app.getAssetManager(), app.getContext().getSettings());
 | 
			
		||||
@@ -25,11 +35,12 @@ public GuiHandler(MdgaApp app, Node guiNode, Texture2D backTexture, Color ownCol
 | 
			
		||||
 | 
			
		||||
    public void init() {
 | 
			
		||||
        cardLayerHandler.init();
 | 
			
		||||
        app.getViewPort().setOutputFrameBuffer(backFrameBuffer);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void shutdown() {
 | 
			
		||||
        cardLayerHandler.shutdown();
 | 
			
		||||
 | 
			
		||||
        app.getViewPort().setOutputFrameBuffer(null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void rollDice(int rollNum, int mult) {
 | 
			
		||||
 
 | 
			
		||||
@@ -40,14 +40,7 @@ public GameView(MdgaApp app) {
 | 
			
		||||
        this.camera = new CameraHandler(app, fpp);
 | 
			
		||||
        this.boardHandler = new BoardHandler(app, rootNode, fpp);
 | 
			
		||||
 | 
			
		||||
        FrameBuffer backFrameBuffer = new FrameBuffer(app.getCamera().getWidth(), app.getCamera().getHeight(), 1);
 | 
			
		||||
        Texture2D backTexture = new Texture2D(app.getCamera().getWidth(), app.getCamera().getHeight(), Image.Format.RGBA8);
 | 
			
		||||
        backFrameBuffer.setDepthTarget(FrameBuffer.FrameBufferTarget.newTarget(Image.Format.Depth));
 | 
			
		||||
        backFrameBuffer.addColorTarget(FrameBuffer.FrameBufferTarget.newTarget(backTexture));
 | 
			
		||||
        app.getViewPort().setOutputFrameBuffer(backFrameBuffer);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        guiHandler = new GuiHandler(app, guiNode, backTexture, ownColor);
 | 
			
		||||
        guiHandler = new GuiHandler(app, guiNode, ownColor);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -110,4 +103,12 @@ public void setOwnColor(Color ownColor) {
 | 
			
		||||
    public Color getOwnColor() {
 | 
			
		||||
        return ownColor;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void needConfirm() {
 | 
			
		||||
        confirmButton.show();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void noConfirm() {
 | 
			
		||||
        confirmButton.hide();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user