-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Better ter/furn copy-from support #73211
Conversation
What do you mean by paint meta data? My interest stems from the issue of "terrain" completely overwriting information about the actual terrain, and thus making it impossible to restore the actual terrain when the "terrain" is removed (you have to hard code some best guess). |
Basically I have a local branch that makes it so piant can be applied to any terrain with a PAINTABLE flag (and consequently removed by a chipper still) without changing the id of the terrain itself, just the visual stuff it displays. For mapgen I think I'm looking at doing it as a |
Can we also inherit colour? I see no reason to have to repeat it every time. |
Yes? |
Ok going through all our ter/furn in this PR is enormous scope creep I think I'll dial this back to just C++ and removing redundant JSON stuff and do abstract/copy-from stuff in seperate follow-up PRs |
b30b99c
to
6beff79
Compare
bash should also be doing this but it'd be ugly to move over rn
991dc97
to
af2417c
Compare
Ok the changes to bash and deconstruct are getting a bit much I think I'm going to scale back the PR a lil by reverting them and then just finalising what I have and then I'll attack them separately later |
This reverts commit 11cdd92. Revert "Deduplicate a couple of bash checks in lieu of making it optional" This reverts commit af2417c. Revert "Use std::optional for deconstruct" This reverts commit 09dad60. Revert "Less ugly variantless way" This reverts commit 11fbb4a. Revert "Slightly less gross but still std::variant" This reverts commit 88eae1e. Revert "std::variant works but I definately shouldn't be using it here" This reverts commit b8130a5. Revert "Somehow this is worse" This reverts commit aaceacf. Revert "Attempting to split map_bash_info" This reverts commit bf733b1.
Closing as stale. If you wish to continue working on this, ping me to reopen. |
Summary
Infrastructure "Better ter/furn copy from support, remove legacy alias code"
Purpose of change
copy-from good
Fixes #54702
Describe the solution
More copy-from support:
"symbol"
supports copy-fromTRANSPARENT
flag inherits correctly"flags"
support extend/delete"connect_groups"
,"connects_to"
and"rotates_to"
support copy-fromRemoves remaining redundant aliases and alias code
Removes
LINE_OXOX
andLINE_XOXO
handling replacing it with better generic unicode character handling. Currently changes symbols to what they were already using but when I add abstracts I'll probably make most walls # instead. (The symbol only affects unconnected instances of the terrain/furniture)Removes legacy
connects_to
/rotates_to
flag support enabled by #73415Merges some duplicate code in
ter_t::load
andfurn_t::load
intomap_data_common_t::load
Will attempt to ensure you can overwrite
"bash"
's,"deconstruct"
's and"pry"
's"ter_set"
/"result"
without redefining the other values for stuff like doors where that's the main difference while allowing ie"bash": { }
to correctly default all the fields inherited.May add tests to check stuff like the above works.
Will likely update inheritance docsNvm I forgot how atrocious our existing inheritance docs were for a momentWas originally going to add abstract terrains/furniture to cut alot of json bloat but I'll do that in future PRs bc it was getting too big to review
May remove legacy connects_to/rotates_to flag support if applying the necessary JSON changes in this PR isn't too much otherwise I'll leave it till after the follow-up PRs adding copy-from to alot of existing ter/furnWill add abstract versions of basic terrain (probably just walls/windows/doors/floors/roofs for now)Moves painted walls to their own file bc they were taking up half the fileCorrects several discrepancies between similar terrainsDescribe alternatives you've considered
Deduplicating parts of
ter_t::check
andfurn_t::check
intomap_data_common_t::check
butmap_data_common_t
doesn't have the respective ids so the debug messages would be less useful.I found an extern list of traps I missed while doing #72766 and #72834 which I'll remove in a separate PR
Testing
Additional context
I'd still like to make paint metadata instead of needing to have individual terrains/furniture but the save/load side of things isn't easy
NTS: Check using copy-from with an id of the wrong type (ter with furn or vice versa) throws an error. (While this could theoretically be supported I don't think it would be a good idea)