Added: Undo Limit setting
This commit is contained in:
parent
7be7390018
commit
c3158ccf7c
@ -114,6 +114,8 @@ Settings.vsync = Settings("vertical sync", 0)
|
|||||||
Settings.visibilityCheck = Settings("visibility check", False)
|
Settings.visibilityCheck = Settings("visibility check", False)
|
||||||
Settings.viewMode = Settings("View Mode", "Camera")
|
Settings.viewMode = Settings("View Mode", "Camera")
|
||||||
|
|
||||||
|
Settings.undoLimit = Settings("Undo Limit", 20)
|
||||||
|
|
||||||
ControlSettings = config.Settings("Controls")
|
ControlSettings = config.Settings("Controls")
|
||||||
ControlSettings.mouseSpeed = ControlSettings("mouse speed", 5.0)
|
ControlSettings.mouseSpeed = ControlSettings("mouse speed", 5.0)
|
||||||
ControlSettings.cameraAccel = ControlSettings("camera acceleration", 125.0)
|
ControlSettings.cameraAccel = ControlSettings("camera acceleration", 125.0)
|
||||||
@ -1513,7 +1515,9 @@ class LevelEditor(GLViewport):
|
|||||||
self.viewportContainer.top = row.bottom
|
self.viewportContainer.top = row.bottom
|
||||||
self.viewportContainer.size = self.mainViewport.size
|
self.viewportContainer.size = self.mainViewport.size
|
||||||
self.add(self.viewportContainer)
|
self.add(self.viewportContainer)
|
||||||
|
|
||||||
Settings.viewMode.addObserver(self)
|
Settings.viewMode.addObserver(self)
|
||||||
|
Settings.undoLimit.addObserver(self)
|
||||||
|
|
||||||
self.reloadToolbar()
|
self.reloadToolbar()
|
||||||
|
|
||||||
@ -3363,6 +3367,9 @@ class LevelEditor(GLViewport):
|
|||||||
def addOperation(self, op):
|
def addOperation(self, op):
|
||||||
if self.recordUndo:
|
if self.recordUndo:
|
||||||
self.undoStack.append(op)
|
self.undoStack.append(op)
|
||||||
|
if len(self.undoStack) > self.undoLimit:
|
||||||
|
self.undoStack.pop(0)
|
||||||
|
|
||||||
self.performWithRetry(op)
|
self.performWithRetry(op)
|
||||||
|
|
||||||
recordUndo = True
|
recordUndo = True
|
||||||
|
@ -493,6 +493,9 @@ class OptionsPanel(Dialog):
|
|||||||
mouseSpeedRow = mceutils.FloatInputRow("Mouse Speed: ",
|
mouseSpeedRow = mceutils.FloatInputRow("Mouse Speed: ",
|
||||||
ref=ControlSettings.mouseSpeed.propertyRef(), width=100, min=0.1, max=20.0)
|
ref=ControlSettings.mouseSpeed.propertyRef(), width=100, min=0.1, max=20.0)
|
||||||
|
|
||||||
|
undoLimitRow = mceutils.IntInputRow("Undo Limit: ",
|
||||||
|
ref=Settings.undoLimit.propertyRef(), width=100, min=0)
|
||||||
|
|
||||||
invertRow = mceutils.CheckBoxLabel("Invert Mouse",
|
invertRow = mceutils.CheckBoxLabel("Invert Mouse",
|
||||||
ref=ControlSettings.invertMousePitch.propertyRef(),
|
ref=ControlSettings.invertMousePitch.propertyRef(),
|
||||||
tooltipText="Reverse the up and down motion of the mouse.")
|
tooltipText="Reverse the up and down motion of the mouse.")
|
||||||
@ -542,6 +545,7 @@ class OptionsPanel(Dialog):
|
|||||||
cameraBrakeSpeedRow,
|
cameraBrakeSpeedRow,
|
||||||
blockBufferRow,
|
blockBufferRow,
|
||||||
mouseSpeedRow,
|
mouseSpeedRow,
|
||||||
|
undoLimitRow,
|
||||||
)
|
)
|
||||||
|
|
||||||
options = (
|
options = (
|
||||||
|
Reference in New Issue
Block a user