Anim Editor: added FoeFlip property, Space to play, S to swap sides, P to show/hide property lines for selected particle

This commit is contained in:
Maruno17
2024-04-18 22:35:15 +01:00
parent 15033d6114
commit 4480def33c
23 changed files with 264 additions and 161 deletions

View File

@@ -7,7 +7,6 @@ class UIControls::NumberTextBox < UIControls::TextBox
PLUS_MINUS_SIZE = 16
CONTROL_PADDING = 2 # Gap between buttons and text box
MINUS_X = 0
TEXT_BOX_X = MINUS_X + PLUS_MINUS_SIZE + CONTROL_PADDING
TEXT_BOX_WIDTH = 64
@@ -21,6 +20,8 @@ class UIControls::NumberTextBox < UIControls::TextBox
self.value = value
end
#-----------------------------------------------------------------------------
def value=(new_value)
old_val = @value.to_i
@value = new_value.to_i.clamp(self.min_value, self.max_value)
@@ -49,6 +50,8 @@ class UIControls::NumberTextBox < UIControls::TextBox
invalidate
end
#-----------------------------------------------------------------------------
def set_interactive_rects
@text_box_rect = Rect.new(TEXT_BOX_X, (height - TEXT_BOX_HEIGHT) / 2,
TEXT_BOX_WIDTH, TEXT_BOX_HEIGHT)
@@ -61,8 +64,6 @@ class UIControls::NumberTextBox < UIControls::TextBox
}
end
#-----------------------------------------------------------------------------
def reset_interaction
super
self.value = @value # Turn value back into a number and clamp it