diff --git a/tidal-harvest/src/app/core/game/TickMachine.ts b/tidal-harvest/src/app/core/game/TickMachine.ts index ff5dc03..8bbc27d 100644 --- a/tidal-harvest/src/app/core/game/TickMachine.ts +++ b/tidal-harvest/src/app/core/game/TickMachine.ts @@ -14,7 +14,6 @@ import {CropKey} from "../model/field/farm/crop/CropKey"; import {Crop} from "../model/field/farm/crop/Crop"; import {Silo} from "../model/field/farm/Silo"; import {Flood} from "./Flood"; -import {CropAmount} from "../model/economy/CropAmount"; export class TickMachine { @@ -49,7 +48,7 @@ export class TickMachine { }); this._tick.next(this._matrix); this._globalCrops.next(this.countCrops()); // probably calls #countCrops way too often (no time to fix) - if (counter % 60 === 0) { + if (counter % 10 === 0) { this._flood.next(new Flood(this._matrix, this._gameObjects).flood()) } }, 1000); diff --git a/tidal-harvest/src/app/core/service/ui.service.ts b/tidal-harvest/src/app/core/service/ui.service.ts index 873f1e9..9aa0707 100644 --- a/tidal-harvest/src/app/core/service/ui.service.ts +++ b/tidal-harvest/src/app/core/service/ui.service.ts @@ -37,11 +37,16 @@ export class UiService { } public getFloodMatrix(): Observable { - this.flood.next(this.floodMatrix) - return this.flood; + return this.game.flood(); } public triggerFlood(): void { this.flood.next(this.floodMatrix) } + + public collectCrops(x: number, y: number) { + console.log("collect crops at: " + x + ";" + y); + } + + } diff --git a/tidal-harvest/src/app/ui/grid/ship/ship.component.html b/tidal-harvest/src/app/ui/grid/ship/ship.component.html index 9d76f6f..fc294fb 100644 --- a/tidal-harvest/src/app/ui/grid/ship/ship.component.html +++ b/tidal-harvest/src/app/ui/grid/ship/ship.component.html @@ -1 +1,4 @@ -ship +ship + +

Ganz toller Shop Content!!

