TheDuckCow / godot-road-generator

A godot plugin for creating 3D highways and streets.
MIT License
349 stars 18 forks source link

4.x UndoRedo history mismatch editor errors #193

Open TheDuckCow opened 2 days ago

TheDuckCow commented 2 days ago

With the upcoming version v0.5.1 per here, there's still a number of rogue error messages in this godot 4 version compared to 3.5, but they seem to have little or no consequence aside from being annoying.

One of those that I'm currently scratching my head at are these 4 which print out when using the UI buttons to add a RoadPoint:

  UndoRedo history mismatch: expected 0, got 2.
  UndoRedo history mismatch: expected 0, got 2.
  UndoRedo history mismatch: expected 0, got 2.
  UndoRedo history mismatch: expected 0, got 2.

Counter to what one might expect, undo and redo work perfectly fine even going back further steps and returning to the "do" step. There's also a bunch of errors with the first RoadPoint added when initially a RoadContainer is added. I think that one is happening due to Update Edges being called before the targeted RoadPoint is fully in the scene, thus getting some long UI editor path nodes that are ultimately invalid. The user doesn't face any consequence now as I ensure another call to Update Edges happens at the end of the action, but still - could be nice one day to clean up the errors.

TheDuckCow commented 2 days ago

Some of these errors turned out to actually still be in 3.5x too, resolved via this commit (https://github.com/TheDuckCow/godot-road-generator/pull/192/commits/3ea5dfeec33d5736c2950e979ef18f4d24b3884c) which I'm also creating a parallel 4.x change for here. But the off undo/redo count errors still happen somewhat randomly.