cryptopunks-gui 0.0.3 → 0.0.4

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: f1f6eb5c90f0fa4a2d0c5abd70d67da17071a8f72cdbcbb9c43eaa3c80962e4d
4
- data.tar.gz: 1713179be7b0fee8032b3a7b6b8a71482189919464b4d010b23b01e6efcf7efc
3
+ metadata.gz: c58e4224d053623e8f1d2f49f3a5b4eaa8255468a0300ac3f044b517a1b66d1f
4
+ data.tar.gz: ce2c34aab44d09c58a8826c2b0dd7c2f224d96f93171bafe823cb5a3aa60e332
5
5
  SHA512:
6
- metadata.gz: f1b8fab3f02ae9547c4ce7c5dcae6107c690af5db3d7a9c1f18e837293b086a2e3ee43e8dcd978a1a97b679f14af08f057435e1b4cd5830539877671d2e7317f
7
- data.tar.gz: 3976e2ef62acb15532a352c9b7a5de4baad23f293b5c0647b0a90d450690ad1f2a04019ef8e73bdecf3dfde89373baa8a642195b2fc4f7df5caedac3c7a090b5
6
+ metadata.gz: c65b92b843de9fa308ab44fdf79efb0ab55b60f96e7d05fe742faca7056ba4338f8b2e51c4e16b43bc189ba1d982d5e59527f1e668772e1a6c9745c6290766cc
7
+ data.tar.gz: 0f39e1c911d52d56e9d548444ae49a3908e770754eda423847217cca604f6a9bc7b58e641ee9dcd791c82a98314d50c38afff76969096c7da9ed0d7ce21ff0c8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.4
4
+
5
+ - Changed flip and mirror to checkbuttons
6
+ - Fixed zooming for led and sketch styles
7
+
3
8
  ## 0.0.3
4
9
 
