-
Notifications
You must be signed in to change notification settings - Fork 149
refactor(preferences): Move OptionPreferences class into separate files #1840
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
base: main
Are you sure you want to change the base?
refactor(preferences): Move OptionPreferences class into separate files #1840
Conversation
0b163bd to
32c7126
Compare
10f65f6 to
f7e888b
Compare
xezon
left a comment
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.
The opening post says that files were added to Core, but that is not correct. And they cant be added to Core, because the files are not yet merged.
| Source/Common/Thing/ThingFactory.cpp | ||
| Source/Common/Thing/ThingTemplate.cpp | ||
| Source/Common/UserPreferences.cpp | ||
| Source/Common/OptionPreferences.cpp |
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.
This is meant to be alphabetically sorted.
|
|
||
| Bool getShowMoneyPerMinute(void) const; | ||
| }; | ||
| // TheSuperHackers @refactor bobtista 13/11/2025 Moved OptionPreferences to separate files. |
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.
This does not need to be documented.
| #include "Common/GameAudio.h" | ||
| #include "Common/GameEngine.h" | ||
| #include "Common/UserPreferences.h" | ||
| #include "Common/OptionPreferences.h" |
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.
Sort alphabetically
| Bool getShowMoneyPerMinute(void) const; | ||
| }; | ||
| // TheSuperHackers @refactor bobtista 13/11/2025 Moved OptionPreferences to separate files. | ||
| #include "Common/OptionPreferences.h" |
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.
Why is this include here? It is very unusual and unexpected to put an include in the middle of a header.
| #include "Common/OptionPreferences.h" | ||
|
|
||
| //----------------------------------------------------------------------------- | ||
| // LANPreferences class |
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.
After this is merged, you can also move this class into separate files.
| #include "Common/GameAudio.h" | ||
| #include "Common/GameEngine.h" | ||
| #include "Common/UserPreferences.h" | ||
| #include "Common/OptionPreferences.h" |
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.
When you include this, then you can remove #include "Common/UserPreferences.h"
| AsciiString m_filename; | ||
| }; | ||
|
|
||
| //----------------------------------------------------------------------------- |
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.
Now this moved away, I think you can remove the forward declarations above.
|
I think it would be good to merge and move user preferences to Core first, but it will require merging #2180 first. |
|
I have merged the UserPreferences code and moved it to Core with #2182. So when that is merged you can directly split off to Core and do not need 2 copies for it. |
Separates the
OptionPreferencesclass fromUserPreferences.handOptionsMenu.cppinto dedicated files and unified them in CoreChanges
New files created in Core:
Core/GameEngine/Include/Common/OptionPreferences.h- Class declarationCore/GameEngine/Source/Common/OptionPreferences.cpp- Implementation