Open hhyyrylainen opened 1 year ago
I'm still getting actions created with blank modifications unfortunately. If I place an organelle, modify it, make no changes and click ok, then I need to press undo twice to delete the organelle.
The exceptions are the pilus and cilia, which have actual upgrades as opposed to modifications. They do appear to be working correctly. But unless I'm missing something I think the other organelles are still bugged.
Can confirm with Lysosome and Chemoreceptor.
Regarding the blank modifications, it was discussed how to compare null to the default options: https://github.com/Revolutionary-Games/Thrive/pull/4463#discussion_r1321060419 and well the code was written so that the equals method doesn't compare null equally to the default value. This results in "blank" actions being created (they actually modify the data from null to a default valued instance). It might be very difficult to improve the GUI side (where I think this will need to go) to skip creating actions when nothing has been changed, or maybe emitting a change to null when doing a modify to default options (this might be the easiest way). Pinging @Kashnox just in case they are not watching this issue.
Yeah, we originally decided it was acceptable to add something to the history the first time you open the Lysosome or Chemoreceptor modification menus, but I can take another look later in the week to see if there's a simple solution I didn't see before now that I know my way around the editor a lot better.
to avoid creating pointless actions in the action history
needs some interface or something for the custom data to also allow comparing itself