-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Mathi <[email protected]>
- Loading branch information
Showing
7 changed files
with
340 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "loa-details", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Damage meter for Lost Ark", | ||
"productName": "LOA Details", | ||
"author": "Herysia, Mathicha, Eren Kara <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
import Store from "electron-store"; | ||
import log from "electron-log"; | ||
import { cloneDeep, merge } from "lodash"; | ||
|
||
const store = new Store(); | ||
|
||
export function getSettings() { | ||
let appSettings = cloneDeep(defaultSettings); | ||
|
||
try { | ||
let settingsStr = store.get("settings"); | ||
|
||
if (typeof settingsStr === "object") | ||
appSettings = merge(appSettings, cloneDeep(settingsStr)); | ||
else if (typeof settingsStr === "string") | ||
merge(appSettings, JSON.parse(settingsStr)); | ||
|
||
log.info("Found and applied settings."); | ||
} catch (e) { | ||
log.info("Setting retrieval failed: " + e); | ||
} | ||
|
||
return appSettings; | ||
} | ||
|
||
export function saveSettings(settings) { | ||
if (typeof settings === "object") | ||
store.set("settings", JSON.stringify(settings)); | ||
else store.set("settings", settings); | ||
|
||
log.info(`Saved settings: ${settings}`); | ||
} | ||
|
||
// TODO: find a better way to handle this | ||
const defaultSettings = { | ||
appVersion: "", | ||
general: { | ||
startMainHidden: false, | ||
startMainMinimized: false, | ||
closeToSystemTray: true, | ||
saveScreenshots: true, | ||
server: "steam", | ||
customLogPath: null, | ||
}, | ||
shortcuts: { | ||
minimizeDamageMeter: { | ||
value: "CommandOrControl+Down", | ||
defaultValue: "CommandOrControl+Down", | ||
}, | ||
resetSession: { | ||
value: "CommandOrControl+Up", | ||
defaultValue: "CommandOrControl+Up", | ||
}, | ||
pauseDamageMeter: { | ||
value: "CommandOrControl+Right", | ||
defaultValue: "CommandOrControl+Right", | ||
}, | ||
}, | ||
uploads: { | ||
uploadLogs: false, | ||
uploadKey: "", | ||
api: { | ||
value: process.env.UPLOADS_API_URL, | ||
defaultValue: process.env.UPLOADS_API_URL, | ||
}, | ||
endpoint: { | ||
value: process.env.UPLOADS_ENDPOINT, | ||
defaultValue: process.env.UPLOADS_ENDPOINT, | ||
}, | ||
site: { | ||
value: process.env.UPLOADS_LOGIN_URL, | ||
defaultValue: process.env.UPLOADS_LOGIN_URL, | ||
}, | ||
openOnUpload: false, | ||
uploadUnlisted: true, | ||
includeRegion: false, | ||
}, | ||
damageMeter: { | ||
functionality: { | ||
dontResetOnZoneChange: false, | ||
removeOverkillDamage: true, | ||
pauseOnPhaseTransition: true, | ||
resetAfterPhaseTransition: true, | ||
autoMinimize: false, | ||
autoMinimizeTimer: 60, | ||
minimizeToTaskbar: false, | ||
nameDisplay: "name+class", | ||
nameDisplayV2: "name+gear+class", | ||
}, | ||
design: { | ||
compactDesign: false, | ||
pinUserToTop: false, | ||
opacity: 0.9, | ||
}, | ||
header: { | ||
damage: { | ||
name: "Damage", | ||
enabled: true, | ||
}, | ||
dps: { | ||
name: "DPS", | ||
enabled: true, | ||
}, | ||
tank: { | ||
name: "Tanked", | ||
enabled: false, | ||
}, | ||
}, | ||
tabs: { | ||
damage: { | ||
name: "Damage/Tanked", | ||
enabled: true, | ||
}, | ||
deathTime: { | ||
name: "Death Time", | ||
enabled: false, | ||
}, | ||
damagePercent: { | ||
name: "D% (Damage Percent)", | ||
enabled: true, | ||
}, | ||
dps: { | ||
name: "DPS/TPS", | ||
enabled: true, | ||
}, | ||
critRate: { | ||
name: "Crit Rate", | ||
enabled: true, | ||
}, | ||
faRate: { | ||
name: "Front Attack Rate", | ||
enabled: true, | ||
}, | ||
baRate: { | ||
name: "Back Attack Rate", | ||
enabled: true, | ||
}, | ||
counterCount: { | ||
name: "Counter Count", | ||
enabled: true, | ||
}, | ||
maxDmg: { | ||
name: "Skill View / Max Damage", | ||
enabled: true, | ||
}, | ||
avgDmg: { | ||
name: "Skill View / Average Damage", | ||
enabled: true, | ||
}, | ||
totalHits: { | ||
name: "Skill View / Total Hits", | ||
enabled: true, | ||
}, | ||
hpm: { | ||
name: "Skill View / Hits per Minute", | ||
enabled: true, | ||
}, | ||
}, | ||
classes: {}, | ||
}, | ||
logs: { | ||
minimumSessionDurationInMinutes: 1, | ||
minimumEncounterDurationInMinutes: 0.5, | ||
minimumDurationInMinutes: 0.0, | ||
splitOnPhaseTransition: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.