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

feat(settings): add method that saves settings to file #1362

Merged
merged 3 commits into from
Nov 29, 2024

Conversation

SrGesus
Copy link
Contributor

@SrGesus SrGesus commented Nov 8, 2024

Description

Include a summary of the changes here.

Checklist

  • Self-review changes.
  • Evaluate impact on the documentation.
  • Ensure test coverage.
  • Write new samples.
  • Add entry to the changelog's unreleased section.

@SrGesus SrGesus linked an issue Nov 8, 2024 that may be closed by this pull request
github-actions[bot]

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Nov 8, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://GameDevTecnico.github.io/cubos/preview/pr-1362/
on branch gh-pages at 2024-11-29 17:11 UTC

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from 5e78cd1 to 2f8e5d7 Compare November 8, 2024 22:12
github-actions[bot]

This comment was marked as resolved.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 48.38710% with 32 lines in your changes missing coverage. Please review.

Project coverage is 53.43%. Comparing base (99302b3) to head (a0a4782).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
engine/src/settings/settings.cpp 46.55% 31 Missing ⚠️
engine/src/settings/plugin.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1362      +/-   ##
==========================================
- Coverage   53.47%   53.43%   -0.04%     
==========================================
  Files         451      451              
  Lines       25802    25827      +25     
  Branches     2386     2390       +4     
==========================================
+ Hits        13797    13801       +4     
- Misses      12005    12026      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from 2f8e5d7 to c0b3680 Compare November 17, 2024 16:10
github-actions[bot]

This comment was marked as resolved.

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from c0b3680 to 0039bd8 Compare November 17, 2024 16:11
@SrGesus SrGesus marked this pull request as ready for review November 17, 2024 16:11
@SrGesus SrGesus requested review from RiscadoA and a team as code owners November 17, 2024 16:11
@SrGesus SrGesus requested review from diogomsmiranda and removed request for a team November 17, 2024 16:11
github-actions[bot]

This comment was marked as resolved.

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from 0039bd8 to dd7b3fa Compare November 17, 2024 16:13
@SrGesus SrGesus self-assigned this Nov 17, 2024
@SrGesus SrGesus requested a review from a team November 17, 2024 16:16
@RiscadoA
Copy link
Member

If we do end up reimplementing the settings resource as a system argument, this would no longer be necessary 🤔
You could just have a Settings::save method, which ig would be even better because then you don't need to mess with the weird event system we have and it is also synchronous. Opinions?

@SrGesus
Copy link
Contributor Author

SrGesus commented Nov 17, 2024

I think we wanted events to be able to do something if a setting changes, e.g reload graphics if you change a graphics setting or something and there we will need to use something similar if not events (like an observer idk).
But yes for saving i don't need events, in fact i can do it without events without reimplementing settings

@RiscadoA
Copy link
Member

I think we wanted events to be able to do something if a setting changes, e.g reload graphics if you change a graphics setting or something and there we will need to use something similar if not events (like an observer idk). But yes for saving i don't need events, in fact i can do it without events without reimplementing settings

Yeah on that case I agree that we should have an event. But yeah, here I think it's probably best to keep the 'save trigger' as a method only. I don't see a use case for the event rn

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from dd7b3fa to 5c25ce5 Compare November 18, 2024 22:46
@SrGesus SrGesus changed the title feat(settings): add event that saves settings to file feat(settings): add method that saves settings to file Nov 18, 2024
github-actions[bot]

This comment was marked as outdated.

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch 3 times, most recently from 3fb4eb3 to ccb712a Compare November 18, 2024 23:21
Copy link
Member

@RiscadoA RiscadoA left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I would just simplify this a bit before merging.
Also, don't forget the changelog entry 😌

engine/src/settings/settings.cpp Outdated Show resolved Hide resolved
engine/src/settings/settings.cpp Outdated Show resolved Hide resolved
Copy link
Member

@RiscadoA RiscadoA left a comment

Choose a reason for hiding this comment

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

Accidentally dismissed my own review, my bad

@diogomsmiranda
Copy link
Contributor

What is the status on this? Is this ready for review?

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch 2 times, most recently from 3df89fd to e98b276 Compare November 22, 2024 12:58
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

engine/src/settings/settings.cpp Outdated Show resolved Hide resolved
@SrGesus
Copy link
Contributor Author

SrGesus commented Nov 22, 2024

What is the status on this? Is this ready for review?

The settings part should be done now. I just intend on adding a few tests and the changelog.

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from e98b276 to 017d5cd Compare November 22, 2024 16:42
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

engine/src/settings/settings.cpp Outdated Show resolved Hide resolved
engine/include/cubos/engine/settings/settings.hpp Outdated Show resolved Hide resolved
@RiscadoA RiscadoA added this to the 0.5 milestone Nov 23, 2024
@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from 017d5cd to e86254f Compare November 23, 2024 23:11
@SrGesus SrGesus requested review from a team and RiscadoA and removed request for a team November 24, 2024 12:30
@RiscadoA RiscadoA requested a review from a team November 25, 2024 08:20
Copy link
Member

@RiscadoA RiscadoA left a comment

Choose a reason for hiding this comment

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

Other than the comments I pointed out, LGTM!

engine/include/cubos/engine/settings/settings.hpp Outdated Show resolved Hide resolved
engine/include/cubos/engine/settings/settings.hpp Outdated Show resolved Hide resolved
engine/samples/settings/main.cpp Outdated Show resolved Hide resolved
engine/samples/settings/main.cpp Outdated Show resolved Hide resolved
engine/src/settings/settings.cpp Outdated Show resolved Hide resolved
engine/src/settings/settings.cpp Outdated Show resolved Hide resolved
@RiscadoA
Copy link
Member

Also don't forget to update the CHANGELOG!

@RiscadoA RiscadoA requested review from a team and RodrigoVintem and removed request for a team November 25, 2024 08:25
Copy link
Contributor

@diogomsmiranda diogomsmiranda left a comment

Choose a reason for hiding this comment

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

LGTM!

@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from e86254f to 8a4458a Compare November 29, 2024 17:04
@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch 2 times, most recently from 65118a6 to 09d72cb Compare November 29, 2024 17:52
@SrGesus SrGesus force-pushed the 1349-add-a-method-of-saving-settings-back-to-a-file branch from 09d72cb to a0a4782 Compare November 29, 2024 17:54
@SrGesus SrGesus merged commit 515b9fd into main Nov 29, 2024
11 checks passed
@SrGesus SrGesus deleted the 1349-add-a-method-of-saving-settings-back-to-a-file branch November 29, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a method of saving settings back to a file
4 participants