cryptopunks-gui 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: c58e4224d053623e8f1d2f49f3a5b4eaa8255468a0300ac3f044b517a1b66d1f
4
- data.tar.gz: ce2c34aab44d09c58a8826c2b0dd7c2f224d96f93171bafe823cb5a3aa60e332
3
+ metadata.gz: d349e8c9967a50ce0c6af942f6cc3c3673f65a3daffcad18f9bd237ec70958d2
4
+ data.tar.gz: 25ed4d8548aad51cc5dba533ed70edc42032e4850bddbbed3e659e2b1ebe9ca1
5
5
  SHA512:
6
- metadata.gz: c65b92b843de9fa308ab44fdf79efb0ab55b60f96e7d05fe742faca7056ba4338f8b2e51c4e16b43bc189ba1d982d5e59527f1e668772e1a6c9745c6290766cc
7
- data.tar.gz: 0f39e1c911d52d56e9d548444ae49a3908e770754eda423847217cca604f6a9bc7b58e641ee9dcd791c82a98314d50c38afff76969096c7da9ed0d7ce21ff0c8
6
+ metadata.gz: 4d06d0a8c6c1c4a8f65290e85f7d645a0b19206d58c53b7ed365827a4ba46a99d14db0a41d8bf774abb07e8bc7e43ec008233e3f8b241ccf305ecb341f5bacb0
7
+ data.tar.gz: 4ba66061f49bb601ccf0bebb5e8712526ec081831dc3a792af57b967d769d4c75212184636114999396ae43d48632b2f2ed34d1566c43eb4a5fa8fb63fb236f5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.5
4
+
5
+ - Led style spacing option
6
+ - Led style round corner option
7
+ - Sketch style line option
8
+ - Apply zoom to led and sketch styles correctly
9
+ - Fixed issue with typing punk index higher than 9999 (ignore)
10
+
3
11
  ## 0.0.4
4
12
 
5
13
  - Changed flip and mirror to checkbuttons
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.4
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.5
2
2
  ## Simplified Minting
3
3
  [![Gem Version](https://badge.fury.io/rb/cryptopunks-gui.svg)](http://badge.fury.io/rb/cryptopunks-gui)
4
4
 
@@ -25,7 +25,7 @@ You can use CryptoPunks GUI via gem or via cloning repository.
25
25
  Run:
26
26
 
27
27
  ```
28
- gem install cryptopunks-gui -v0.0.4
28
+ gem install cryptopunks-gui -v0.0.5
29
29
  ```
30
30
 
31
31
  Afterwards, run app via:
@@ -99,12 +99,30 @@ Change palette to get different punk colors.
99
99
 
100
100
  Change style to get different punk looks.
101
101
 
102
+ #### Normal Style
103
+
102
104
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-normal.png)
103
105
 
106
+ #### Led Style
107
+
104
108
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-led.png)
105
109
 
110
+ ##### Led Spacing
111
+
112
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-led-spacing.png)
113
+
114
+ ##### Led Round Corner
115
+
116
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-led-round-corner.png)
117
+
118
+ #### Sketch Style
119
+
106
120
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-sketch.png)
107
121
 
122
+ ##### Sketch Line
123
+
124
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-sketch-line.png)
125
+
108
126
  ### Mirror/Flip
109
127
 
110
128
  Check mirror and/or flip to apply punk transformation. Can combine with different palettes and styles.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -13,7 +13,7 @@ class CryptopunksGui
13
13
  PALETTES = ['Standard'] + (Palette8bit.constants).map(&:name).map {|palette| palette.split('_').map(&:capitalize).join(' ')}.reject { |palette| palette.include?(' ') }.sort
14
14
  STYLES = ['Normal', 'Led', 'Sketch']
15
15
 
16
- attr_accessor :punk_index, :zoom, :palette, :style, :flip, :mirror
16
+ attr_accessor :punk_index, :zoom, :palette, :style, :led_spacing, :led_round_corner, :sketch_line, :flip, :mirror
17
17
 
18
18
  def initialize
19
19
  initialize_punks
@@ -44,6 +44,9 @@ class CryptopunksGui
44
44
  @zoom = 12
45
45
  @palette = PALETTES.first
46
46
  @style = STYLES.first
47
+ @led_spacing = 2
48
+ @led_round_corner = false
49
+ @sketch_line = 1
47
50
  @mirror = false
48
51
  @flip = false
49
52
  end
@@ -54,28 +57,34 @@ class CryptopunksGui
54
57
  observer.observe(self, :zoom)
55
58
  observer.observe(self, :palette)
56
59
  observer.observe(self, :style)
60
+ observer.observe(self, :led_spacing)
61
+ observer.observe(self, :led_round_corner)
62
+ observer.observe(self, :sketch_line)
57
63
  observer.observe(self, :mirror)
