poe_filter_generator 0.9.6 → 0.9.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.vscode/settings.json +5 -0
- data/lib/poe_filter_generator/element.rb +62 -19
- data/lib/poe_filter_generator/generator.rb +1 -1
- data/lib/poe_filter_generator/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 901346afb7e6df3e8c69a7a0a445af370bf80a05
|
4
|
+
data.tar.gz: 87ea3c53a792ed13bb8f4509d7e30cfead58372c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 617c4241f4d5a05c619dd9b46c2d68baac1c318a9405b42638f43f8336f19f594ba20b10f690cdad83e349cecd9eb3d2ce7acced68a8e928b4cc1536e7821d03
|
7
|
+
data.tar.gz: 12bf46ee5d71d063f557338eaae6343e0ac463c5c945785f89b054c902cfb50eb8910594f5560aeadd5e70cd19f3eed103cbed4394a8e4d7b208851a3704098e
|
@@ -1,28 +1,40 @@
|
|
1
1
|
class PoeFilterGenerator::Element
|
2
2
|
ATTRS = %i[
|
3
|
-
|
3
|
+
base_type
|
4
|
+
corrupted
|
4
5
|
drop_level
|
5
|
-
|
6
|
-
|
6
|
+
elder_item
|
7
|
+
gem_level
|
8
|
+
has_explicit_mod
|
9
|
+
height
|
10
|
+
identified
|
11
|
+
item_level
|
7
12
|
klass
|
8
|
-
base_type
|
9
|
-
sockets
|
10
13
|
linked_sockets
|
14
|
+
map_tier
|
15
|
+
quality
|
16
|
+
rarity
|
17
|
+
shaped_map
|
18
|
+
shaper_item
|
11
19
|
socket_group
|
12
|
-
|
20
|
+
sockets
|
21
|
+
stack_size
|
13
22
|
width
|
14
|
-
identified
|
15
|
-
corrupted
|
16
|
-
elder_item
|
17
|
-
shaper_item
|
18
|
-
shaped_map
|
19
23
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
set_font_size
|
24
|
+
custom_alert_sound
|
25
|
+
disable_drop_sound
|
26
|
+
minimap_icon
|
24
27
|
play_alert_sound
|
25
28
|
play_alert_sound_positional
|
29
|
+
play_effect
|
30
|
+
set_background_color
|
31
|
+
set_background_color_alpha
|
32
|
+
set_border_color
|
33
|
+
set_border_color_alpha
|
34
|
+
set_color_alpha
|
35
|
+
set_font_size
|
36
|
+
set_text_color
|
37
|
+
set_text_color_alpha
|
26
38
|
].freeze
|
27
39
|
|
28
40
|
attr_accessor :name
|
@@ -45,7 +57,7 @@ class PoeFilterGenerator::Element
|
|
45
57
|
|
46
58
|
def merge other
|
47
59
|
return self if other.nil?
|
48
|
-
new_element = PoeFilterGenerator::Element.new("#{name} #{other.name}", @aliases)
|
60
|
+
new_element = PoeFilterGenerator::Element.new("#{name}, #{other.name}", @aliases)
|
49
61
|
new_element.showable = other.showable
|
50
62
|
ATTRS.each do |attr|
|
51
63
|
new_element.send("#{attr}=", other.send(attr) || send(attr))
|
@@ -55,12 +67,43 @@ class PoeFilterGenerator::Element
|
|
55
67
|
|
56
68
|
private
|
57
69
|
|
70
|
+
def get_key attr
|
71
|
+
attr == :klass ? 'Class' : attr.to_s.camelize
|
72
|
+
end
|
73
|
+
|
74
|
+
def get_value attr, key
|
75
|
+
v = send(attr)
|
76
|
+
v = v.join(' ') if v.is_a? Array
|
77
|
+
|
78
|
+
if key&.match?(/Color/)
|
79
|
+
if v&.match?(/[0-9]{1,3} [0-9]{1,3} [0-9]{1,3} [0-9]{1,3}/)
|
80
|
+
STDERR.puts "[Error] '#{v}' is setted alpha. Use '#{key.underscore}_alpha' instead."
|
81
|
+
else
|
82
|
+
merge_color_value attr, v
|
83
|
+
end
|
84
|
+
else
|
85
|
+
send(attr)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def merge_color_value attr, value
|
90
|
+
if send("#{attr}_alpha").present?
|
91
|
+
"#{value} #{send("#{attr}_alpha")}"
|
92
|
+
elsif send("set_color_alpha").present?
|
93
|
+
"#{value} #{send('set_color_alpha')}"
|
94
|
+
else
|
95
|
+
value
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
58
99
|
def put_attr file
|
59
100
|
ATTRS.each do |attr|
|
60
|
-
key
|
61
|
-
|
101
|
+
key = get_key attr
|
102
|
+
|
103
|
+
next if key&.match?(/ColorAlpha/)
|
104
|
+
next unless send(attr).present?
|
62
105
|
|
63
|
-
|
106
|
+
value = get_value attr, key
|
64
107
|
|
65
108
|
@aliases.each do |alias_key, alias_value|
|
66
109
|
value.gsub!(alias_key, alias_value) if value.respond_to?(:gsub!)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poe_filter_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- isuke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- ".rubocop.yml"
|
108
108
|
- ".rubocop_todo.yml"
|
109
109
|
- ".ruby-version"
|
110
|
+
- ".vscode/settings.json"
|
110
111
|
- CODE_OF_CONDUCT.md
|
111
112
|
- Gemfile
|
112
113
|
- LICENSE.txt
|