|
@@ -19,6 +19,8 @@ import model.tiles.InteractiveTileModel;
|
|
|
import model.tiles.InteractiveTileType;
|
|
import model.tiles.InteractiveTileType;
|
|
|
import util.GAMESTATE;
|
|
import util.GAMESTATE;
|
|
|
import view.GamePanel;
|
|
import view.GamePanel;
|
|
|
|
|
+import view.sound.SoundManager;
|
|
|
|
|
+
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
@@ -199,6 +201,7 @@ public class GameController implements Runnable, Serializable {
|
|
|
* @param y screen y-coordinate of click
|
|
* @param y screen y-coordinate of click
|
|
|
*/
|
|
*/
|
|
|
public void handleInventoryClick(int x, int y) {
|
|
public void handleInventoryClick(int x, int y) {
|
|
|
|
|
+ SoundManager.getInstance().playSound(SoundManager.SOUNDS.CLICK);
|
|
|
int slot = view.getInventoryView().getClickedInventorySlot(x, y);
|
|
int slot = view.getInventoryView().getClickedInventorySlot(x, y);
|
|
|
getModel().getInventory().select(slot);
|
|
getModel().getInventory().select(slot);
|
|
|
}
|
|
}
|
|
@@ -211,6 +214,7 @@ public class GameController implements Runnable, Serializable {
|
|
|
*/
|
|
*/
|
|
|
public void handleShopClick(int x, int y) {
|
|
public void handleShopClick(int x, int y) {
|
|
|
InteractiveTileController controller = view.getShopView().getClickedOffer(x, y);
|
|
InteractiveTileController controller = view.getShopView().getClickedOffer(x, y);
|
|
|
|
|
+ if(controller != null) SoundManager.getInstance().loopSound(SoundManager.SOUNDS.MOVING_BUSH);
|
|
|
shopController.setDraggingOffer(controller);
|
|
shopController.setDraggingOffer(controller);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -412,8 +416,8 @@ public class GameController implements Runnable, Serializable {
|
|
|
* Called from GameMouseListener.mouseReleased when ending a drag.
|
|
* Called from GameMouseListener.mouseReleased when ending a drag.
|
|
|
* Snaps the tile to grid, validates position, reverts if invalid.
|
|
* Snaps the tile to grid, validates position, reverts if invalid.
|
|
|
*/
|
|
*/
|
|
|
- public void handleTileRelease(int mouseX, int mouseY) {
|
|
|
|
|
- getView().tileManager.handleTileRelease(mouseX, mouseY);
|
|
|
|
|
|
|
+ public void handleTileRelease() {
|
|
|
|
|
+ getView().tileManager.handleTileRelease();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|