58
64
  observer.observe(self, :flip)
59
65
  end
60
66
 
61
67
  def generate_image
68
+ return if @punk_index.to_i > 9999
62
69
  image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}#{"-#{@palette.underscore}" if @palette != PALETTES.first}#{"-#{@style.underscore}" if @style != STYLES.first}.png")
63
70
  puts "Writing punk image to #{image_location}"
64
71
  selected_punk = @punks[@punk_index.to_i]
65
72
  selected_punk = selected_punk.change_palette8bit(Palette8bit.const_get(@palette.gsub(' ', '_').upcase.to_sym)) if @palette != PALETTES.first
66
73
  @original_zoom = @zoom
67
74
  if @style != STYLES.first
68
- selected_punk = selected_punk.send(@style.underscore)
69
- if @style != @previous_style
70
- @zoom = 2 if @style == 'Sketch'
71
- @zoom = 1 if @style == 'Led'
75
+ style_options = {}
76
+ if @style == 'Led'
77
+ style_options[:spacing] = @led_spacing.to_i
78
+ style_options[:round_corner] = @led_round_corner
72
79
  end
73
- else
74
- @zoom = 12 if @style != @previous_style
80
+ if @style == 'Sketch'
81
+ style_options[:line] = @sketch_line.to_i
82
+ end
83
+ selected_punk = selected_punk.send(@style.underscore, @zoom.to_i, **style_options)
75
84
  end
76
85
  selected_punk = selected_punk.mirror if @mirror
77
86
  selected_punk = selected_punk.flip if @flip
78
- selected_punk = selected_punk.zoom(@zoom.to_i)
87
+ selected_punk = selected_punk.zoom(@zoom.to_i) if @style == STYLES.first
79
88
  selected_punk.save(image_location)
80
89
  @image_label.image = image_location
81
90
  @message_entry.text = image_location
@@ -125,13 +134,17 @@ class CryptopunksGui
125
134
  }
126
135
  combobox {
127
136
  readonly true
128
- text <=> [self, :style]
137
+ text <=> [self, :style, after_write: ->(val) {add_style_options}]
138
+ }
139
+
140
+ @style_options_frame = frame {
141
+ padding 0
129
142
  }
130
143
 
131
144
  frame {
132
145
  padding 0
133
146
 
134
- @mirror_checkbutton = checkbutton {
147
+ checkbutton {
135
148
  grid row: 0, column: 0, column_weight: 0
136
149
  variable <=> [self, :mirror]
137
150
  }
@@ -144,7 +157,7 @@ class CryptopunksGui
144
157
  end
145
158
  }
146
159
 
147
- @flip_checkbutton = checkbutton {
160
+ checkbutton {
148
161
  grid row: 0, column: 2
149
162
  variable <=> [self, :flip]
150
163
  }
@@ -171,6 +184,62 @@ class CryptopunksGui
171
184
  }
172
185
  }
173
186
  end
187
+
188
+ def add_style_options
189
+ @style_options_frame.content {
190
+ @style_options_frame.children.each(&:destroy)
191
+ if @style == 'Led'
192
+ frame {
193
+ padding 0
194
+
195
+ label {
196
+ grid row: 0, column: 0, column_weight: 0
197
+ text 'Spacing:'
198
+ }
199
+ spinbox {
200
+ grid row: 0, column: 1
201
+ from 1
202
+ to 72
203
+ text <=> [self, :led_spacing]
204
+ }
205
+
206
+ checkbutton {
207
+ grid row: 0, column: 2
208
+ variable <=> [self, :led_round_corner]
209
+ }
210
+ label {
211
+ grid row: 0, column: 3
212
+ text 'Round Corner'
213
+
214
+ on('Button-1') do
215
+ self.led_round_corner = !led_round_corner
216
+ end
217
+ }
218
+ }
219
+ elsif @style == 'Sketch'
220
+ frame {
221
+ padding 0
222
+
223
+ label {
224
+ grid row: 0, column: 0, column_weight: 0
225
+ text 'Line:'
226
+ }
227
+ spinbox {
228
+ grid row: 0, column: 1
229
+ from 1
230
+ to 72
231
+ text <=> [self, :sketch_line]
232
+ }
233
+ }
234
+ else
235
+ frame { # filler
236
+ padding 0
237
+ height 0
238
+ width 0
239
+ }
240
+ end
241
+ }
242
+ end
174
243
  end
175
244
 
176
245
  CryptopunksGui.new.launch
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: cryptopunks-gui 0.0.4 ruby app
5
+ # stub: cryptopunks-gui 0.0.5 ruby app
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "cryptopunks-gui".freeze
9
- s.version = "0.0.4"
9
+ s.version = "0.0.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["app".freeze]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopunks-gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh