diff --git a/README.md b/README.md index c6d2e615..a9377e20 100644 --- a/README.md +++ b/README.md @@ -32,27 +32,33 @@ For NodeJS, you can download it from here https://nodejs.org/en/download, just s Now, if you have installed succesfully both of them, you should be able to run both py and npm commands on a cmd. You can do this for extra checking, but this is NOT MANDATORY. If you don't like cmds, don't worry, I have designed this to not require you to use them. -## How can I run the Database Editor? ## -So, if you have everything installed, you just have to download this repository to be able to use the editor! +## How can I install the Database Editor? ## +So, if you have everything I mentioned installed, you just have to download this repository to be able to use the editor! -If you know how to use git and have it installed, just clone this repository wherever you desire. -**I REALLY HIGHLY RECOMMEND** to use git as it will be much easier to update the editor in the future. Here is a guide to install it (don't worry, it's not complicated): https://github.com/git-guides/install-git +### Git installation (recommended) ## -This repository has mainly 1 usable branch: `release`. This branch will have the latest functional version. The `main` branch will also have functional versions but it's **NOT RECOMMENDED** for casual use. It should not but it **MAY** break at any time and software there will not be FINAL. +If you don't have git installed, you can download it for windows here : [https://github.com/git-guides/install-git](https://gitforwindows.org/) -For cloning the repo, just create any folder **OUTSIDE ANY WINDOWS CONTRROLLED FOLDER** (Program Files, System32 etc.), your desktop for example is a good place, but feel free to choose other places. Then go into that folder in the Windows Explorer (`Win+E`) and type in the "Address bar" at the top: `cmd` and press Enter. +For cloning the repository (installing the tool), just create any folder **OUTSIDE ANY WINDOWS CONTRROLLED FOLDER** (Program Files, System32 etc.), your desktop for example is a good place, but feel free to choose other places. Then go into that folder in the Windows Explorer (`Win+E`) and type in the "Address bar" at the top: `cmd` and press `Enter`, like in the following picture: +![image](https://github.com/IUrreta/DatabaseEditor/assets/95303008/e0f8b123-0557-4783-a2dd-242eb12e7718) + +This repository has mainly 1 usable branch: `release`. This branch will have the latest functional version. The `main` branch will also have functional versions but it's **NOT RECOMMENDED** for casual use. It should not but it **MAY** break at any time and software there will not be FINAL (ignore this paragraph if you're not familiar with git). Once the black box (Command Prompt) opens, copy and paste this command and press Enter: `git clone https://github.com/IUrreta/DatabaseEditor.git -b release` -This will clone the repo from the release branch +This will clone the repo from the release branch, and you will have the tool installed. + +### Zip installation (discouraged) ### + +If you still don't want to clone the repo, just go into the [Releases](https://github.com/IUrreta/DatabaseEditor/releases) tab in it and hit `Source code(.zip)` from the **LATEST** release -If you still don't want to clone the repo, just hit the green button that reads "Code" in it and click the download Zip option. Extract the files where you want and you should have the files from the editor ready. +## How can I run the Databse Editor? ## -Once you have cloned/downloaded the repository, just paste the save file you want to edit into the DatabaseEditor folder. Your saves folder should be in C:\Users\XXX\AppData\Local\F1Manager23\Saved\SaveGames where XXX is your username. If the AppData folder does not appear go to View in windows explorer and then click on hidden elements. +Once you have cloned/downloaded the repository, just paste the save file you want to edit into the `DatabaseEditor` folder. Your saves folder should be in `C:\Users\XXX\AppData\Local\F1Manager23\Saved\SaveGames` where `XXX` is your username. If the `AppData` folder does not appear go to `View > Show` in the `Windows Explorer` and then click on `Hidden elements`. -With your save inside the Database Editor folder, just double click on the run.vbs file and there you go! Everything else should install itself and the tool should open. Now you will be able to +With your save inside the Database Editor folder, just double click on the `run.vbs` file and there you go! Everything else should install itself and the tool should open. Now you will be able to make any driver transfer you desire. I **HIGHLY RECOMMEND** to make a **BACKUP** of your file you're about to edit. To use the tool, select any save from the save selector and just drag and drop any driver into the spot you want to sign him into. To free a spot, just drag the driver that is occupying it and drop him into the Dree Drivers secion. ### How can I update the Database Editor if I had a previouos verision? ### @@ -88,11 +94,16 @@ When you have the latest version available, you'll see this on the right bottom ### I get an error saying "could not connect with backend". Have I done something wrong? ### -It most likely has something to do with a bad python installation. Not that you have a not-compatible version, but that you missed some of the steps to install it propperly. There's a complete guide on how to solve this: https://github.com/IUrreta/DatabaseEditor/wiki/Troubleshoot-guide +It most likely has something to do with a bad python installation. Not that you have a not-compatible version, but that you missed some of the steps to install it propperly. There's a complete guide on how to solve this in the [Troubleshoot Guide](https://github.com/IUrreta/DatabaseEditor/wiki/Troubleshoot-guide) + +### My save files don't appear in the tool ### + +There's another chapter covering that on the [Troubleshoot Guide](https://github.com/IUrreta/DatabaseEditor/wiki/Troubleshoot-guide) + ### I can edit stats and do transfers, but then I don't see those changes applied to the game ### -One of two cases, either you didn't drop the save file you just edited back into the SavedGames folder on your F1 Manager 23 folder, or you pasted back the wrong file. If something goes wrong during using the tool or doesn0t save, **YOU WILL GET AN ERROR SAYING IT**, if you don't see any erro, it means that everything has been done succesfully. +One of two cases, either you didn't drop the save file you just edited back into the SavedGames folder on your F1 Manager 23 folder, or you pasted back the wrong file. If something goes wrong during using the tool or doesn't save, **YOU WILL GET AN ERROR SAYING IT**, if you don't see any erro, it means that everything has been done succesfully. This is also covered in the [Troubleshoot Guide](https://github.com/IUrreta/DatabaseEditor/wiki/Troubleshoot-guide) ### Why do I have to install Python and NodeJS? Isn't it Docker easier to use? ### diff --git a/front/index.html b/front/index.html index 443eb007..9d18db8a 100644 --- a/front/index.html +++ b/front/index.html @@ -60,7 +60,7 @@ -
1.4.0
+
diff --git a/front/js/renderer.js b/front/js/renderer.js index 28461829..6f017e55 100644 --- a/front/js/renderer.js +++ b/front/js/renderer.js @@ -1,4 +1,8 @@ const socket = new WebSocket('ws://localhost:8765/'); +const fs = require('fs'); +const simpleGit = require('simple-git'); +const { exec } = require('child_process'); + socket.onopen = () => { //console.log('Conexión establecida.'); let data = { @@ -7,13 +11,16 @@ socket.onopen = () => { socket.send(JSON.stringify(data)) }; -const fs = require('fs'); -const simpleGit = require('simple-git'); -const { exec } = require('child_process'); -document.addEventListener('DOMContentLoaded',function () { +const versionPanel = document.querySelector('.versionPanel'); +fetch('./../launcher/version.conf') +.then(response => response.text()) +.then(version => { + versionPanel.textContent = `${version}`; +}); +document.addEventListener('DOMContentLoaded',function () { const driverTransferPill = document.getElementById("transferpill"); const editStatsPill = document.getElementById("statspill"); @@ -36,6 +43,7 @@ document.addEventListener('DOMContentLoaded',function () { const status = document.querySelector(".status-info") const updateInfo = document.querySelector(".update-info") + let latestTag; const repoOwner = 'IUrreta'; // Reemplaza con el nombre del dueño del repositorio @@ -49,15 +57,13 @@ document.addEventListener('DOMContentLoaded',function () { + let connectionTimeout = setTimeout(() => { update_notifications("Could not connect with backend",true) manage_status(0) },4000); - - - socket.onmessage = (event) => { // const mensaje = event.data; // console.log('Mensaje recibido: ' + event.data); @@ -121,7 +127,7 @@ document.addEventListener('DOMContentLoaded',function () { .then(tags => { if (tags.length > 0) { latestTag = tags[0].name; - let actualVersion = document.querySelector('.versionPanel').textContent.trim() + let actualVersion = versionPanel.textContent.trim() if (actualVersion.slice(-3) === "dev") { updateInfo.textContent = '\xa0' + "Development branch" diff --git a/front/styles.css b/front/styles.css index afaffb3e..8606f94b 100644 --- a/front/styles.css +++ b/front/styles.css @@ -1033,7 +1033,8 @@ a.bi-heart:hover{ padding-left: 10px; margin: 10px; margin-left: 20px; - color: white; + color: #dedde6; + transition: border-color 0.5s, color 0.5s, background-color 0.5s; min-height: 70px; border: 2px solid transparent; display: flex; @@ -1042,6 +1043,12 @@ a.bi-heart:hover{ max-height: 70px; } +.one-stat-panel:hover { + border-color: white; + color: white; + background-color: #4e4b69; +} + .scriptPills { color: white !important; border: 2px solid transparent !important; diff --git a/launcher/launch.bat b/launcher/launch.bat index 12493ad2..b508d46b 100644 --- a/launcher/launch.bat +++ b/launcher/launch.bat @@ -1,12 +1,22 @@ @echo off REM Ejecutar server.py en la carpeta "back" usando Python + +for %%I in ("%CD%") do set "last_folder=%%~nI" +if "%last_folder%"=="DatabaseEditor" ( + cd launcher +) + +set /p version=