joshjaysalazar / IntelliCaster

An AI race commentator for iRacing
GNU General Public License v3.0
3 stars 0 forks source link

Fixes Not Loading Due To Missing Assets #89

Closed Skutela32 closed 3 months ago

Skutela32 commented 3 months ago

Description

Added additional assets files to the root aswell as kept original src ones.

Fixes # (issue)

Type of change

Testing

Run original file - error missing splash.png

These files - boots straight up

joshjaysalazar commented 3 months ago

I'm a bit confused here. The assets aren't missing. They're in the src folder currently, as I'm running the program directly from the src folder when I run it. Maybe if you're running it with the root folder as the working folder, it's throwing errors for missing assets? Try running it with the src folder as your working folder, and there should be no missing assets error.

(appreciate the interest in the project, though! I'll be coming back to more regular work on it soon, hopefully)

Skutela32 commented 3 months ago

Yea that's what I thought but it was being odd. Spent ages debugging to realise it was erroring and saying it couldn't find splash.png inside IntelliCaster/assets/splash.png So I moved it from src to there and it worked. I'm my pull request I left the original ones in src just added additional ones into the root to fix if anyone else sees this issue.

joshjaysalazar commented 3 months ago

Are you using VSCode? If so, you may want to create/adjust the launch.json to include "cwd": "${workspaceFolder}/src" to make sure VSCode works from the correct folder. Here's my launch.json for this repo, which also includes a pointer to the main.py file so I can run the program no matter what script I currently have in front of me:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run Main File",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/src/main.py",
            "cwd": "${workspaceFolder}/src",
            "console": "integratedTerminal",
            "justMyCode": true
        }
    ]
}
Skutela32 commented 3 months ago

Ahh yes running it like that works. I had tried in VS before but had the same error. I was previously running it from CMD using python and/or directly from the .py file.

joshjaysalazar commented 3 months ago

Yeah, VSCode is a bit strange with Python. You'd expect the default working directory to be the one the file is in, but by default, it sets it as the root folder. It's annoying, but at least they provide a way to fix it with the launch parameters.

I'm going to close this PR, but please feel free to contribute more in the future. :)