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

Allow per-part default shape to be configured #23

Merged

Conversation

siimav
Copy link

@siimav siimav commented Dec 25, 2023

The current default of a 4x4m rectangular slab doesn't make much sense IMO. I would like to configure it to look like a smaller fin in RO.

@linuxgurugamer
Copy link

This seems to be conflicting with the merge did of your other PR, can you please fix, I don't want to mess it up

@siimav
Copy link
Author

siimav commented Dec 28, 2023

Rebased to resolve the conflicts.

@linuxgurugamer linuxgurugamer merged commit eb3af79 into B9-Procedural-Wings:master Dec 29, 2023
@linuxgurugamer
Copy link

linuxgurugamer commented Dec 29, 2023

I was testing this, the save as default didn't seem to be working , or possibly I'm not using it correctly. I attached a part, changed some of the sizes and then clicked the "Save as default" button at the bottom of the window

I guess the real question is, what default values are being saved ?

@siimav siimav deleted the ConfigureDefaultShape branch December 29, 2023 11:25
@siimav
Copy link
Author

siimav commented Dec 29, 2023

Oof, you appear to be correct that this change broke the "Save as default" feature. Looks like it was overwriting the values in the static fields that I now made non-static so that they could be MM-patched. So previously the overwritten defaults were active for the lifetime of the current game session and got reset on next startup.

I need to figure out if we want to restore this exact behavior or make them persist between game sessions. 🤔

@linuxgurugamer
Copy link

Oh, so you wanted to MM patch the parts on startup. That's not a great idea, breaking existing functionality.
Would be better if it saved default values to a config file which you could patch if necessary, and load that config file when the part is instantiated in the editor

@linuxgurugamer
Copy link

From what I can tell from the PR, the following are the fields which you removed the "static" setting from:

sharedBaseLengthDefaults
sharedBaseWidthRootDefaults
sharedBaseWidthTipDefaults
sharedBaseOffsetRootDefaults
sharedBaseOffsetTipDefaults
sharedBaseThicknessRootDefaults
sharedBaseThicknessTipDefaults
sharedEdgeTypeLeadingDefaults
sharedEdgeWidthLeadingRootDefaults
sharedEdgeWidthLeadingTipDefaults
sharedEdgeTypeTrailingDefaults
sharedEdgeWidthTrailingRootDefaults
sharedEdgeWidthTrailingTipDefaults

I am going to revert this change, and then add some code to load the values into these fields from a config file (if exists), that should give you the ability to have different defaults using a MM config file. I'll also include a cfg file so it will always be there

@siimav
Copy link
Author

siimav commented Dec 30, 2023

I am going to revert this change, and then add some code to load the values into these fields from a config file (if exists), that should give you the ability to have different defaults using a MM config file. I'll also include a cfg file so it will always be there

I guess that would work assuming that the "Save as default" feature doesn't try to overwrite the cfg (and thus invalidate the MM cache). My initial idea was that you could use MM to clone the part into different copies that all come with a different predefined shape. I agree that this gets awkward in the presence of "Save as default" since all the parts would turn out to be the exact same. So your idea is probably the better way forward.

@siimav
Copy link
Author

siimav commented Jan 6, 2024

Implemented the changes in #24

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.

None yet

2 participants