circle_speech_balloon 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/circle_speech_balloon/version.rb +1 -1
- data/lib/circle_speech_balloon.rb +42 -16
- metadata +2 -2
@@ -14,46 +14,72 @@ module CircleSpeechBalloon
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def extend_speech_balloon
|
17
|
-
@extend_speech_balloon ||=
|
17
|
+
@extend_speech_balloon ||= CircleSpeechBalloon::SpeechBalloon.new
|
18
18
|
end
|
19
19
|
|
20
20
|
def extend_speech_balloon= params
|
21
|
-
@extend_speech_balloon =
|
21
|
+
@extend_speech_balloon = CircleSpeechBalloon::SpeechBalloon.new params
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
25
25
|
|
26
26
|
module BalloonModule
|
27
|
-
def
|
28
|
-
|
27
|
+
def new_speech_balloon
|
28
|
+
@new_speech_balloon
|
29
|
+
end
|
30
|
+
|
31
|
+
def new_speech_balloon= v
|
32
|
+
@new_speech_balloon = v
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_speech_balloon
|
36
|
+
self.speech_balloon || @new_speech_balloon
|
37
|
+
end
|
38
|
+
|
39
|
+
def supply_default
|
40
|
+
parsed_settings = get_speech_balloon.speech_balloon_template.parsed_settings
|
29
41
|
self.x = 0
|
30
42
|
self.y = 0
|
31
43
|
self.width = parsed_settings['speech_balloon']['default_width']
|
32
44
|
self.height = parsed_settings['speech_balloon']['default_height']
|
33
|
-
self.r =
|
45
|
+
self.r = parsed_settings['speech_balloon']['default_r']
|
34
46
|
end
|
35
47
|
|
36
48
|
def extend_balloon
|
37
|
-
@extend_balloon ||=
|
49
|
+
@extend_balloon ||= CircleSpeechBalloon::Balloon.new
|
38
50
|
end
|
39
51
|
|
40
52
|
def extend_balloon= params
|
41
|
-
@extend_balloon =
|
53
|
+
@extend_balloon = CircleSpeechBalloon::Balloon.new params
|
42
54
|
end
|
43
55
|
|
44
|
-
def select_system_picture
|
45
|
-
|
56
|
+
def select_system_picture
|
57
|
+
parsed_settings = get_speech_balloon.speech_balloon_template.parsed_settings
|
58
|
+
tr = self.r % 360
|
46
59
|
tr = 360 - tr if tr < 0
|
47
|
-
br = (tr /
|
48
|
-
|
49
|
-
self.system_picture_id
|
60
|
+
br = (tr / parsed_settings['speech_balloon']['r_step']).to_i
|
61
|
+
self.system_picture_id = parsed_settings[br.to_s]['balloon']['system_picture_id']
|
62
|
+
self.system_picture_id
|
50
63
|
end
|
51
64
|
|
52
65
|
end
|
53
66
|
|
54
67
|
module SpeechModule
|
55
|
-
def
|
56
|
-
|
68
|
+
def new_speech_balloon
|
69
|
+
@new_speech_balloon
|
70
|
+
end
|
71
|
+
|
72
|
+
def new_speech_balloon= v
|
73
|
+
@new_speech_balloon = v
|
74
|
+
end
|
75
|
+
|
76
|
+
def get_speech_balloon
|
77
|
+
self.speech_balloon || @new_speech_balloon
|
78
|
+
end
|
79
|
+
|
80
|
+
def supply_default
|
81
|
+
parsed_settings = get_speech_balloon.speech_balloon_template.parsed_settings
|
82
|
+
s = parsed_settings['0']['speech']
|
57
83
|
self.x = s['x_rate']
|
58
84
|
self.y = s['y_rate']
|
59
85
|
self.width = s['width_rate']
|
@@ -61,11 +87,11 @@ module CircleSpeechBalloon
|
|
61
87
|
end
|
62
88
|
|
63
89
|
def extend_speech
|
64
|
-
@extend_speech ||=
|
90
|
+
@extend_speech ||= CircleSpeechBalloon::Speech.new
|
65
91
|
end
|
66
92
|
|
67
93
|
def extend_speech= params
|
68
|
-
@extend_speech =
|
94
|
+
@extend_speech = CircleSpeechBalloon::Speech.new params
|
69
95
|
end
|
70
96
|
end
|
71
97
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circle_speech_balloon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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: 2013-06-
|
12
|
+
date: 2013-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|