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

@@ -2,6 +2,8 @@
#
#===============================================================================
class UIControls::Scrollbar < UIControls::BaseControl
attr_reader :slider_top
SLIDER_WIDTH = 16
WIDTH_PADDING = 0
SCROLL_DISTANCE = 16
@@ -9,8 +11,6 @@ class UIControls::Scrollbar < UIControls::BaseControl
SLIDER_COLOR = Color.black
GRAB_COLOR = HOVER_COLOR # Cyan
attr_reader :slider_top
def initialize(x, y, size, viewport, horizontal = false, always_visible = false)
if horizontal
super(size, SLIDER_WIDTH, viewport)
@@ -28,18 +28,7 @@ class UIControls::Scrollbar < UIControls::BaseControl
self.visible = @always_visible
end
def position
return 0 if @range <= @tray_size
return (@range - @tray_size) * @slider_top / (@tray_size - @slider_size)
end
def minimum?
return @slider_top <= 0
end
def maximum?
return @slider_top >= @tray_size - @slider_size
end
#-----------------------------------------------------------------------------
# Range is the total size of the large area that the scrollbar is able to
# show part of.
@@ -68,6 +57,21 @@ class UIControls::Scrollbar < UIControls::BaseControl
invalidate if @slider_top != old_val
end
def position
return 0 if @range <= @tray_size
return (@range - @tray_size) * @slider_top / (@tray_size - @slider_size)
end
def minimum?
return @slider_top <= 0
end
def maximum?
return @slider_top >= @tray_size - @slider_size
end
#-----------------------------------------------------------------------------
def set_interactive_rects
@interactions = {}
if @horizontal