Skip to content

Commit

Permalink
Merge pull request #119 from booksaw/GoldShopFix
Browse files Browse the repository at this point in the history
Fix Gold Shop
  • Loading branch information
booksaw authored May 3, 2022
2 parents 6d965cc + 09c3761 commit 381ad7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/main/java/com/mygdx/pirategame/save/GameScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -916,10 +916,9 @@ public void openShop() {
* Closes gold shop
*/
public void closeShop() {
goldShop = new GoldShop(GameScreen.game, camera, this);
goldShop.show();
goldShop.hide();
goldShop = null;
table.setVisible(true);
pauseTable.setVisible(false);
resume();
}

Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/com/mygdx/pirategame/screen/GoldShop.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mygdx.pirategame.screen;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.OrthographicCamera;
Expand Down Expand Up @@ -73,6 +74,8 @@ public GoldShop(PirateGame pirateGame, OrthographicCamera camera, GameScreen gam

}

private InputProcessor processor;

/**
* Called when this screen becomes the current screen
*/
Expand All @@ -85,6 +88,7 @@ public void show() {
Skin skin = new Skin(Gdx.files.internal("skin/uiskin.json"));

//Set the input processor
processor = Gdx.input.getInputProcessor();
Gdx.input.setInputProcessor(stage);
// Create a table that fills the screen
Table table = new Table();
Expand Down Expand Up @@ -310,6 +314,7 @@ public void hide() {
healthBoostBtn.setDisabled(true);
increaseCannonDamageBtn.setDisabled(true);
closeButton.setDisabled(true);
Gdx.input.setInputProcessor(processor);
}

/**
Expand Down

0 comments on commit 381ad7c

Please sign in to comment.