mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 22:39:19 +00:00
Show a red alert frame when the player is betrayed (#1195)
## Description: With the alert frame, we're notified and can view the event using a “Focus” button that moves the map to the traitor, or dismiss it with a “Dismiss” button. The alert auto-dismisses after a few seconds. **Because this feature provides an advantage, the trade-off is having to wait a full 10 seconds or manually clicking “Dismiss” to close it.** - Show a red alert frame animation when the player is betrayed. - ~~The alert frame can be dismissed manually.~~ - The alert frame is automatically dismissed after ~~10~~ 3 seconds. - If the user doesn’t want to see it at all, they can disable it in the settings.     ## 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 - [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: This is my first PR let me know if anything needs improvement! devalnor
This commit is contained in:
@@ -102,6 +102,15 @@ export class UserSettingModal extends LitElement {
|
||||
console.log("🤡 Emojis:", enabled ? "ON" : "OFF");
|
||||
}
|
||||
|
||||
private toggleAlertFrame(e: CustomEvent<{ checked: boolean }>) {
|
||||
const enabled = e.detail?.checked;
|
||||
if (typeof enabled !== "boolean") return;
|
||||
|
||||
this.userSettings.set("settings.alertFrame", enabled);
|
||||
|
||||
console.log("🚨 Alert frame:", enabled ? "ON" : "OFF");
|
||||
}
|
||||
|
||||
private toggleFxLayer(e: CustomEvent<{ checked: boolean }>) {
|
||||
const enabled = e.detail?.checked;
|
||||
if (typeof enabled !== "boolean") return;
|
||||
@@ -244,6 +253,15 @@ export class UserSettingModal extends LitElement {
|
||||
@change=${this.toggleEmojis}
|
||||
></setting-toggle>
|
||||
|
||||
<!-- 🚨 Alert frame -->
|
||||
<setting-toggle
|
||||
label="${translateText("user_setting.alert_frame_label")}"
|
||||
description="${translateText("user_setting.alert_frame_desc")}"
|
||||
id="alert-frame-toggle"
|
||||
.checked=${this.userSettings.alertFrame()}
|
||||
@change=${this.toggleAlertFrame}
|
||||
></setting-toggle>
|
||||
|
||||
<!-- 💥 Special effects -->
|
||||
<setting-toggle
|
||||
label="${translateText("user_setting.special_effects_label")}"
|
||||
|
||||
Reference in New Issue
Block a user