Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ce8b41a4c | ||
|
|
0562b326c8 | ||
|
|
857a8477d7 | ||
|
|
fdbf57a6d6 | ||
|
|
4f7aab646b | ||
|
|
35481fe7d7 | ||
|
|
26b70d29c4 | ||
|
|
c94cdf679a | ||
|
|
a5d1725ee7 | ||
|
|
23662003da | ||
|
|
34ed92a647 |
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/
|
||||||
|
|||||||
@@ -1,37 +1,46 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Installe (ou met à jour) l'entrée de menu "Farm Tracker" pointant vers l'AppImage déjà construit.
|
# Installation initiale de Farm Tracker (AppImage + entrée de menu).
|
||||||
set -e
|
# À lancer une seule fois. Les mises à jour suivantes sont automatiques.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
APPDIR="/home/shamiiow/GitHub/farm-tracker-app/dist"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
APPIMAGE=$(ls "$APPDIR"/*.AppImage 2>/dev/null | head -n1)
|
DIST_DIR="$SCRIPT_DIR/dist"
|
||||||
|
|
||||||
if [ -z "$APPIMAGE" ]; then
|
# Trouve l'AppImage dans dist/
|
||||||
echo "Aucun fichier .AppImage trouvé dans : $APPDIR"
|
APPIMAGE_SRC=$(ls "$DIST_DIR"/*.AppImage 2>/dev/null | head -n1)
|
||||||
echo "Lance d'abord (depuis le dossier du projet) : npm run dist"
|
if [ -z "$APPIMAGE_SRC" ]; then
|
||||||
|
echo "Aucun .AppImage trouvé dans dist/. Lance d'abord : npm run dist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod +x "$APPIMAGE"
|
# Chemin stable — indépendant de la version
|
||||||
|
INSTALL_DIR="$HOME/.local/bin"
|
||||||
|
STABLE_PATH="$INSTALL_DIR/farm-tracker.AppImage"
|
||||||
|
|
||||||
|
mkdir -p "$INSTALL_DIR"
|
||||||
|
cp "$APPIMAGE_SRC" "$STABLE_PATH"
|
||||||
|
chmod +x "$STABLE_PATH"
|
||||||
|
|
||||||
|
# Entrée de menu
|
||||||
DESKTOP_DIR="$HOME/.local/share/applications"
|
DESKTOP_DIR="$HOME/.local/share/applications"
|
||||||
mkdir -p "$DESKTOP_DIR"
|
mkdir -p "$DESKTOP_DIR"
|
||||||
DESKTOP_FILE="$DESKTOP_DIR/farm-tracker.desktop"
|
|
||||||
|
|
||||||
cat > "$DESKTOP_FILE" << INNEREOF
|
cat > "$DESKTOP_DIR/farm-tracker.desktop" << EOF
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Farm Tracker
|
Name=Farm Tracker
|
||||||
Comment=Suivi de loot Minecraft en direct
|
Comment=Suivi de loot Minecraft en direct
|
||||||
Exec="$APPIMAGE" %U
|
Exec="$STABLE_PATH" %U
|
||||||
Icon=applications-games
|
Icon=applications-games
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=Game;Utility;
|
Categories=Game;Utility;
|
||||||
StartupWMClass=farm-tracker
|
StartupWMClass=farm-tracker
|
||||||
INNEREOF
|
EOF
|
||||||
|
|
||||||
chmod +x "$DESKTOP_FILE"
|
chmod +x "$DESKTOP_DIR/farm-tracker.desktop"
|
||||||
update-desktop-database "$DESKTOP_DIR" >/dev/null 2>&1 || true
|
update-desktop-database "$DESKTOP_DIR" >/dev/null 2>&1 || true
|
||||||
|
|
||||||
echo "Entrée installée : $DESKTOP_FILE"
|
echo "Installé dans : $STABLE_PATH"
|
||||||
echo "AppImage détecté : $APPIMAGE"
|
echo "Entrée de menu : $DESKTOP_DIR/farm-tracker.desktop"
|
||||||
echo "Cherche \"Farm Tracker\" dans ton menu d'applications (déconnexion/reconnexion parfois nécessaire selon le bureau)."
|
echo ""
|
||||||
|
echo "Les prochaines mises à jour s'installeront automatiquement sans rien retoucher."
|
||||||
|
|||||||
@@ -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)) {
|
||||||
|
|||||||
21
main.js
21
main.js
@@ -153,10 +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 current = process.env.APPIMAGE;
|
const { spawn } = require('child_process');
|
||||||
if (current) { fs.copyFileSync(tmpPath, current); fs.unlinkSync(tmpPath); app.relaunch(); }
|
spawn(tmpPath, [], { detached: true, stdio: 'ignore' }).unref();
|
||||||
else app.relaunch({ execPath: tmpPath });
|
app.quit();
|
||||||
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();
|
||||||
@@ -245,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);
|
||||||
});
|
});
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "farm-tracker",
|
"name": "farm-tracker",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "farm-tracker",
|
"name": "farm-tracker",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dist": "^0.1.2",
|
"dist": "^0.1.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "farm-tracker",
|
"name": "farm-tracker",
|
||||||
"version": "1.0.2",
|
"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