jonSS For some reason its reseting it

Who resets what? Remember that this is not a thread about your project. Have you managed to implement a simple undo system on your own in a fresh project following the model shown in my example? Do that and it'll make things a bit clearer. Don't just copypaste. Make your own variations. Add stuff to it. Do "what if" experiments with it. Tinker until you gain full understanding of how it works.

Again, the inspector has nothing to do with undo. If you're storing undoable data in an inspector then your architecture is not properly done. All undoable data needs to be on edited node's side. An inspector should only read that data and display it. Akin to classical model-view-controller design pattern.

Typically you'd implement something like update() or refresh() method in your inspector and call it every time you want to refresh what the inspector displays. In that method you'd read all the relevant data from the edited node and set the inspector's state accordingly. Everything that lives in the inspector should be totally disposable.

Also, not directly related, but all viewport input concerning the plugin (e.g. editing plugin supported nodes...) is best handled in EditorPlugin::_forward_*_gui_input(). See my example.

    xyz I dont know man... You want to force your its working stuff, and its the other s guys fault, you start looking like an idiot.
    I havent added anything to the inspector, about redo undo etc.. its on the plugIN node.
    I havent done the redoUndo, all i know is it reset "EditorInspectorPlugin" ( func _parse_begin(object) ) and everything along with it "inspect1 " etc...
    Ive made examples and tested it, and cant do anything to prevent those scripts startUp functions from running...
    If there are idiots that believe in what you say, good congralutations reason is on your side... but it doesnt work... shared believed doesnt make anything work..

      jonSS I see. Good luck with your future coding endeavors.

      For the record, here's an example undo project that contains only my above code.

      Lo and behold - it works! 😃 Who would've thunk it? 🐱

      undo-example.zip
      3kB

        xyz great !!! what iam supossed to do now ? create a new forum account and use the Tor Browser ?

        you need to add "EditorInspectorPlugin" and see if it reset...
        Also theres no reason, for to undoRedo to reset those scripts. I dont know if you added it to "EditorPlugin" or the node the plugIN handels ?

        not working in here:
        https://github.com/godotengine/godot/issues/97502

          jonSS Your arrogant attitude doesn't warrant this but here it is anyway 🙂

          Does undo work? Of course it does. Shocking, I know. Editor inspector plugin has nothing to do with undo, did I already say that?

          I suggest deleting that post on github unless you want to embarrass yourself. The only "issue" there is the lack of understanding of how this stuff is supposed to operate. I won't waste any more time trying to explain it to you just to be called an idiot in return. You don't listen. Here's the example with editor inspector plugin added on top. Learn from it. Or don't. Good luck 👍

          undo-example.zip
          4kB

          jonSS great !!! what iam supossed to do now ? create a new forum account and use the Tor Browser ?


          Why in my country under sanctions, with restriction of i-net from all sides, the file is downloaded? There must be a problem on your end.

          jonSS you start looking like an idiot.

          You're being too rude.

          • xyz replied to this.

            I made a mistake the download is working, it only works when you re logged in. You keep hammering me down and i forget this things.

            xyz PEBKAM, as they used to say back in the day 😃

            Ho no 😮 , ho my god its working !!! 😃
            apparently you example is not working either...

            I thought you ve made it work, just by making the undoRedo in the "extends EditorPlugin" instead of the handle object script.

            But he throws the same thing, "EditorInspectorPlugin" resets, just by to pressing any of the boxes on the editor,
            You problably going to tell me iam an idiot too, and i have to add the color to the undoRedo in the "stroke_draw_list" in "EditorPlugin"... The problem is why does the undoRedo resets the "EditorInspectorPlugin"...

            but fine leave it on... its working 99.9% of the cases, just move on to another thing whatever, if its not working or just working in 1 or 2 years from now whats the diference anyway... ( A thing that could be solve in 5 or 10min, its going to drag for a lot of time, because noOne its using it )
            But iam the "BadGuy" right, lets all become little friends and unite agaisnt the badGuy jonSS...lol

            • xyz replied to this.

              jonSS This is a bit far. @xyz Is only trying to explain from his perspective. We have rules here to respect each other.

                jonSS EditorInspectorPlugin::_parse_begin() is supposed to be called every time you select a node supported by EditorInspectorPlugin::_can_handle(). Nothing gets "reset". Custom controls scene is supposed to be instantiated every time this happens. Its _ready() is supposed to be called. You're complaining about things that happen by design.

                The skipped undo is due to possible bug in color picker gui modality. If you click into viewport with the color picker still open, EditorPlugin::_forward_canvas_gui_input() wont register mousedown event nor its counterpart mouseup event. This is the actual thing that may be worth reporting.

                For simplicity, my example was checking only for mouseup and mousemove envents. It implies stroke state instead of tracking it via a flag set by a received mousedown. Because of that, the stroke you start when a color picker is still visible won't make it into the undo queue.

                Easy fix by adding a flag into mouse input logic. It will now require an additional viewport click when trying to stroke from an open color picker. Courtesy of an apparent color picker glitch.

                All this is just menial gui stuff. Nothing to do with the core undo mechanism we're trying to demonstrate here.

                Now be a darling and check and report back how you feel undo performs in the project below.

                undo-example.zip
                4kB

                  xyz Its running fine now... but I dont know ?
                  I also think its normal for the inspector to reset when you change nodes...

                  • But why is it that in my case the "inspector" resets everytime i press the screen ?
                  • And it doesnt reset if i delete the "undoRedo" code, it runs perfecly normal ? like its running in your example...

                  Ive been messing with "func _forward_canvas_gui_input(event):" and nothing will change it back to normal... The only thing that makes it run right is if i remove the "undoRedo" code..

                  But never mind, i dont know why the "undoRedo" triggers that... And maybe it doesnt matter...
                  tileSets have been cursing this engine every since day one when it come out... problably some Dev whos in charge of tiles, did the undoRedo... best to just leave it alone... i just wanted to make my own tileMap so i could get out of dodge, i ill find another way to do the undoRedo...

                  • xyz replied to this.

                    jonSS Only wanted to address complaints about my example "not working". It works and it shows how undo is properly implemented. The rest of your questions have already been answered. Go re-read my posts.

                    Here's a hint; You do stuff with that dictionary outside of do/undo functions. Once you introduce undo functionality, all changes to that dictionary should be contained within those functions. Otherwise the thing will likely fall apart. And that's precisely what you're witnessing there.

                    Either that or the devs are intentionally destroying the engine, eh? 😮

                    jonSS Look at it from the bright side. Out of the whole ordeal you've learned one thing for sure - that it's spelled redo and not reNdo.

                    jonSS Btw the inspector refresh that is breaking your heart is triggered by notify_property_list_changed() called from undo/redo functions. This is again by design. The sole purpose of this function is precisely that - to refresh the inspector.

                    Also, you need to remove the inspector plugin in EditorPlugin::_exit_tree() by calling EdtorPlugin::remove_inspector_plugin(). Otherwise the custom inspector gets multiplied with every restart of the plugin.

                    Go do an arkanoid clone or something. Plugins are messing with your mind 😃

                    jonSS By the looks of it, we finally weeded out all of your undo related issues.

                      xyz You re forgeting "undo" wasnt made by me... I thought y were more focused on the "reNdo" ?
                      But i bet i have weeded out some of you guy(s) "undos" too... ( roofs of glass )

                        jonSS If you didn't want my help, you just could have said so at any time. I would have been happy to oblige. No need to resort to lengthy incoherent personal attacks. Ironically they intensified only after I solved quite a few of your problems in other threads. Remember, it was you who was asking for help in the first place. Don't worry though, you won't hear from me anymore. Have a nice day!

                        MikeCL I don't really know what's going on here. Why is the administration calmly observing the toxic behavior of a character who asked for help and then got personal? Some of his posts are just off-topic flud, and grossly rude. I understand his behavior, that he is frustrated that in his feeble mind he can't understand the explanation. That doesn't excuse him in any way: 428(❗️) "best answers" means @xyz can explain things in an accessible way. It in no way allows me to understand why insults to someone who has proven himself to be an excellent person here are ignored.

                        jonSS But i bet i have weeded out some of you guy(s) "undos" too... ( roofs of glass )

                        Child, who are you referring to?

                        Thanks @Tomcat, I appreciate it. It's okay though. I don't mind nasty words or insults being thrown at me. Although I do prefer them delivered with style and substance. Sadly, that wasn't the case here 🙂

                        Let the guy be. Maybe there's someone else on here more tuned into his way of reasoning, suited to help him with his programming efforts. I apparently am not. Let's leave it at that.

                        I'm just sorry that the thread got derailed by this nonsense. Undo is an interesting and somewhat complex topic. Certainly worthy of discussion.