Anim Editor: colour changes

This commit is contained in:
Maruno17
2024-04-13 22:13:21 +01:00
parent c14faf3fed
commit 184ce47b93
7 changed files with 21 additions and 19 deletions

View File

@@ -11,8 +11,8 @@ class UIControls::BaseControl < BitmapSprite
TEXT_COLOR = Color.black TEXT_COLOR = Color.black
TEXT_SIZE = 18 # Default is 22 if size isn't explicitly set TEXT_SIZE = 18 # Default is 22 if size isn't explicitly set
TEXT_OFFSET_Y = 5 TEXT_OFFSET_Y = 5
HOVER_COLOR = Color.cyan # For clickable area when hovering over it HOVER_COLOR = Color.new(224, 255, 255) # For clickable area when hovering over it; light blue
CAPTURE_COLOR = Color.pink # For area you clicked in but aren't hovering over CAPTURE_COLOR = Color.new(255, 64, 128) # For area you clicked in but aren't hovering over; hot pink
DISABLED_COLOR = Color.gray DISABLED_COLOR = Color.gray
DISABLED_COLOR_DARK = Color.new(128, 128, 128) DISABLED_COLOR_DARK = Color.new(128, 128, 128)

View File

@@ -8,7 +8,7 @@ class UIControls::Checkbox < UIControls::BaseControl
CHECKBOX_FILL_SIZE = CHECKBOX_HEIGHT - 4 CHECKBOX_FILL_SIZE = CHECKBOX_HEIGHT - 4
UNCHECKED_COLOR = Color.gray UNCHECKED_COLOR = Color.gray
CHECKED_COLOR = Color.new(64, 255, 64) # Green CHECKED_COLOR = Color.new(48, 192, 48) # Darkish green
def initialize(width, height, viewport, value = false) def initialize(width, height, viewport, value = false)
super(width, height, viewport) super(width, height, viewport)

View File

@@ -8,7 +8,7 @@ class UIControls::Button < UIControls::BaseControl
BUTTON_HEIGHT = 28 # Used when @fixed_size is false BUTTON_HEIGHT = 28 # Used when @fixed_size is false
# TODO: This will also depend on the font size. # TODO: This will also depend on the font size.
TEXT_BASE_OFFSET_Y = 18 # Text is centred vertically in the button TEXT_BASE_OFFSET_Y = 18 # Text is centred vertically in the button
HIGHLIGHT_COLOR = Color.green HIGHLIGHT_COLOR = Color.new(224, 192, 32) # Dark yellow
def initialize(width, height, viewport, text = "") def initialize(width, height, viewport, text = "")
super(width, height, viewport) super(width, height, viewport)

View File

@@ -7,7 +7,7 @@ class UIControls::List < UIControls::BaseControl
TEXT_PADDING_X = 4 TEXT_PADDING_X = 4
TEXT_OFFSET_Y = 3 TEXT_OFFSET_Y = 3
SELECTED_ROW_COLOR = Color.green SELECTED_ROW_COLOR = Color.new(216, 192, 32) # Dark yellow
def initialize(width, height, viewport, values = []) def initialize(width, height, viewport, values = [])
super(width, height, viewport) super(width, height, viewport)

View File

@@ -137,8 +137,8 @@ class AnimationEditor
when 1, 12 then wid = 4 when 1, 12 then wid = 4
else wid = 5 else wid = 5
end end
@delete_bitmap.fill_rect([i - 1, 1].max, i + 1, wid, 1, Color.red) @delete_bitmap.fill_rect([i - 1, 1].max, i + 1, wid, 1, Color.new(248, 96, 96))
@delete_bitmap.fill_rect([i - 1, 1].max, 14 - i, wid, 1, Color.red) @delete_bitmap.fill_rect([i - 1, 1].max, 14 - i, wid, 1, Color.new(248, 96, 96))
@delete_disabled_bitmap.fill_rect([i - 1, 1].max, i + 1, wid, 1, Color.new(160, 160, 160)) @delete_disabled_bitmap.fill_rect([i - 1, 1].max, i + 1, wid, 1, Color.new(160, 160, 160))
@delete_disabled_bitmap.fill_rect([i - 1, 1].max, 14 - i, wid, 1, Color.new(160, 160, 160)) @delete_disabled_bitmap.fill_rect([i - 1, 1].max, 14 - i, wid, 1, Color.new(160, 160, 160))
end end

View File

