diff --git a/css/app.css b/css/app.css index b9ad748..436fe50 100644 --- a/css/app.css +++ b/css/app.css @@ -39,20 +39,33 @@ #mapwrapper { text-align: center; overflow: auto; - height: 70vh; + height: 60vh; overflow-scrolling: auto; } -#mapwrapper::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); - border-radius: 10px; - background-color: #F5F5F5; -} - .tile { background-image: url('../img/tiles/grass.png'); } +.tile:hover { + opacity: 70%; +} + +.tilebutton { + height: 40px; + width: 35px; + margin: 0.5em; +} + +.deco-button { + background-image: url('../img/tiles/clear_hexagon.png'); + background-size: 100% 100%; +} + +.deco-button { + padding: 3px; +} + #mapwrapper.card-body { padding: 0; } diff --git a/img/tiles/clear_hexagon.png b/img/tiles/clear_hexagon.png new file mode 100644 index 0000000..b18e472 Binary files /dev/null and b/img/tiles/clear_hexagon.png differ diff --git a/img/tiles/environment/birch_1.png b/img/tiles/environment/birch_1.png deleted file mode 100644 index e69de29..0000000 diff --git a/img/tiles/environment/birch_2.png b/img/tiles/environment/birch_2.png deleted file mode 100644 index e69de29..0000000 diff --git a/img/tiles/environment/birch_3.png b/img/tiles/environment/birch_3.png deleted file mode 100644 index e69de29..0000000 diff --git a/img/tiles/environment/birch_4.png b/img/tiles/environment/birch_4.png deleted file mode 100644 index e69de29..0000000 diff --git a/img/tiles/structure/house_with_stall.png b/img/tiles/structure/lumberjack.png similarity index 100% rename from img/tiles/structure/house_with_stall.png rename to img/tiles/structure/lumberjack.png diff --git a/index.html b/index.html index b711190..38dd97b 100644 --- a/index.html +++ b/index.html @@ -12,23 +12,128 @@
';
+ }
+
+ return message;
+ },
+
+ initiateBuilding(building) {
+ this.selection = {
+ building: building
+ };
+ },
+
+ selectDecoration(item) {
+ this.selection = {
+ decoration: item
+ };
+ },
+
generateMap(rows, cols) {
let map = [];
@@ -266,9 +432,31 @@ let game = new Vue({
this.map[x-1][y-1] = tile;
},
- interactWithTile(tile) {
+ interactWithTile(tile, x, y) {
+ if (game.selection) {
+ if (game.selection.building) {
+ tile.asset = 'img/tiles/structure/' + game.selection.building.name.toLowerCase() + '.png';
+ tile.building = game.selection.building.name.toLowerCase();
+ this.selection = null;
+ }
+
+ if (game.selection.decoration) {
+ tile.asset = game.selection.decoration.path;
+ tile.building = null;
+ // decorations can only be cancelled by cancel button
+ }
+
+ if (game.selection.bulldozer) {
+ tile.asset = 'img/tiles/trans.png';
+ tile.building = null;
+ // bulldozer can only be cancelled by cancel button
+ }
+ }
+
if (tile.building) {
- this.sendNotification(tile.building);
+ this.modalBuilding = this.buildings[tile.building];
+ $('#buildingModal').modal('show');
+ this.$forceUpdate();
}
},