From f57b61f7e65d03c9a6b2d05d52108f691bf32e8d Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Wed, 6 Jan 2021 20:17:16 +0000 Subject: [PATCH] Undo Record Bug Fixed It used to not let the user to start a new project --- studio/story.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/studio/story.py b/studio/story.py index 9e7c2bd..151d467 100644 --- a/studio/story.py +++ b/studio/story.py @@ -754,21 +754,22 @@ def undo_record(win): # This function will not read the files. It's not nessesary. But it will # make a copy of the whole thing. So I guess we need to implement some kind # of limiter. - - limit = int(win.settings["Undo_Limit"]) - - # Now let's advance the undo history 1 forward. - win.undo_index = min(len(win.undo_history)+1, limit) - - # Let's read our file - f = open(win.project+'/pln/story.vcss') - - win.undo_history.append(f.read()) - - # And now let's limit our selves - - win.undo_history = win.undo_history[0-limit:] - + try: + limit = int(win.settings["Undo_Limit"]) + + # Now let's advance the undo history 1 forward. + win.undo_index = min(len(win.undo_history)+1, limit) + + # Let's read our file. Which might not exist. + f = open(win.project+'/pln/story.vcss') + + win.undo_history.append(f.read()) + + # And now let's limit our selves + + win.undo_history = win.undo_history[0-limit:] + except: + pass # Following 2 functions are a big buggy at the moment. I will aprecieate if # someone going to look at them. Maybe it's to do with studio/studio_storyLayer.py