Skip to content

Conversation

@mbn-code
Copy link
Contributor

This pull request includes enhancements to the projectCommand function in src/commands/project_cmd.cpp and adds new hints to the src/res/hints.txt file. The most important changes include adding a button to display hints and handling button click events.

Enhancements to projectCommand function:

  • Added a static boolean buttonClicked to track the button click state.
  • Modified the embed field title from the project content to "Project Idea".
  • Implemented an event handler for button clicks to display a hint from res/hints.txt and prevent multiple clicks.

Addition of new hints:

  • Added various programming hints to the src/res/hints.txt file for use in the hint button feature.

@ebcq ebcq changed the title hint button implementation added to project comamnd hint button implementation added to project command Jan 14, 2025
Copy link
Contributor

@ebcq ebcq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mbn-code! Just a few ideas for improvement:

  1. Replace the tabs with spaces (since we use spaces everywhere else)
  2. Put the hints in the same file (project.txt) instead of creating a new file hints.txt for less confusion
  3. Refer to resources in the hints (e.g. cppreference)

I can think of two possible solutions.

1. CSV

"Print `Hello, World!` to the screen.";"Use the [std::cout](https://en.cppreference.com/w/cpp/io/cout) stream to print text to the console."

2. JSON (if we want more separated information)

{
   "title": "Hello World!",
   "description": "Print `Hello, World!` to the screen.",
   "hint": "Use the [std::cout](https://en.cppreference.com/w/cpp/io/cout) stream to print text to the console.",
   "level": "Beginner"
}

What are your thoughts on these ideas?

{
static int index;
const std::string project = cmd::utils::readFileLine("res/project.txt", index);
static int index;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabs -> spaces

mbn-code and others added 3 commits January 14, 2025 19:46
hint button remade to support json file with project idea and hint.
Copy link
Contributor

@ebcq ebcq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code had a few problems that I fixed, so please take a look at my changes. Everything else looked fine to me :)

@ebcq ebcq merged commit 062e8f0 into cppdiscord:main Jan 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants