Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate a game's name in the config from its title displayed in Preferences #4308

Open
mota-with-a-lambda opened this issue Aug 30, 2023 · 6 comments
Labels
Prio:3 Low priority: Minor problems and nice to have features Type:Bug Errors and problems
Milestone

Comments

@mota-with-a-lambda
Copy link

From what I've gathered, a given game's configuration folder created in <UserDataPath> takes its name from the "name" field in GameConfig.cfg, which is the same as the title displayed in the games list in the Preferences dialog.
I suggest adding a new variable in the config for setting the game's "proper" title, separate from the name used internally (which could also be displayed along the title).

Why:
Adding this feature to the config would allow the user to specify where TB should save the compilation and engine profiles without affecting its cosmetic title in the games list.
Currently, if a game's name in the config does not match its <ResourcePath> folder name, overriding its default configuration results in two different folders being created in <UserDataPath> - for example, when configuring Half-Life, there will be a games/Halflife folder with the user's modified config, and a games/Half-Life that contains the compilation/engine profiles.
To have it all in a single place, either the game or the folders must be renamed to match.

@kduske
Copy link
Collaborator

kduske commented Aug 30, 2023

I don't understand why TB would create two folders with different names. If it does, that sounds like a bug.

@eGax
Copy link
Contributor

eGax commented Aug 30, 2023

It's only creating one folder for userdata. TrenchBroom ships with /TrenchBroom/games/dirgamename/. On 1st compilation or engine config you make, it will create the userdata dir based on the game name in the GameConfig.cfg. Under Linux in this case: /usr/share/TrenchBroom/games/Halflife/GameConfig.cfg

When you make your 1st map compilation or engine config upon exiting that dialog, it will check to see if there already is a user data DIR named as described in line 3 of the GameConfig.cfg in the game DIR :
image
If not, it will create one on Linux under ~/.TrenchBroom/games/ or on Windows %appdata%\TrenchBroom\games\ based on the name in line 3 in /usr/share/TrenchBroom/games/Halflife/GameConfig.cfg

TB is only making one folder for each game, as it has been doing for many years. I think it would be nice for simplicity’ sake to keep the same DIR name in TB/game and userdata/game, and only use the name in line 3 for display purposes inside the TB UI, which is what they seem to be asking for, but it's not really a big issue in my eyes.

@kduske
Copy link
Collaborator

kduske commented Aug 30, 2023

Ah, thanks for the explanation. It's not a big deal, but it's an slightly annoying inconsistency. The problem is that it's not easy to change this now, because changing it would mean that people lose their configs - or we have to write code to rename the directories from the old scheme to the new one.

@kduske kduske added Type:Bug Errors and problems Prio:3 Low priority: Minor problems and nice to have features labels Aug 30, 2023
@mota-with-a-lambda
Copy link
Author

eGax is right, that's what I meant. I forgot to specify that the <UserDataPath>/games/Halflife folder was created manually by me for overriding the builtins. In the end, I went with Half-Life instead and just renamed the builtin folder, and it's working as intended.
Thanks for the attention!

@eGax
Copy link
Contributor

eGax commented Sep 1, 2023

Yeah, this really bothered me when I 1st started making custom TB game profiles, but it is what it is. The option to look for either dir would be good, but I can understand not wanting to add code to migrate the one profiles to new.

@jacob-herrera
Copy link

jacob-herrera commented Sep 5, 2023

There's a side effect of using the game name from GameConfig.cfg as a folder name.
When using a character which can't be in a folder name like : in Half-Life: Opposing Force, TB will always crash when trying to create that folder. For me it happens when trying to close the Configure engines pop-up.

I don't think this is mentioned anywhere and the manual contradicts this by implying it's only for UI.
"name": "Example Resembling Quake 2", // mandatory, the name to use in the UI

@kduske kduske added this to the Next milestone Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio:3 Low priority: Minor problems and nice to have features Type:Bug Errors and problems
Projects
None yet
Development

No branches or pull requests

4 participants