aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-05-31 14:58:25 +0200
committerPacien TRAN-GIRARD2014-05-31 14:58:25 +0200
commit7c9796cba1f9f066ea9a83411a38b3adb760923d (patch)
tree33431248b0cd2ddfda29ad187b2b1724168f5149 /src
parent571341a851d7ee464c60620331ca726d6b417b36 (diff)
downloadesieequest-7c9796cba1f9f066ea9a83411a38b3adb760923d.tar.gz
Display items in locations
Diffstat (limited to 'src')
-rw-r--r--src/esieequest/ui/rich/UserInterface.java8
-rw-r--r--src/esieequest/ui/web/WebInterface.java8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/esieequest/ui/rich/UserInterface.java b/src/esieequest/ui/rich/UserInterface.java
index e8fbbc7..c743d68 100644
--- a/src/esieequest/ui/rich/UserInterface.java
+++ b/src/esieequest/ui/rich/UserInterface.java
@@ -600,7 +600,13 @@ abstract class UserInterface implements Viewable, ActionListener {
600 @Override 600 @Override
601 public void updateLocation(final Room room, final Direction direction, final Side side, 601 public void updateLocation(final Room room, final Direction direction, final Side side,
602 final boolean canGoBack) { 602 final boolean canGoBack) {
603 this.setIllustration(room.name() + Text.FILENAME_SEPARATOR.toString() + direction.name()); 603 String locationImageName = room.name() + Text.FILENAME_SEPARATOR.toString()
604 + direction.name();
605 if (side.getInventory().getSize() > 0) {
606 locationImageName += Text.FILENAME_SEPARATOR.toString()
607 + side.getInventory().getItem().name();
608 }
609 this.setIllustration(locationImageName);
604 this.backButton.setEnabled(canGoBack); 610 this.backButton.setEnabled(canGoBack);
605 this.forwardButton.setEnabled(side.hasDoor()); 611 this.forwardButton.setEnabled(side.hasDoor());
606 this.actionButton.setEnabled(side.hasCharacter() || (side.getInventory().getSize() > 0)); 612 this.actionButton.setEnabled(side.hasCharacter() || (side.getInventory().getSize() > 0));
diff --git a/src/esieequest/ui/web/WebInterface.java b/src/esieequest/ui/web/WebInterface.java
index c407d47..aa70317 100644
--- a/src/esieequest/ui/web/WebInterface.java
+++ b/src/esieequest/ui/web/WebInterface.java
@@ -399,7 +399,13 @@ class WebInterface extends Composite implements Viewable {
399 @Override 399 @Override
400 public void updateLocation(final Room room, final Direction direction, final Side side, 400 public void updateLocation(final Room room, final Direction direction, final Side side,
401 final boolean canGoBack) { 401 final boolean canGoBack) {
402 this.setIllustration(room.name() + Text.FILENAME_SEPARATOR.toString() + direction.name()); 402 String locationImageName = room.name() + Text.FILENAME_SEPARATOR.toString()
403 + direction.name();
404 if (side.getInventory().getSize() > 0) {
405 locationImageName += Text.FILENAME_SEPARATOR.toString()
406 + side.getInventory().getItem().name();
407 }
408 this.setIllustration(locationImageName);
403 this.backButton.setEnabled(canGoBack); 409 this.backButton.setEnabled(canGoBack);
404 this.forwardButton.setEnabled(side.hasDoor()); 410 this.forwardButton.setEnabled(side.hasDoor());
405 this.actionButton.setEnabled(side.hasCharacter() || (side.getInventory().getSize() > 0)); 411 this.actionButton.setEnabled(side.hasCharacter() || (side.getInventory().getSize() > 0));