+
diff --git a/tidal-harvest/src/app/ui/grid/ship/ship.component.ts b/tidal-harvest/src/app/ui/grid/ship/ship.component.ts index ee1502d..d76543e 100644 --- a/tidal-harvest/src/app/ui/grid/ship/ship.component.ts +++ b/tidal-harvest/src/app/ui/grid/ship/ship.component.ts @@ -7,7 +7,6 @@ import { Component } from '@angular/core'; }) export class ShipComponent { - onShipClick() { - alert("SHOP!!"); - } + showShop: boolean = false; + } diff --git a/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.html b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.html new file mode 100644 index 0000000..0295362 --- /dev/null +++ b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.html @@ -0,0 +1,5 @@ + diff --git a/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.scss b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.scss new file mode 100644 index 0000000..d96d904 --- /dev/null +++ b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.scss @@ -0,0 +1,29 @@ +:host { + position: fixed; + top: 0; + left: 0; + z-index: 16; + background-color: #0006; + width: 100%; + height: 100vh; +} + +.popup-container { + background-image: url("/assets/ui/popup_big.png"); + width: 500px; + background-size: 100%; + height: 284px; + margin: 23vh auto; + color: black; + padding: 10px 40px; + + h1 { + text-align: center; + } +} + +.close-btn { + margin-left: 494px; + margin-top: 9px; + position: absolute; +} diff --git a/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.spec.ts b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.spec.ts new file mode 100644 index 0000000..1e87184 --- /dev/null +++ b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BigPopupComponent } from './big-popup.component'; + +describe('BigPopupComponent', () => { + let component: BigPopupComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [BigPopupComponent] + }); + fixture = TestBed.createComponent(BigPopupComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.ts b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.ts new file mode 100644 index 0000000..e37fe17 --- /dev/null +++ b/tidal-harvest/src/app/ui/shared/popup/big-popup/big-popup.component.ts @@ -0,0 +1,15 @@ +import {Component, EventEmitter, Input, Output} from '@angular/core'; + +@Component({ + selector: 'th-big-popup', + templateUrl: './big-popup.component.html', + styleUrls: ['./big-popup.component.scss'] +}) +export class BigPopupComponent { + @Input() popupTitle: string = "Mitteilung"; + @Output() close: EventEmitter = new EventEmitter(); + + onClose() { + this.close.emit(); + } +} diff --git a/tidal-harvest/src/app/ui/shared/popup/field-popup/farmer-popup/farmer-popup.component.html b/tidal-harvest/src/app/ui/shared/popup/field-popup/farmer-popup/farmer-popup.component.html index 6d20af2..0bf8d45 100644 --- a/tidal-harvest/src/app/ui/shared/popup/field-popup/farmer-popup/farmer-popup.component.html +++ b/tidal-harvest/src/app/ui/shared/popup/field-popup/farmer-popup/farmer-popup.component.html @@ -6,6 +6,7 @@ - Select + Auswählen + Sammeln diff --git a/tidal-harvest/src/app/ui/shared/popup/field-popup/field-popup.component.scss b/tidal-harvest/src/app/ui/shared/popup/field-popup/field-popup.component.scss index c45a491..85f192d 100644 --- a/tidal-harvest/src/app/ui/shared/popup/field-popup/field-popup.component.scss +++ b/tidal-harvest/src/app/ui/shared/popup/field-popup/field-popup.component.scss @@ -41,23 +41,10 @@ font-weight: normal; margin-left: 4px; } +} - .close-btn { - background-image: url("/assets/ui/close_btn.png"); - background-size: 100%; - width: 20px; - height: 20px; - padding: 0; - margin: 0; - background-color: transparent; - border: none; - position: absolute; - top: -6px; - left: 93px; - cursor: pointer; - - &:hover { - filter: brightness(1.3); - } - } +.close-btn { + position: absolute; + top: -6px; + left: 93px; } diff --git a/tidal-harvest/src/app/ui/shared/shared.module.ts b/tidal-harvest/src/app/ui/shared/shared.module.ts index cd79dea..8ccb7ee 100644 --- a/tidal-harvest/src/app/ui/shared/shared.module.ts +++ b/tidal-harvest/src/app/ui/shared/shared.module.ts @@ -10,6 +10,7 @@ import { ButtonComponent } from './button/button.component'; import {ReactiveFormsModule} from "@angular/forms"; import { WaterSourcePopupComponent } from './popup/field-popup/water-source-popup/water-source-popup.component'; import { SiloPopupComponent } from './popup/field-popup/silo-popup/silo-popup.component'; +import { BigPopupComponent } from './popup/big-popup/big-popup.component'; @@ -22,12 +23,14 @@ import { SiloPopupComponent } from './popup/field-popup/silo-popup/silo-popup.co WaterChannelPopupComponent, ButtonComponent, WaterSourcePopupComponent, - SiloPopupComponent + SiloPopupComponent, + BigPopupComponent ], exports: [ FieldPopupComponent, - ButtonComponent + ButtonComponent, + BigPopupComponent ], imports: [ CommonModule, diff --git a/tidal-harvest/src/app/ui/ui.component.html b/tidal-harvest/src/app/ui/ui.component.html index 79ea4e6..003ea92 100644 --- a/tidal-harvest/src/app/ui/ui.component.html +++ b/tidal-harvest/src/app/ui/ui.component.html @@ -1,10 +1,17 @@ -{{placing === FieldType.FARMER ? 'abbrechen' : 'Farmer setzen'}} -{{placing === FieldType.FARMLAND ? 'abbrechen' : 'Acker setzen'}} -{{placing === FieldType.ROCK ? 'abbrechen' : 'Stein setzen'}} -{{placing === FieldType.WATER_CHANNEL ? 'abbrechen' : 'Graben setzen'}} -{{placing === FieldType.SILO ? 'abbrechen' : 'Silo setzen'}} -
-Flut auslösen + +
+ {{placing === FieldType.FARMER ? 'abbrechen' : 'Farmer setzen'}} + {{placing === FieldType.FARMLAND ? 'abbrechen' : 'Acker setzen'}} + {{placing === FieldType.ROCK ? 'abbrechen' : 'Stein setzen'}} + {{placing === FieldType.WATER_CHANNEL ? 'abbrechen' : 'Graben setzen'}} + {{placing === FieldType.SILO ? 'abbrechen' : 'Silo setzen'}} +
+ Flut auslösen +
+ +