@@ -15,6 +15,7 @@ class AnimationEditor::Canvas < Sprite
attr_reader :values attr_reader :values
FRAME_SIZE = 48 FRAME_SIZE = 48
PARTICLE_FRAME_COLOR = Color.new(0, 0, 0, 64)
def initialize(viewport, anim, settings) def initialize(viewport, anim, settings)
super(viewport) super(viewport)
@@ -58,8 +59,8 @@ class AnimationEditor::Canvas < Sprite
def initialize_particle_frames def initialize_particle_frames
# Frame for selected particle # Frame for selected particle
@sel_frame_bitmap = Bitmap.new(FRAME_SIZE, FRAME_SIZE) @sel_frame_bitmap = Bitmap.new(FRAME_SIZE, FRAME_SIZE)
@sel_frame_bitmap.outline_rect(0, 0, @sel_frame_bitmap.width, @sel_frame_bitmap.height, Color.new(0, 0, 0, 64)) @sel_frame_bitmap.outline_rect(0, 0, @sel_frame_bitmap.width, @sel_frame_bitmap.height, PARTICLE_FRAME_COLOR)
@sel_frame_bitmap.outline_rect(2, 2, @sel_frame_bitmap.width - 4, @sel_frame_bitmap.height - 4, Color.new(0, 0, 0, 64)) @sel_frame_bitmap.outline_rect(2, 2, @sel_frame_bitmap.width - 4, @sel_frame_bitmap.height - 4, PARTICLE_FRAME_COLOR)
@sel_frame_sprite = Sprite.new(viewport) @sel_frame_sprite = Sprite.new(viewport)
@sel_frame_sprite.bitmap = @sel_frame_bitmap @sel_frame_sprite.bitmap = @sel_frame_bitmap
@sel_frame_sprite.z = 99999 @sel_frame_sprite.z = 99999
@@ -67,7 +68,7 @@ class AnimationEditor::Canvas < Sprite
@sel_frame_sprite.oy = @sel_frame_bitmap.height / 2 @sel_frame_sprite.oy = @sel_frame_bitmap.height / 2
# Frame for other particles # Frame for other particles
@frame_bitmap = Bitmap.new(FRAME_SIZE, FRAME_SIZE) @frame_bitmap = Bitmap.new(FRAME_SIZE, FRAME_SIZE)
@frame_bitmap.outline_rect(1, 1, @frame_bitmap.width - 2, @frame_bitmap.height - 2, Color.new(0, 0, 0, 64)) @frame_bitmap.outline_rect(1, 1, @frame_bitmap.width - 2, @frame_bitmap.height - 2, PARTICLE_FRAME_COLOR)
@battler_frame_sprites = [] @battler_frame_sprites = []
@frame_sprites = [] @frame_sprites = []
end end

View File

@@ -28,16 +28,17 @@ class AnimationEditor::ParticleList < UIControls::BaseControl
:foreground => Color.new(128, 160, 248), # Blue :foreground => Color.new(128, 160, 248), # Blue
:midground => Color.new(128, 160, 248), # Blue :midground => Color.new(128, 160, 248), # Blue
:background => Color.new(128, 160, 248), # Blue :background => Color.new(128, 160, 248), # Blue
:user => Color.new(96, 248, 96), # Green :user => Color.new(64, 224, 64), # Green
:target => Color.new(248, 96, 96), # Red :target => Color.new(224, 64, 64), # Red
:user_and_target => Color.new(248, 248, 96), # Yellow :user_and_target => Color.new(224, 224, 64), # Yellow
:user_side_foreground => Color.new(128, 248, 248), # Cyan :user_side_foreground => Color.new(128, 224, 224), # Cyan
:user_side_background => Color.new(128, 248, 248), # Cyan :user_side_background => Color.new(128, 224, 224), # Cyan
:target_side_foreground => Color.new(128, 248, 248), # Cyan :target_side_foreground => Color.new(128, 224, 224), # Cyan
:target_side_background => Color.new(128, 248, 248) # Cyan :target_side_background => Color.new(128, 224, 224) # Cyan
} }
SE_CONTROL_BG_COLOR = Color.gray SE_CONTROL_BG_COLOR = Color.gray
TIME_AFTER_ANIMATION_COLOR = Color.new(160, 160, 160) TIME_AFTER_ANIMATION_COLOR = Color.new(160, 160, 160)
POSITION_LINE_COLOR = Color.new(248, 96, 96)
attr_reader :keyframe # The selected keyframe attr_reader :keyframe # The selected keyframe
attr_reader :values attr_reader :values
@@ -123,12 +124,12 @@ class AnimationEditor::ParticleList < UIControls::BaseControl
# Position line sprite # Position line sprite
@position_sprite = BitmapSprite.new(3, height - UIControls::Scrollbar::SLIDER_WIDTH - VIEWPORT_SPACING, @position_viewport) @position_sprite = BitmapSprite.new(3, height - UIControls::Scrollbar::SLIDER_WIDTH - VIEWPORT_SPACING, @position_viewport)
@position_sprite.ox = @position_sprite.width / 2 @position_sprite.ox = @position_sprite.width / 2
@position_sprite.bitmap.fill_rect(0, 0, @position_sprite.bitmap.width, @position_sprite.bitmap.height, Color.red) @position_sprite.bitmap.fill_rect(0, 0, @position_sprite.bitmap.width, @position_sprite.bitmap.height, POSITION_LINE_COLOR)
# Selected particle line sprite # Selected particle line sprite
@particle_line_sprite = BitmapSprite.new(@position_viewport.rect.width, 3, @commands_viewport) @particle_line_sprite = BitmapSprite.new(@position_viewport.rect.width, 3, @commands_viewport)
@particle_line_sprite.z = -10 @particle_line_sprite.z = -10
@particle_line_sprite.oy = @particle_line_sprite.height / 2 @particle_line_sprite.oy = @particle_line_sprite.height / 2
@particle_line_sprite.bitmap.fill_rect(0, 0, @particle_line_sprite.bitmap.width, @particle_line_sprite.bitmap.height, Color.red) @particle_line_sprite.bitmap.fill_rect(0, 0, @particle_line_sprite.bitmap.width, @particle_line_sprite.bitmap.height, POSITION_LINE_COLOR)
end end
def initialize_controls def initialize_controls