lib/cyberarm_engine/ui/elements/progress.rb in cyberarm_engine-0.22.0 vs lib/cyberarm_engine/ui/elements/progress.rb in cyberarm_engine-0.23.0
- old
+ new
@@ -50,10 +50,11 @@
@marquee_offset = (@width * (Gosu.milliseconds - @marquee_animation_time) / @animation_speed) - marquee_width
@marquee_animation_time = Gosu.milliseconds if @marquee_offset > range
update_background
+ root.gui_state.request_repaint
end
def type=(type)
@type = type
@@ -75,11 +76,15 @@
end
def value=(decimal)
raise "value must be number" unless decimal.is_a?(Numeric)
+ old_value = @fraction
+
@fraction = decimal.clamp(0.0, 1.0)
update_background
+
+ root.gui_state.request_repaint if @fraction != old_value
publish(:changed, @fraction)
@fraction
end
end