Gosuplus 1.0.23 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,6 @@ module Gosuplus
8
8
  @image = image
9
9
  end
10
10
 
11
- def update
12
-
13
- end
11
+ def update; end
14
12
  end
15
13
  end
@@ -2,6 +2,7 @@ module Gosuplus
2
2
  module GUI
3
3
  class Button
4
4
  attr_accessor :timer
5
+
5
6
  def initialize(position, image, input_handler, key_id, text = nil, font = nil)
6
7
  @icon = Icon.new(image, position)
7
8
  @input_handler, @key_id = input_handler, key_id
@@ -9,10 +10,11 @@ module Gosuplus
9
10
  @text = Text.new(text, font)
10
11
  @text.center(@icon)
11
12
  end
13
+ @visible = true
12
14
  end
13
15
 
14
16
  def draw
15
- ButtonRenderer.draw(@icon, @text)
17
+ ButtonRenderer.draw(@icon, @text) if @visible
16
18
  end
17
19
 
18
20
  def update(x, y)
@@ -30,9 +32,10 @@ module Gosuplus
30
32
  @timer.update
31
33
  end
32
34
 
33
- def active?
34
- @active
35
- end
35
+ def active?; @active; end
36
+ def visible?; @visible; end
37
+ def hide; @visible = false; end
38
+ def expose; @visible = true; end
36
39
 
37
40
  private
38
41
  def activated?(x, y)
@@ -1,5 +1,7 @@
1
1
  module Gosuplus
2
2
  class State
3
+ attr_accessor :finished
4
+
3
5
  def initialize(window, rm, input_handler)
4
6
  @window, @rm, @input_handler = window, rm, input_handler
5
7
  @GUI = GUI::GUI.new(GUIRenderer.new)
@@ -7,6 +7,7 @@ module Gosuplus
7
7
 
8
8
  def update
9
9
  @states[@index].update if @states.size > 0
10
+ next if @states[@index].finished
10
11
  end
11
12
 
12
13
  def draw
@@ -1,3 +1,3 @@
1
1
  module Gosuplus
2
- VERSION = "1.0.23"
2
+ VERSION = "1.0.24"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Gosuplus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.23
4
+ version: 1.0.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: