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

Improve warning message #5036

Open
soliton- opened this issue Aug 7, 2020 · 14 comments
Open

Improve warning message #5036

soliton- opened this issue Aug 7, 2020 · 14 comments
Labels
Enhancement Issues that are requests for new features or changes to existing ones. Good first issue Issues deemed adequate for contributors without prior experience to work on. Help In-game Help functions

Comments

@soliton-
Copy link
Member

soliton- commented Aug 7, 2020

std::vector<std::string> parts = utils::split(generator, ':', utils::STRIP_SPACES);
if (parts.size() > 1 && parts[0] == "units") {
res = generate_unit_topics(sort_generated, parts[1]);
} else if (parts[0] == "era" && parts.size()>1) {
res = generate_era_topics(sort_generated, parts[1]);
} else {
WRN_HP << "Found a topic generator that I didn't recognize: " << generator << "\n";
}

The current warning message should only be displayed if parts[0] is not recognized. If parts[1] is missing it should mention a [race] or an [era] with no id key respectively.

(Alternatively this whole internal config generation should be done away with. It seems like there should be more useful data structures to use that don't require string parsing.)

@soliton- soliton- added Enhancement Issues that are requests for new features or changes to existing ones. Good first issue Issues deemed adequate for contributors without prior experience to work on. Help In-game Help functions labels Aug 7, 2020
@Spencer-Kinny
Copy link

@soliton-
Could you please elaborate this "If parts[1] is missing it should mention a [race] or an [era] with no id key respectively"

Its not clear to me what [race] or [era] is

@soliton-
Copy link
Member Author

@Spencer-Kinny If you look at the generate_races_sections and generate_era_sections functions where the generator key is produced you see that for races it is set to units:<race id> and for eras to era:<era id> so if the part after the colon is missing it means one of those IDs is missing or empty.

Looking more closely in the race case it's actually [unit_type] race= where the ID is coming from. In that case (and really in the era case as well) the error/warning should be issued right there when finding a unit type with an empty or no race key. Then you can also output the unit type ID so it's clearer where to find the error in the WML.

The invalid generator entry should not be produced at all really. Not sure if the other things those two functions do are still useful when the IDs are missing.

If you want to know more about [race], [unit_type] or [era] see https://wiki.wesnoth.org/ReferenceWML.

@JasonSShen
Copy link

Hello, looking to start contributing to Wesnoth as a developer, figured I start with a "Good first issue." Has anyone started working on this yet? If not, I'd like to take a stab at it.

@Spencer-Kinny
Copy link

@JasonSShen
we can work together, if you don't mind

@JasonSShen
Copy link

@Spencer-Kinny that works for me. Let me know how you want to coordinate

@Spencer-Kinny
Copy link

@Spencer-Kinny that works for me. Let me know how you want to coordinate

@JasonSShen
email will do fine I think, or do you propose any other way

@JasonSShen
Copy link

@Spencer-Kinny that works for me. Let me know how you want to coordinate

@JasonSShen
email will do fine I think, or do you propose any other way

Ping me on Discord (username is jasoshen, or jasoshen#1947 if you need the number - I'm new to that medium too), I can share you my email address there or we can just talk details over that medium.

@Spencer-Kinny
Copy link

@Spencer-Kinny that works for me. Let me know how you want to coordinate

@JasonSShen
email will do fine I think, or do you propose any other way

Ping me on Discord (username is jasoshen, or jasoshen#1947 if you need the number - I'm new to that medium too), I can share you my email address there or we can just talk details over that medium.

@JasonSShen
sent a request on discord

@internall
Copy link

@Spencer-Kinny that works for me. Let me know how you want to coordinate

@JasonSShen
email will do fine I think, or do you propose any other way

Ping me on Discord (username is jasoshen, or jasoshen#1947 if you need the number - I'm new to that medium too), I can share you my email address there or we can just talk details over that medium.

@JasonSShen
sent a request on discord

I'd really like to contribute / help, Justiis#2336 on Discord

@cooljeanius
Copy link
Contributor

cooljeanius commented Dec 9, 2022

ok so it looks like c4d0133 and 7608ee7 weren't merged because @RutviShukla's PR that included them (#6456) didn't actually build; let me check what the error was and see if I can fix it... (edit: nvm; can't find it...)

@Pentarctagon
Copy link
Member

Building it locally:

src/help/help_impl.cpp: In function ‘std::vector<help::topic> help::generate_topics(bool, const string&)’:
src/help/help_impl.cpp:349:55: error: invalid initialization of reference of type ‘const config&’ from expression of type ‘const bool’
  349 |                         res = generate_faction_topics(sort_generated, parts[1]);
      |                                                       ^~~~~~~~~~~~~~
In file included from src/help/help_impl.cpp:16:
src/help/help_impl.hpp:265:44: note: in passing argument 1 of ‘std::vector<help::topic> help::generate_faction_topics(const config&, bool)’
  265 | std::vector<topic> generate_faction_topics(const config &, const bool);
      |                                            ^~~~~~~~~~~~~~

@Shivansh175
Copy link

Is this issue still open.....?
Please help me out I'm a newbie here searching for some beginner friendly issues but couldn't find single one.

@JasonSShen
Copy link

JasonSShen commented Jun 30, 2023 via email

@Pentarctagon
Copy link
Member

This is still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Issues that are requests for new features or changes to existing ones. Good first issue Issues deemed adequate for contributors without prior experience to work on. Help In-game Help functions
Projects
None yet
Development

No branches or pull requests

7 participants