mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 00:02:26 +00:00
Improve Notification Panel (#3913)
Resolves #3910 ## Description: - Split the events HUD into two components: a new **`<actionable-events>`** that owns alliance prompts (request / renew) and a slimmed-down **`<events-display>`** for everything else. - Reworked `<events-display>` into two visual tiers: dim/scrolling tier 2 on top (trade results, unit losses, donations, alliance status), prominent tier 1 anchored at the bottom (inbound nukes, naval invasion, attack requests, alliance broken, conquered player, chat). Tier 2 caps at the 4 newest entries; events expire after 8s. - Added a transient **+gold pip** above the gold pill in `<control-panel>`, animated with a small fade-in. Fires for trade ships, trains, donations, and conquest. Trade-ship and train arrivals are removed from the events scroll since they're surfaced here instead. - New `MessageType.NUKE_DETONATED` and a server-side emission in `NukeExecution.detonate` — once an inbound nuke lands or gets intercepted, the inbound warning vanishes and a "detonated" entry takes its place. - `displayMessage` gained optional `unitID` and `focusPlayerID` params so events can link to a unit or a player. Unit captures and destructions now navigate to the unit's last tile when clicked; donations navigate to the other player. - ActionableEvents card width matches `<events-display>`; cards persist until the user clicks Accept/Reject/Renew/Ignore or the server-side request timeout expires. - Removed the in-events category filter UI and the gold-amount banner — `<events-display>` is now a lightweight log that hides entirely when empty. <img width="570" height="444" alt="Screenshot 2026-05-21 at 1 42 30 PM" src="https://github.com/user-attachments/assets/f103efb3-0e11-4b72-a11b-91ff6896177c" /> <img width="430" height="296" alt="Screenshot 2026-05-21 at 1 41 34 PM" src="https://github.com/user-attachments/assets/ae58475a-b252-4aa6-9ce5-99dea7575ce3" /> ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -35,16 +35,6 @@ export const GameUpdateType = {
|
||||
NukeDetonation: 22,
|
||||
} as const;
|
||||
|
||||
/** MessageType enum values from the game source. */
|
||||
export const MessageType = {
|
||||
SAM_HIT: 9,
|
||||
SENT_GOLD_TO_PLAYER: 18,
|
||||
RECEIVED_GOLD_FROM_PLAYER: 19,
|
||||
RECEIVED_GOLD_FROM_TRADE: 20,
|
||||
SENT_TROOPS_TO_PLAYER: 21,
|
||||
RECEIVED_TROOPS_FROM_PLAYER: 22,
|
||||
} as const;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Typed update payloads (keyed by GameUpdateType values)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -61,7 +61,7 @@ export type {
|
||||
} from "./Replay";
|
||||
|
||||
// Game update type constants and event payloads (shared between shim + codec)
|
||||
export { GameUpdateType, MessageType } from "./GameUpdates";
|
||||
export { GameUpdateType } from "./GameUpdates";
|
||||
export type {
|
||||
AllianceExpiredUpdate,
|
||||
AllianceReplyUpdate,
|
||||
|
||||
Reference in New Issue
Block a user