fixed some derpy stuff and implemented lower bounds on depth and step size

This commit is contained in:
Paul Liverman III 2017-07-26 23:10:29 -07:00
parent 8869727321
commit eb128e3ecc

View File

@ -74,8 +74,8 @@ function piefiller:new(settings)
reset = "r", reset = "r",
increase_depth = "down", increase_depth = "down",
decrease_depth = "up", decrease_depth = "up",
increase_step_size = "-", increase_step_size = "=",
decrease_step_size = "=", decrease_step_size = "-",
shorten_names = "z", shorten_names = "z",
show_hidden = "h", show_hidden = "h",
save_to_file = "e", save_to_file = "e",
@ -342,13 +342,17 @@ function piefiller:keypressed(key)
self.depth = self.depth + 1 self.depth = self.depth + 1
elseif command == "decrease_depth" then elseif command == "decrease_depth" then
self:reset() self:reset()
if self.depth > 1 then
self.depth = self.depth - 1 self.depth = self.depth - 1
end
elseif command == "increase_step_size" then elseif command == "increase_step_size" then
self:reset() self:reset()
self.step = self.step - 1 self.step = self.step + 1
elseif command == "decrease_step_size" then elseif command == "decrease_step_size" then
self:reset() self:reset()
self.step = self.step +1 if self.step > 0 then
self.step = self.step - 1
end
elseif command == "shorten_names" then elseif command == "shorten_names" then
self.small = not self.small self.small = not self.small
elseif command == "show_hidden" then elseif command == "show_hidden" then