-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Use Local Path Command Line Option #1723
Conversation
…and to command line only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just indent fixes. Thanks for the PR!
(I didn't test the code yet, Ima do that in a while but for the moment, if something I said seems to break the code, leave it there and lmk)
src/addon/addon_manager.cpp
Outdated
log_warning << "Could not add " << addon.get_install_filename() << " to search path: " | ||
<< PHYSFS_getLastErrorCode() << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add extra indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more indentation problems, wrote the exact steps to fix or posted code snippets to make it easier
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One space too much in front of those two lines
{ | ||
PHYSFS_enumerate(addon.get_id().c_str(), add_to_dictionary_path, nullptr); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two spaces too much in front of those three lines
{ | ||
if (PHYSFS_mount(addon.get_install_filename().c_str(), mountpoint.c_str(), 1) == 0) | ||
{ | ||
log_warning << "Could not add " << addon.get_install_filename() << " to search path: " | ||
<< PHYSFS_getLastErrorCode() << std::endl; | ||
} | ||
else | ||
{ | ||
if (addon.get_type() == Addon::LANGUAGEPACK) | ||
{ | ||
PHYSFS_enumerate(addon.get_id().c_str(), add_to_dictionary_path, nullptr); | ||
} | ||
addon.set_enabled(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
if (PHYSFS_mount(addon.get_install_filename().c_str(), mountpoint.c_str(), 1) == 0)
{
log_warning << "Could not add " << addon.get_install_filename() << " to search path: "
<< PHYSFS_getLastErrorCode() << std::endl;
}
else
{
if (addon.get_type() == Addon::LANGUAGEPACK)
{
PHYSFS_enumerate(addon.get_id().c_str(), add_to_dictionary_path, nullptr);
}
for (auto& addon : m_installed_addons) | ||
{ | ||
if (is_old_enabled_addon(addon)) | ||
{ | ||
log_warning << "Could not add " << addon->get_install_filename() << " to search path: " | ||
<< PHYSFS_getLastErrorCode() << std::endl; | ||
if (g_config->use_local_path) | ||
{ | ||
if (PHYSFS_mount(addon->get_install_filename().c_str(), mountpoint.c_str(), 0) == 0) | ||
{ | ||
log_warning << "Could not add " << addon->get_install_filename() << " to search path: " | ||
<< PHYSFS_getLastErrorCode() << std::endl; | ||
} | ||
} | ||
else | ||
{ | ||
if (PHYSFS_mount(addon->get_install_filename().c_str(), mountpoint.c_str(), 1) == 0) | ||
{ | ||
log_warning << "Could not add " << addon->get_install_filename() << " to search path: " | ||
<< PHYSFS_getLastErrorCode() << std::endl; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (auto& addon : m_installed_addons)
{
if (is_old_enabled_addon(addon))
{
if (g_config->use_local_path)
{
if (PHYSFS_mount(addon->get_install_filename().c_str(), mountpoint.c_str(), 0) == 0)
{
log_warning << "Could not add " << addon->get_install_filename() << " to search path: "
<< PHYSFS_getLastErrorCode() << std::endl;
}
}
else
{
if (PHYSFS_mount(addon->get_install_filename().c_str(), mountpoint.c_str(), 1) == 0)
{
log_warning << "Could not add " << addon->get_install_filename() << " to search path: "
<< PHYSFS_getLastErrorCode() << std::endl;
}
Is that option really necessary? Can't you just make that the default behavior and users that don't want to use it just don't copy addons there? There is already the option to enable/disable individual addons from within the game. Either way, it would need a better name, |
This was the defult option up until about a year ago. Tobbi pushed an
update that removed this.
I first tried added this as a menu toggle and did a PR. People did not like.
The thing is, it's a potential support issue because a confused user might
think the game is broken if a addons does wacky suff with unexpected file
replacements. I saw this happening right around when Tobbi made the update,
i figured this was the prompt for the change.
It's hard to accidentally use a command line switch. This seemed like a
safe approach that would not upset or confuse people.
I would prefer just defaulting to this beghavior back to how it was. I use
this feature for my addon project.
I tried to catch Tobbi on the topic but did not push it.
It would be nice to have this feature back. I'm open to reanming the
switch, i tried really hard to come up with someting logical.
Thanks for the input.
Steve Groundwater / slackstone on github
…On Wed, Apr 21, 2021, 11:08 AM Ingo Ruhnke ***@***.***> wrote:
Is that option really necessary? Can't you just make that the default
behavior and users that don't want to use it just don't copy addons there?
There is already the option to enable/disable individual addons from within
the game.
Either way, it would need a better name, --use-local-path really doesn't
tell me much.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOF2C6QI577Q44ZRKHQLCDTJ3S7LANCNFSM424BUIFQ>
.
|
I'll be closing this as Tobbi's #1835 offers the best solution. |
Directory Options:
--use-local-path
Sets the default path precedence for loading local game assets.
Add-on assets contained in the local SuperTux/addon home directory, that also match an expected game asset path, will take precedence.
This feature allows game hackers the ability to load their own game assets and add-on files.
Example of addon home directory path, found on most Linux platforms:
~/.local/share/supertux2/addons