square_speech_balloon 0.0.51 → 0.0.53

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  module SquareSpeechBalloon
2
2
  class Balloon < ActiveRecord::Base
3
3
  # attr_accessible :title, :body
4
+
5
+ def supply_default
6
+ end
7
+
4
8
  end
5
9
  end
@@ -1,5 +1,9 @@
1
1
  module SquareSpeechBalloon
2
2
  class Speech < ActiveRecord::Base
3
3
  # attr_accessible :title, :body
4
+
5
+ def supply_default
6
+ end
7
+
4
8
  end
5
9
  end
@@ -1,5 +1,9 @@
1
1
  module SquareSpeechBalloon
2
2
  class SpeechBalloon < ActiveRecord::Base
3
3
  # attr_accessible :title, :body
4
+
5
+ def supply_default
6
+ end
7
+
4
8
  end
5
9
  end
@@ -1,3 +1,3 @@
1
1
  module SquareSpeechBalloon
2
- VERSION = "0.0.51"
2
+ VERSION = "0.0.53"
3
3
  end
@@ -3,33 +3,34 @@ require "square_speech_balloon/engine"
3
3
  module SquareSpeechBalloon
4
4
  module SpeechBalloonModule
5
5
  def supply_default
6
- if self.speech_balloon_template
7
- self.classname = self.speech_balloon_template.classname
8
- self.settings = self.speech_balloon_template.parsed_settings['speech_balloon']
9
- end
10
- if self.panel
11
- self.t = self.panel.new_t
12
- self.z = self.panel.new_z
13
- end
6
+ super
7
+ self.speech_balloon_template_classname = self.speech_balloon_template.classname
14
8
  end
15
9
 
16
- def extend_speech_balloon
17
- @extend_speech_balloon ||= SquareSpeechBalloon::SpeechBalloon.new
10
+ def speech_balloon_extend
11
+ self.new_speech_balloon unless @speech_balloon_extend
12
+ @speech_balloon_extend
18
13
  end
19
14
 
20
- def extend_speech_balloon= params
21
- @extend_speech_balloon = SquareSpeechBalloon::SpeechBalloon.new params
15
+ def speech_balloon_extend= params
16
+ # load attributes
17
+ @speech_balloon_extend = SquareSpeechBalloon::SpeechBalloon.new params
18
+ # no supply default params
22
19
  end
23
20
 
24
- end
25
-
26
- module BalloonModule
21
+ def new_speech_balloon params = {}
22
+ @speech_balloon_extend = SquareSpeechBalloon::SpeechBalloon.new params
23
+ @speech_balloon_extend.supply_default
24
+ end
27
25
 
28
26
  def parsed_settings
29
- @parsed_settings ||= get_parent.speech_balloon_template.parsed_settings
27
+ @parsed_settings ||= self.speech_balloon_template.parsed_settings
30
28
  end
31
29
 
32
- def supply_default
30
+ end
31
+
32
+ module BalloonModule
33
+ def supply_default
33
34
  s = self.parsed_settings['all']['balloon']
34
35
  self.x = 0
35
36
  self.y = 0
@@ -38,12 +39,22 @@ module SquareSpeechBalloon
38
39
  self.r = 0
39
40
  end
40
41
 
41
- def extend_balloon
42
- @extend_balloon ||= SquareSpeechBalloon::Balloon.new
42
+ def balloon_extend
43
+ self.new_balloon unless @balloon_extend
44
+ @balloon_extend
45
+ end
46
+
47
+ def balloon_extend= params
48
+ @balloon_extend = SquareSpeechBalloon::Balloon.new params
43
49
  end
44
50
 
45
- def extend_balloon= params
46
- @extend_balloon = SquareSpeechBalloon::Balloon.new params
51
+ def new_balloon params = {}
52
+ @balloon_extend = SquareSpeechBalloon::Balloon.new params
53
+ @balloon_extend.supply_default
54
+ end
55
+
56
+ def parsed_settings
57
+ @parsed_settings ||= self.speech_balloon_template.parsed_settings
47
58
  end
48
59
 
49
60
  def select_system_picture
@@ -52,19 +63,10 @@ module SquareSpeechBalloon
52
63
  self.system_picture_id
53
64
  end
54
65
 
55
- def classname
56
- get_parent.speech_balloon_template.classname
57
- end
58
-
59
66
  end
60
67
 
61
68
  module SpeechModule
62
-
63
- def parsed_settings
64
- @parsed_settings ||= get_parent.speech_balloon_template.parsed_settings
65
- end
66
-
67
- def supply_default
69
+ def supply_default
68
70
  s = self.parsed_settings['all']['speech']
69
71
  self.x = s['x_rate']
70
72
  self.y = s['y_rate']
@@ -76,12 +78,22 @@ module SquareSpeechBalloon
76
78
  self.fore_color = self.parsed_settings['speech_balloon']['default_fore_color']
77
79
  end
78
80
 
79
- def extend_speech
80
- @extend_speech ||= SquareSpeechBalloon::Speech.new
81
+ def speech_extend
82
+ self.new_speech unless @speech_extend
83
+ @speech_extend
84
+ end
85
+
86
+ def speech_extend= params
87
+ @speech_extend = SquareSpeechBalloon::Speech.new params
81
88
  end
82
89
 
83
- def extend_speech= params
84
- @extend_speech = SquareSpeechBalloon::Speech.new params
90
+ def new_speech params = {}
91
+ @speech_extend = SquareSpeechBalloon::Speech.new params
92
+ @speech_extend.supply_default
93
+ end
94
+
95
+ def parsed_settings
96
+ @parsed_settings ||= self.speech_balloon_template.parsed_settings
85
97
  end
86
98
 
87
99
  def arrayed_quotes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: square_speech_balloon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.51
4
+ version: 0.0.53
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-11 00:00:00.000000000 Z
12
+ date: 2014-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3