diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 64a83287..0ee177c2 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -371,7 +371,13 @@ "bottom_left": "Bottom left", "bottom_center": "Bottom center", "bottom_right": "Bottom right", - "enable_achievement_custom_notifications": "Enable achievement custom notifications" + "enable_achievement_custom_notifications": "Enable achievement custom notifications", + "alignment": "Alignment", + "variation": "Variation", + "default": "Default", + "rare": "Rare", + "platinum": "Platinum", + "hidden": "Hidden" }, "notifications": { "download_complete": "Download complete", diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index d9aa7376..a678a472 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -357,7 +357,13 @@ "bottom_left": "Inferior esquerdo", "bottom_right": "Inferior direito", "bottom_center": "Inferior central", - "achievement_custom_notification_position": "Posição das notificações customizadas de conquista" + "achievement_custom_notification_position": "Posição das notificações customizadas de conquista", + "alignment": "Alinhamento", + "variation": "Variação", + "default": "Padrão", + "rare": "Rara", + "platinum": "Platina", + "hidden": "Oculta" }, "notifications": { "download_complete": "Download concluído", diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 1ea5ea1d..ed540c03 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -366,23 +366,31 @@ export class WindowManager { this.loadNotificationWindowURL(); this.notificationWindow.once("ready-to-show", () => { - if (isStaging) { - this.notificationWindow?.webContents.openDevTools(); - } - if (showTestNotification) { - const language = userPreferences.language ?? "en"; setTimeout(() => { - this.notificationWindow?.webContents.send( - "on-achievement-unlocked", - userPreferences.achievementCustomNotificationPosition ?? "top_left", - [generateAchievementCustomNotificationTest(t, language)] - ); + this.showTestNotification(); }, 1000); } }); } + public static async showTestNotification() { + const userPreferences = await db.get( + levelKeys.userPreferences, + { + valueEncoding: "json", + } + ); + + const language = userPreferences.language ?? "en"; + + this.notificationWindow?.webContents.send( + "on-achievement-unlocked", + userPreferences.achievementCustomNotificationPosition ?? "top_left", + [generateAchievementCustomNotificationTest(t, language)] + ); + } + public static async closeNotificationWindow() { if (this.notificationWindow) { this.notificationWindow.close(); diff --git a/src/renderer/src/pages/settings/settings-general.scss b/src/renderer/src/pages/settings/settings-general.scss index 03798462..302effa3 100644 --- a/src/renderer/src/pages/settings/settings-general.scss +++ b/src/renderer/src/pages/settings/settings-general.scss @@ -13,4 +13,8 @@ &__common-redist-button { align-self: flex-start; } + + &__test-achievement-notification-button { + align-self: flex-start; + } } diff --git a/src/renderer/src/pages/settings/settings-general.tsx b/src/renderer/src/pages/settings/settings-general.tsx index 792c4603..5de83e40 100644 --- a/src/renderer/src/pages/settings/settings-general.tsx +++ b/src/renderer/src/pages/settings/settings-general.tsx @@ -277,12 +277,24 @@ export function SettingsGeneral() { {form.achievementNotificationsEnabled && form.achievementCustomNotificationsEnabled && ( - + <> + + + + )}

{t("common_redist")}

diff --git a/src/renderer/src/pages/theme-editor/theme-editor.scss b/src/renderer/src/pages/theme-editor/theme-editor.scss index 346e8230..288ce1bf 100644 --- a/src/renderer/src/pages/theme-editor/theme-editor.scss +++ b/src/renderer/src/pages/theme-editor/theme-editor.scss @@ -44,8 +44,11 @@ } &__footer { + display: flex; + flex-direction: column; background-color: globals.$dark-background-color; padding: globals.$spacing-unit globals.$spacing-unit * 2; + gap: 24px; &-actions { display: flex; @@ -82,6 +85,7 @@ } &__notification-preview { + padding-top: 12px; display: flex; flex-direction: row; align-items: center; diff --git a/src/renderer/src/pages/theme-editor/theme-editor.tsx b/src/renderer/src/pages/theme-editor/theme-editor.tsx index 4b7075dd..24c175b1 100644 --- a/src/renderer/src/pages/theme-editor/theme-editor.tsx +++ b/src/renderer/src/pages/theme-editor/theme-editor.tsx @@ -156,13 +156,13 @@ export default function ThemeEditor() {
{ return { key: variation, value: variation, - label: variation, + label: t(variation), }; } )} @@ -174,7 +174,7 @@ export default function ThemeEditor() { /> setNotificationAlignment(