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

@@ -20,6 +20,8 @@ class UIControls::TextBox < UIControls::BaseControl
@blacklist = []
end
#-----------------------------------------------------------------------------
def value
return @value.dup
end
@@ -60,36 +62,6 @@ class UIControls::TextBox < UIControls::BaseControl
invalidate
end
def set_interactive_rects
@text_box_rect = Rect.new(TEXT_BOX_X, (height - TEXT_BOX_HEIGHT) / 2,
[@box_width, width - (TEXT_BOX_X * 2)].min, TEXT_BOX_HEIGHT)
@interactions = {
:text_box => @text_box_rect
}
end
#-----------------------------------------------------------------------------
def disabled?
val = (@value.respond_to?("strip!")) ? @value.strip : @value
return true if @blacklist.include?(val)
return super
end
def busy?
return @cursor_pos >= 0 if @captured_area == :text_box
return super
end
def reset_interaction
@cursor_pos = -1
@display_pos = 0
@cursor_timer = nil
@initial_value = nil
Input.text_input = false
invalidate
end
#-----------------------------------------------------------------------------
def get_cursor_index_from_mouse_position
@@ -107,6 +79,36 @@ class UIControls::TextBox < UIControls::BaseControl
return @value.to_s.length
end
def disabled?
val = (@value.respond_to?("strip!")) ? @value.strip : @value
return true if @blacklist.include?(val)
return super
end
def busy?
return @cursor_pos >= 0 if @captured_area == :text_box
return super
end
#-----------------------------------------------------------------------------
def set_interactive_rects
@text_box_rect = Rect.new(TEXT_BOX_X, (height - TEXT_BOX_HEIGHT) / 2,
[@box_width, width - (TEXT_BOX_X * 2)].min, TEXT_BOX_HEIGHT)
@interactions = {
:text_box => @text_box_rect
}
end
def reset_interaction
@cursor_pos = -1
@display_pos = 0
@cursor_timer = nil
@initial_value = nil
Input.text_input = false
invalidate
end
def reset_display_pos
box_width = @text_box_rect.width - (TEXT_BOX_PADDING * 2)
char_widths = []