Compare commits
9 Commits
23662003da
...
v1.0.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ce8b41a4c | ||
|
|
0562b326c8 | ||
|
|
857a8477d7 | ||
|
|
fdbf57a6d6 | ||
|
|
4f7aab646b | ||
|
|
35481fe7d7 | ||
|
|
26b70d29c4 | ||
|
|
c94cdf679a | ||
|
|
a5d1725ee7 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -22,5 +22,8 @@ Thumbs.db
|
||||
.vscode/
|
||||
.idea/
|
||||
|
||||
# Token local (jamais commité)
|
||||
.gitea-token
|
||||
|
||||
# Claude Code
|
||||
.claude/
|
||||
|
||||
@@ -21,12 +21,14 @@ function mergeDropStatsInto(target, source) {
|
||||
|
||||
for (const [mobName, mobData] of Object.entries(sourceMobs)) {
|
||||
if (!mobName) continue;
|
||||
if (!target.mobs[mobName]) target.mobs[mobName] = { kills: 0, items: {} };
|
||||
if (!target.mobs[mobName]) target.mobs[mobName] = { kills: 0, totalExp: 0, totalCols: 0, items: {} };
|
||||
const t = target.mobs[mobName];
|
||||
|
||||
const kills = Number(mobData.kills) || 0;
|
||||
t.kills += kills;
|
||||
addedKills += kills;
|
||||
t.totalExp = (t.totalExp || 0) + (Number(mobData.totalExp) || 0);
|
||||
t.totalCols = (t.totalCols || 0) + (Number(mobData.totalCols) || 0);
|
||||
|
||||
const items = mobData.items || {};
|
||||
for (const [key, item] of Object.entries(items)) {
|
||||
|
||||
27
main.js
27
main.js
@@ -153,16 +153,9 @@ async function downloadAndInstall(downloadUrl, version) {
|
||||
sendUpdateProgress(100, 'installing');
|
||||
if (process.platform === 'linux') {
|
||||
fs.chmodSync(tmpPath, 0o755);
|
||||
const stablePath = path.join(require('os').homedir(), '.local', 'bin', 'farm-tracker.AppImage');
|
||||
const target = fs.existsSync(stablePath) ? stablePath : process.env.APPIMAGE;
|
||||
if (target) {
|
||||
fs.copyFileSync(tmpPath, target);
|
||||
fs.unlinkSync(tmpPath);
|
||||
app.relaunch({ execPath: target });
|
||||
} else {
|
||||
app.relaunch({ execPath: tmpPath });
|
||||
}
|
||||
app.exit(0);
|
||||
const { spawn } = require('child_process');
|
||||
spawn(tmpPath, [], { detached: true, stdio: 'ignore' }).unref();
|
||||
app.quit();
|
||||
} else if (process.platform === 'win32') {
|
||||
const { spawn } = require('child_process');
|
||||
spawn(tmpPath, ['/S'], { detached: true, stdio: 'ignore' }).unref();
|
||||
@@ -251,7 +244,21 @@ function createWindow() {
|
||||
mainWindow.loadFile(path.join(__dirname, 'renderer', 'index.html'));
|
||||
}
|
||||
|
||||
function selfInstallLinux() {
|
||||
if (process.platform !== 'linux' || !app.isPackaged) return;
|
||||
const appImagePath = process.env.APPIMAGE;
|
||||
if (!appImagePath) return;
|
||||
const stablePath = path.join(require('os').homedir(), '.local', 'bin', 'farm-tracker.AppImage');
|
||||
if (appImagePath === stablePath) return;
|
||||
try {
|
||||
fs.mkdirSync(path.dirname(stablePath), { recursive: true });
|
||||
fs.copyFileSync(appImagePath, stablePath);
|
||||
fs.chmodSync(stablePath, 0o755);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
selfInstallLinux();
|
||||
createWindow();
|
||||
setTimeout(() => checkForUpdates(false), 5000);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "farm-tracker",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.9",
|
||||
"description": "Suivi de loot Minecraft en direct, avec sauvegarde automatique des stats et des chances de drop.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
BIN
renderer/levelup.ogg
Normal file
BIN
renderer/levelup.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user