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/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
# Token local (jamais commité)
|
||||||
|
.gitea-token
|
||||||
|
|
||||||
# Claude Code
|
# Claude Code
|
||||||
.claude/
|
.claude/
|
||||||
|
|||||||
@@ -21,12 +21,14 @@ function mergeDropStatsInto(target, source) {
|
|||||||
|
|
||||||
for (const [mobName, mobData] of Object.entries(sourceMobs)) {
|
for (const [mobName, mobData] of Object.entries(sourceMobs)) {
|
||||||
if (!mobName) continue;
|
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 t = target.mobs[mobName];
|
||||||
|
|
||||||
const kills = Number(mobData.kills) || 0;
|
const kills = Number(mobData.kills) || 0;
|
||||||
t.kills += kills;
|
t.kills += kills;
|
||||||
addedKills += 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 || {};
|
const items = mobData.items || {};
|
||||||
for (const [key, item] of Object.entries(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');
|
sendUpdateProgress(100, 'installing');
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
fs.chmodSync(tmpPath, 0o755);
|
fs.chmodSync(tmpPath, 0o755);
|
||||||
const stablePath = path.join(require('os').homedir(), '.local', 'bin', 'farm-tracker.AppImage');
|
const { spawn } = require('child_process');
|
||||||
const target = fs.existsSync(stablePath) ? stablePath : process.env.APPIMAGE;
|
spawn(tmpPath, [], { detached: true, stdio: 'ignore' }).unref();
|
||||||
if (target) {
|
app.quit();
|
||||||
fs.copyFileSync(tmpPath, target);
|
|
||||||
fs.unlinkSync(tmpPath);
|
|
||||||
app.relaunch({ execPath: target });
|
|
||||||
} else {
|
|
||||||
app.relaunch({ execPath: tmpPath });
|
|
||||||
}
|
|
||||||
app.exit(0);
|
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
const { spawn } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
spawn(tmpPath, ['/S'], { detached: true, stdio: 'ignore' }).unref();
|
spawn(tmpPath, ['/S'], { detached: true, stdio: 'ignore' }).unref();
|
||||||
@@ -251,7 +244,21 @@ function createWindow() {
|
|||||||
mainWindow.loadFile(path.join(__dirname, 'renderer', 'index.html'));
|
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(() => {
|
app.whenReady().then(() => {
|
||||||
|
selfInstallLinux();
|
||||||
createWindow();
|
createWindow();
|
||||||
setTimeout(() => checkForUpdates(false), 5000);
|
setTimeout(() => checkForUpdates(false), 5000);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "farm-tracker",
|
"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.",
|
"description": "Suivi de loot Minecraft en direct, avec sauvegarde automatique des stats et des chances de drop.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"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