5
10
  - Style support (e.g. mirror, flip, sketch, led)
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.3
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.4
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.3
28
+ gem install cryptopunks-gui -v0.0.4
29
29
  ```
30
30
 
31
31
  Afterwards, run app via:
@@ -99,14 +99,26 @@ Change palette to get different punk colors.
99
99
 
100
100
  Change style to get different punk looks.
101
101
 
102
- ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-mirror.png)
103
-
104
- ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-flip.png)
102
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-normal.png)
105
103
 
106
104
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-led.png)
107
105
 
108
106
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-style-sketch.png)
109
107
 
108
+ ### Mirror/Flip
109
+
110
+ Check mirror and/or flip to apply punk transformation. Can combine with different palettes and styles.
111
+
112
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-no-mirror-no-flip.png)
113
+
114
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-mirror.png)
115
+
116
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-flip.png)
117
+
118
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-mirror-flip.png)
119
+
120
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-palette-false-style-led-mirror-flip.png)
121
+
110
122
  ## TODO
111
123
 
112
124
  [TODO.md](TODO.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -10,10 +10,10 @@ require 'puts_debuggerer'
10
10
  class CryptopunksGui
11
11
  include Glimmer
12
12
 
13
- PALETTES = ['Standard'] + (Palette8bit.constants).map(&:name).map {|palette| palette.split('_').map(&:capitalize).join(' ')}.reject { |palette| palette.include?(' ') }
14
- STYLES = ['Normal', 'Flip', 'Mirror', 'Led', 'Sketch']
13
+ PALETTES = ['Standard'] + (Palette8bit.constants).map(&:name).map {|palette| palette.split('_').map(&:capitalize).join(' ')}.reject { |palette| palette.include?(' ') }.sort
14
+ STYLES = ['Normal', 'Led', 'Sketch']
15
15
 
16
- attr_accessor :punk_index, :zoom, :palette, :style
16
+ attr_accessor :punk_index, :zoom, :palette, :style, :flip, :mirror
17
17
 
18
18
  def initialize
19
19
  initialize_punks
@@ -44,6 +44,8 @@ class CryptopunksGui
44
44
  @zoom = 12
45
45
  @palette = PALETTES.first
46
46
  @style = STYLES.first
47
+ @mirror = false
48
+ @flip = false
47
49
  end
48
50
 
49
51
  def observe_image_attribute_changes
@@ -52,6 +54,8 @@ class CryptopunksGui
52
54
  observer.observe(self, :zoom)
53
55
  observer.observe(self, :palette)
54
56
  observer.observe(self, :style)
57
+ observer.observe(self, :mirror)
58
+ observer.observe(self, :flip)
55
59
  end
56
60
 
57
61
  def generate_image
@@ -63,16 +67,19 @@ class CryptopunksGui
63
67
  if @style != STYLES.first
64
68
  selected_punk = selected_punk.send(@style.underscore)
65
69
  if @style != @previous_style
66
- @zoom = 12 if @style == 'Flip' && !['Normal', 'Mirror'].include?(@previous_style)
67
- @zoom = 12 if @style == 'Mirror' && !['Normal', 'Flip'].include?(@previous_style)
68
70
  @zoom = 2 if @style == 'Sketch'
69
71
  @zoom = 1 if @style == 'Led'
70
72
  end
73
+ else
74
+ @zoom = 12 if @style != @previous_style
71
75
  end
76
+ selected_punk = selected_punk.mirror if @mirror
77
+ selected_punk = selected_punk.flip if @flip
72
78
  selected_punk = selected_punk.zoom(@zoom.to_i)
73
79
  selected_punk.save(image_location)
74
80
  @image_label.image = image_location
75
81
  @message_entry.text = image_location
82
+ @previous_style = @style
76
83
  notify_observers(:zoom) if @zoom != @original_zoom
77
84
  end
78
85
 
@@ -118,7 +125,37 @@ class CryptopunksGui
118
125
  }
119
126
  combobox {
120
127
  readonly true
121
- text <=> [self, :style, before_write: ->(v) {@previous_style = @style}]
128
+ text <=> [self, :style]
129
+ }
130
+
131
+ frame {
132
+ padding 0
133
+
134
+ @mirror_checkbutton = checkbutton {
135
+ grid row: 0, column: 0, column_weight: 0
136
+ variable <=> [self, :mirror]
137
+ }
138
+ label {
139
+ grid row: 0, column: 1
140
+ text 'Mirror'
141
+
142
+ on('Button-1') do
143
+ self.mirror = !mirror
144
+ end
145
+ }
146
+
147
+ @flip_checkbutton = checkbutton {
148
+ grid row: 0, column: 2
149
+ variable <=> [self, :flip]
150
+ }
151
+ label {
152
+ grid row: 0, column: 3
153
+ text 'Flip'
154
+
155
+ on('Button-1') do
156
+ self.flip = !flip
157
+ end
158
+ }
122
159
  }
123
160
 
124
161
  label {
@@ -2,17 +2,17 @@
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.3 ruby app
5
+ # stub: cryptopunks-gui 0.0.4 ruby app
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "cryptopunks-gui".freeze
9
- s.version = "0.0.3"
9
+ s.version = "0.0.4"
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]
13
13
  s.authors = ["Andy Maleh".freeze]
14
14
  s.date = "2021-10-25"
15
- s.description = "Cryptopunks GUI for simplified minting built with Glimmer DSL for Tk (requires ActiveTcl to run cryptopunks-gui command)".freeze
15
+ s.description = "CryptoPunks GUI for Simplified Minting - Built with Glimmer DSL for Tk (requires ActiveTcl to run cryptopunks-gui command)".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["cryptopunks-gui".freeze]
18
18
  s.extra_rdoc_files = [
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.licenses = ["MIT".freeze]
35
35
  s.post_install_message = "To launch CryptoPunks GUI, run command: cryptopunks-gui".freeze
36
36
  s.rubygems_version = "3.2.22".freeze
37
- s.summary = "Cryptopunks GUI for Simplified Minting".freeze
37
+ s.summary = "CryptoPunks GUI for Simplified Minting".freeze
38
38
 
39
39
  if s.respond_to? :specification_version then
40
40
  s.specification_version = 4
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description: Cryptopunks GUI for simplified minting built with Glimmer DSL for Tk
111
+ description: CryptoPunks GUI for Simplified Minting - Built with Glimmer DSL for Tk
112
112
  (requires ActiveTcl to run cryptopunks-gui command)
113
113
  email: andy.am@gmail.com
114
114
  executables:
@@ -149,5 +149,5 @@ requirements: []
149
149
  rubygems_version: 3.2.22
150
150
  signing_key:
151
151
  specification_version: 4
152
- summary: Cryptopunks GUI for Simplified Minting
152
+ summary: CryptoPunks GUI for Simplified Minting
153
153
  test_files: []