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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98e2ba26eeb9707cd35c52f63683686b6e3ea63f
4
- data.tar.gz: ad832380ad9b7a9532bbf7581630ffb28b2ecf2c
3
+ metadata.gz: 901346afb7e6df3e8c69a7a0a445af370bf80a05
4
+ data.tar.gz: 87ea3c53a792ed13bb8f4509d7e30cfead58372c
5
5
  SHA512:
6
- metadata.gz: 5d746ec525b3ce67e3da0c1f999cd4474f0d72c10bbea91054c01a248e8cb31d0fb54acd935c7b8cf13d761989705cc8dbdf587ddae3e3e0745d43ad94c778a9
7
- data.tar.gz: 963fbc116ef56b5f4bd13e93c1ab9c3b82434afacf9d3c0eed779cf0d09218c8d3214cf7dbc365fb1054be64eb99c58e3e76a83ff1d7b832f3791b9b256eb99b
6
+ metadata.gz: 617c4241f4d5a05c619dd9b46c2d68baac1c318a9405b42638f43f8336f19f594ba20b10f690cdad83e349cecd9eb3d2ce7acced68a8e928b4cc1536e7821d03
7
+ data.tar.gz: 12bf46ee5d71d063f557338eaae6343e0ac463c5c945785f89b054c902cfb50eb8910594f5560aeadd5e70cd19f3eed103cbed4394a8e4d7b208851a3704098e
@@ -0,0 +1,5 @@
1
+ {
2
+ "workbench.colorCustomizations": {
3
+ "statusBar.background": "#90b44b"
4
+ }
5
+ }
@@ -1,28 +1,40 @@
1
1
  class PoeFilterGenerator::Element
2
2
  ATTRS = %i[
3
- item_level
3
+ base_type
4
+ corrupted
4
5
  drop_level
5
- quality
6
- rarity
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
- height
20
+ sockets
21
+ stack_size
13
22
  width
14
- identified
15
- corrupted
16
- elder_item
17
- shaper_item
18
- shaped_map
19
23
 
20
- set_border_color
21
- set_background_color
22
- set_text_color
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 = attr == :klass ? 'Class' : attr.to_s.camelize
61
- value = send(attr)
101
+ key = get_key attr
102
+
103
+ next if key&.match?(/ColorAlpha/)
104
+ next unless send(attr).present?
62
105
 
63
- next unless value.present?
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!)
@@ -14,7 +14,7 @@ class PoeFilterGenerator::Generator
14
14
 
15
15
  def generate
16
16
  # rubocop:disable Security/Eval
17
- eval(File.read(@source_path))
17
+ eval(File.read(@source_path), binding, @source_path)
18
18
  # rubocop:enable Security/Eval
19
19
  end
20
20
 
@@ -1,3 +1,3 @@
1
1
  module PoeFilterGenerator
2
- VERSION = "0.9.6".freeze
2
+ VERSION = "0.9.12".freeze
3
3
  end
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.6
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: 2017-12-07 00:00:00.000000000 Z
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