mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:50:42 +00:00
## Description: . #744 became a mess. Rewrote it  ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: dovg
This commit is contained in:
@@ -402,6 +402,7 @@
|
||||
"player_panel": {
|
||||
"gold": "Gold",
|
||||
"troops": "Troops",
|
||||
"betrayals": "Number of betrayals",
|
||||
"traitor": "Traitor",
|
||||
"alliance_time_remaining": "Time Remaining",
|
||||
"embargo": "Stopped trading with you",
|
||||
|
||||
@@ -308,6 +308,16 @@ export class PlayerPanel extends LitElement implements Layer {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Betrayals -->
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-white text-opacity-80 text-sm px-2">
|
||||
${translateText("player_panel.betrayals")}
|
||||
</div>
|
||||
<div class="bg-opacity-50 bg-gray-700 rounded p-2 text-white">
|
||||
${other.data.betrayals ?? 0}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Embargo -->
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-white text-opacity-80 text-sm px-2">
|
||||
|
||||
@@ -118,6 +118,7 @@ export interface PlayerUpdate {
|
||||
incomingAttacks: AttackUpdate[];
|
||||
outgoingAllianceRequests: PlayerID[];
|
||||
hasSpawned: boolean;
|
||||
betrayals?: number;
|
||||
}
|
||||
|
||||
export interface AllianceRequestUpdate {
|
||||
|
||||
@@ -123,6 +123,7 @@ export class PlayerImpl implements Player {
|
||||
const outgoingAllianceRequests = this.outgoingAllianceRequests().map((ar) =>
|
||||
ar.recipient().id(),
|
||||
);
|
||||
const stats = this.mg.stats().getPlayerStats(this);
|
||||
|
||||
return {
|
||||
type: GameUpdateType.Player,
|
||||
@@ -169,6 +170,7 @@ export class PlayerImpl implements Player {
|
||||
),
|
||||
outgoingAllianceRequests: outgoingAllianceRequests,
|
||||
hasSpawned: this.hasSpawned(),
|
||||
betrayals: stats?.betrayals,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user