Skip to content

Commit

Permalink
Merge pull request lost-ark-dev#21 from raphlau/patch-1
Browse files Browse the repository at this point in the history
Add setting to toggle alwaysOnTop on or off
  • Loading branch information
Herysia authored Jul 12, 2023
2 parents b2e5a3c + 586bc36 commit 2da7221
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions src-electron/electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ const ipcFunctions: {
});

damageMeterWindow?.setOpacity(appSettings.damageMeter.design.opacity);
damageMeterWindow?.setAlwaysOnTop(appSettings.damageMeter.design.alwaysOnTop, "normal");
},
"get-settings": (event) => {
event.reply("on-settings-change", appSettings);
Expand Down
4 changes: 2 additions & 2 deletions src-electron/electron-windows/damage-meter-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function createDamageMeterWindow(
resizable: true,
autoHideMenuBar: true,
fullscreenable: false,
alwaysOnTop: true,
alwaysOnTop: appSettings?.damageMeter?.design?.alwaysOnTop ?? true,
useContentSize: true,
webPreferences: {
devTools: process.env.DEBUGGING,
Expand All @@ -49,7 +49,7 @@ export function createDamageMeterWindow(
initWindow(damageMeterWindow, "damage_meter");
});

damageMeterWindow.setAlwaysOnTop(true, "normal");
damageMeterWindow.setAlwaysOnTop(appSettings?.damageMeter?.design?.alwaysOnTop ?? true, "normal");

// Event listeners
liveParser.on("reset-state", (state: GameState) => {
Expand Down
2 changes: 2 additions & 0 deletions src-electron/util/app-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export type Settings = {
pinUserToTop: boolean;
transparency: boolean;
opacity: number;
alwaysOnTop: boolean;
};
header: {
[key: string]: {
Expand Down Expand Up @@ -204,6 +205,7 @@ const defaultSettings: Settings = {
pinUserToTop: false,
transparency: true,
opacity: 0.9,
alwaysOnTop: true,
},
header: {
damage: {
Expand Down
15 changes: 15 additions & 0 deletions src/components/SettingsPage/DamageMeterPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@
</q-item-section>
</q-item>

<q-item tag="label">
<q-item-section side top>
<q-checkbox
v-model="settingsStore.settings.damageMeter.design.alwaysOnTop"
/>
</q-item-section>

<q-item-section>
<q-item-label>Always on top</q-item-label>
<q-item-label caption>
Keeps the damage meter above other windows.
</q-item-label>
</q-item-section>
</q-item>

<q-item tag="label">
<q-item-section side top>
<q-checkbox
Expand Down
1 change: 1 addition & 0 deletions src/stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const useSettingsStore = defineStore("settings", {
pinUserToTop: false,
opacity: 0.9,
transparency: false,
alwaysOnTop: true,
},
header: {
damage: {
Expand Down

0 comments on commit 2da7221

Please sign in to comment.