-
Notifications
You must be signed in to change notification settings - Fork 209
Add 'Reset to Defaults' button for mod configs #364
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: dev
Are you sure you want to change the base?
Add 'Reset to Defaults' button for mod configs #364
Conversation
ryan-skabelund
commented
May 20, 2025
- Added a 'Reset to Defaults' button to each mod's config page
- Added a reset to default function to each ConfigProperty (C++)
- Properties requiring a world reload when in-game do not reset
- Fixed text flicker issue in textbox widgets during construction (notably when resetting, values appeared left-aligned briefly before centering).
- Adjusted section widget spacing slightly for more consistent layout
- Converted indentation to tabs for consistency
32df098
to
31818a1
Compare
6745cd6
to
d4be777
Compare
d4be777
to
66f297b
Compare
- Added a 'Reset to Defaults' button to each mod's config page - Added a reset to default function to each ConfigProperty (C++) - Properties requiring a world reload when in-game do not reset - Fixed text flicker issue in textbox widgets during construction (notably when resetting, values appeared left-aligned briefly before centering). - Adjusted section widget spacing slightly for more consistent layout
- Returns a bool from every ResetToDefault() to signal success or failure - Simplified ResetToDefault() so it no longer requires a default property argument - Added an Allow User Reset toggle on each config property - Added IsSetToDefaultValue() and GetDefaultValueAsString() in UConfigProperty - Added per-option reset buttons with tooltips showing default values and why reset is disabled if it is - Moved the Reset to Defaults button to the bottom right corner to match the game options button - Added confirmation popups. Shift+click skips confirmation
- Mod reset button now disables and shows a tooltip if all settings are set to their defaults. - Updated to latest dev commit
4f9e477
to
b7af332
Compare
…Reset as Transient
…tips. Change display name of ArrayProperty `DefaultValue` to `New Value Template`
…as it been showing all this time?!)
eae368c
to
601b096
Compare
…element as a demo of the tooltip showing it
This fixes integer enums not resetting properly and also aligns better with the overall design flow
…enabled. Hide default value when option is set to the default value. Expand array widget if collapsed on add/remove element.
- Clarified disabled mod/section tooltip when options require a world reload while in-game - Added array expansion on mod/section reset - Added section expansion on mod/section reset - Replaced 'Custom Construct' with 'Update Value' for mod/section resets
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.
- Copying the Value to DefaultValue on load feels like the wrong way around to do it. It would make more sense for Value to be transient and DefaultValue to be the one set in the editor. The data would have to be migrated to the other field in PostLoad (a core redirect wouldn't work because it would hide the Value property from BP scripts)
!bAllowUserReset || !bParentSectionAllowsUserReset
andbAllowUserReset && bParentSectionAllowsUserReset
are used quite often both in cpp and in BP, so it would make sense to add a BlueprintCallable FORCEINLINEAllowsReset
function returningbAllowUserReset && bParentSectionAllowsUserReset
} | ||
// Set default values to inherit Allow User Reset | ||
for (UConfigProperty* Property : DefaultValues) { | ||
if (Property && !bAllowUserReset || !bParentSectionAllowsUserReset) { |
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.
if (Property && !bAllowUserReset || !bParentSectionAllowsUserReset) { | |
if (Property && (!bAllowUserReset || !bParentSectionAllowsUserReset)) { |
|
||
/** If true, this property can be reset by the user from the Config Widget. */ | ||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Configuration Property") | ||
bool bAllowUserReset; |
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 set to true in all config property BPs, so it makes sense to just make it true here by default.
bool bAllowUserReset; | |
bool bAllowUserReset = true; |