zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
115 stars 23 forks source link

Texture/Projection windows shouldn't be managing undo/redo #91

Open m-7761 opened 4 years ago

m-7761 commented 4 years ago

There's special code in these nonmodal windows for handling Ctrl+Z and Ctrl+Y ... but A) I think it's probably unnecessary since they already respond to m_changeBits events ... and B) the logic is written as-if the windows are modal, and so breaks down as soon as users switch between them and the main windows vis-a-vis undo/redo commands.

The solution is simple in theory: just forward the inputs to the main window's undo/redo handlers.

m-7761 commented 4 years ago

The Texture window has m_inUndo. I've added getUndoEnabled to Model in its place. The faulty code can't detect undo originating from outside of itself... maybe the window was modal when it was written.