mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Added gra;hic/SE chooser pop-up windows to Animation Editor
This commit is contained in:
@@ -81,7 +81,7 @@ class UIControls::NumberSlider < UIControls::BaseControl
|
||||
self.bitmap.fill_rect(SLIDER_X - 1 + (i * SLIDER_LENGTH / 4), (self.height / 2) - 2, 2, 4, self.bitmap.font.color)
|
||||
end
|
||||
# Draw slider knob
|
||||
fraction = (self.value - self.min_value) / self.max_value.to_f
|
||||
fraction = (self.value - self.min_value) / (self.max_value.to_f - self.min_value)
|
||||
knob_x = (SLIDER_LENGTH * fraction).to_i
|
||||
self.bitmap.fill_rect(SLIDER_X + knob_x - 4, (self.height / 2) - 6, 8, 12, SLIDER_KNOB_COLOR)
|
||||
# Draw plus button
|
||||
|
||||
@@ -48,11 +48,16 @@ class UIControls::List < UIControls::BaseControl
|
||||
@scrollbar.z = new_val + 1
|
||||
end
|
||||
|
||||
def visible=(new_val)
|
||||
super
|
||||
@scrollbar.visible = new_val
|
||||
end
|
||||
|
||||
# Each value in @values is an array: [id, text].
|
||||
def values=(new_vals)
|
||||
@values = new_vals
|
||||
set_interactive_rects
|
||||
@scrollbar.range = @values.length * ROW_HEIGHT
|
||||
@scrollbar.range = [@values.length, 1].max * ROW_HEIGHT
|
||||
if @scrollbar.visible
|
||||
self.top_row = (@scrollbar.position.to_f / ROW_HEIGHT).round
|
||||
else
|
||||
@@ -143,10 +148,11 @@ class UIControls::List < UIControls::BaseControl
|
||||
SELECTED_ROW_COLOR
|
||||
)
|
||||
end
|
||||
txt = (val.is_a?(Array)) ? val[1] : val
|
||||
draw_text(self.bitmap,
|
||||
@interactions[i].x + TEXT_PADDING_X,
|
||||
@interactions[i].y + TEXT_OFFSET_Y - (@top_row * ROW_HEIGHT),
|
||||
val[1])
|
||||
txt)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user