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

Add the data folder location to the in-game help #773

Merged
merged 2 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions client/helpdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,35 @@ static bool insert_generated_text(char *outbuf, size_t outlen,
* "Freeciv version 2.3.0-beta1 (beta version)" (translated).
* Second %s is client_string, e.g., "gui-gtk-2.0". */
_("This is %s, %s client."), ver, client_string);

insert_client_build_info(outbuf, outlen);

QString data_dirs_info = "\n\n";
data_dirs_info += _("This instance of Freeciv21 searches the following "
"directories for data files:");
data_dirs_info += "\n\n";
for (const auto &path : qAsConst(get_data_dirs())) {
qCritical() << path;
QFileInfo info(path + "/");
data_dirs_info += "* " + info.absolutePath() + " ";
if (!info.exists()) {
// TRANS: Folder does not exist
data_dirs_info += _("(does not exist)");
} else if (info.isWritable()) {
// TRANS: Folder can be modified by the current user
data_dirs_info += _("(user)");
} else {
// TRANS: Folder cannot be modified by the current user
data_dirs_info += _("(system)");
}
data_dirs_info += "\n";
}
data_dirs_info += "\n";
data_dirs_info += _("Note that for multiplayer games, the server may "
"use different paths.");

cat_snprintf(outbuf, outlen, "%s", qUtf8Printable(data_dirs_info));

return true;
} else if (0 == strcmp(name, "DefaultMetaserver")) {
cat_snprintf(outbuf, outlen, " %s", FREECIV_META_URL);
Expand Down
4 changes: 2 additions & 2 deletions data/helpdata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2139,8 +2139,8 @@ Tracking System, at:\
"), "\
https://github.com/longturn/freeciv21/issues\
", _("\
Please quote the above version information. For more information about submitting bug reports see the file \
BUGS in the Freeciv21 distribution.\
Please quote the above version information. For more information about submitting \
bug reports see https://longturn.readthedocs.io/en/latest/Contributing/bugs.html.\
"), _("\
To contact the developers about anything else, contact them on discord:\
"), _("\
Expand Down