Skip to content

Commit

Permalink
feat: allow array_cubed count to roll faux negative
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-hm committed Apr 22, 2022
1 parent e34350a commit 9138c66
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions power_mods/array_cubed.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ def modal(self, context, event):
if self.key_no_modifiers:
self.axis = (self.axis + 1) % 3
elif self.key_alt:
self.axes[self.axis][1] += 1
new_count = self.axes[self.axis][1] + (1 if self.axes[self.axis][2] >= 0 else -1)

if new_count == 1:
self.axes[self.axis][1] = 1
self.axes[self.axis][2] = self.axes[self.axis][2] * -1
else:
self.axes[self.axis][1] = new_count
elif self.key_ctrl:
self.axes[self.axis][2] += offset_factor

Expand All @@ -62,7 +68,13 @@ def modal(self, context, event):
if self.key_no_modifiers:
self.axis = (self.axis - 1) % 3
elif self.key_alt:
self.axes[self.axis][1] = max(1, self.axes[self.axis][1] - 1)
new_count = self.axes[self.axis][1] - (1 if self.axes[self.axis][2] >= 0 else -1)

if new_count == 0:
self.axes[self.axis][1] = 2
self.axes[self.axis][2] = self.axes[self.axis][2] * -1
else:
self.axes[self.axis][1] = new_count
elif self.key_ctrl:
self.axes[self.axis][2] -= offset_factor

Expand Down

0 comments on commit 9138c66

Please sign in to comment.