mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:20:45 +00:00
events dissappear after 10s
This commit is contained in:
@@ -128,8 +128,9 @@
|
||||
* comfirm alliance DONE 9/20/2024
|
||||
* create event box DONE 9/20/2024
|
||||
* BUG: left click lost after right click DONE 9/20/2024
|
||||
* make fake humans easier
|
||||
* eventbox events dissapear after timeout DONE 9/20/2024
|
||||
* first place has crown
|
||||
* make fake humans easier
|
||||
* BUG: FakeHuman don't be enemy if don't share border
|
||||
* BUG: when send boat only captures one pixel
|
||||
* store cookies
|
||||
|
||||
@@ -167,7 +167,7 @@ export class ClientGame {
|
||||
}
|
||||
this.isProcessingTurn = true
|
||||
this.gs.addExecution(...this.executor.createExecs(this.turns[this.currTurn]))
|
||||
this.gs.tick()
|
||||
this.gs.executeNextTick()
|
||||
this.renderer.tick()
|
||||
this.currTurn++
|
||||
this.isProcessingTurn = false
|
||||
|
||||
@@ -19,6 +19,7 @@ interface Event {
|
||||
action: () => void
|
||||
}[];
|
||||
highlight?: boolean;
|
||||
createdAt: number
|
||||
}
|
||||
|
||||
export class EventsDisplay implements Layer {
|
||||
@@ -43,6 +44,14 @@ export class EventsDisplay implements Layer {
|
||||
}
|
||||
|
||||
tick() {
|
||||
const remainingEvent: Event[] = []
|
||||
for (const event of this.events) {
|
||||
if (this.game.ticks() - event.createdAt < 100) {
|
||||
remainingEvent.push(event)
|
||||
}
|
||||
}
|
||||
this.events = remainingEvent
|
||||
this.renderTable()
|
||||
}
|
||||
|
||||
private createTableContainer() {
|
||||
@@ -87,7 +96,8 @@ export class EventsDisplay implements Layer {
|
||||
action: () => this.eventBus.emit(new AllianceRequestReplyUIEvent(event.allianceRequest, false)),
|
||||
}
|
||||
],
|
||||
highlight: true
|
||||
highlight: true,
|
||||
createdAt: this.game.ticks()
|
||||
});
|
||||
this.renderTable()
|
||||
}
|
||||
@@ -101,10 +111,10 @@ export class EventsDisplay implements Layer {
|
||||
if (event.allianceRequest.requestor() != myPlayer) {
|
||||
return
|
||||
}
|
||||
|
||||
this.addEvent({
|
||||
description: `${event.allianceRequest.recipient().name()} ${event.accepted ? "accepted" : "rejected"} your alliance request`,
|
||||
highlight: true
|
||||
highlight: true,
|
||||
createdAt: this.game.ticks(),
|
||||
});
|
||||
this.renderTable()
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ export interface Game {
|
||||
forEachTile(fn: (tile: Tile) => void): void
|
||||
executions(): ExecutionView[]
|
||||
terraNullius(): TerraNullius
|
||||
tick(): void
|
||||
executeNextTick(): void
|
||||
ticks(): number
|
||||
inSpawnPhase(): boolean
|
||||
addExecution(...exec: Execution[]): void
|
||||
|
||||
@@ -85,7 +85,7 @@ export class GameImpl implements MutableGame {
|
||||
return this._ticks
|
||||
}
|
||||
|
||||
tick() {
|
||||
executeNextTick() {
|
||||
this.execs.forEach(e => {
|
||||
if (e.isActive() && (!this.inSpawnPhase() || e.activeDuringSpawnPhase())) {
|
||||
e.tick(this._ticks)
|
||||
|
||||
Reference in New Issue
Block a user