VanaClock 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VanaClock.gemspec +7 -7
  2. data/lib/vana_clock.rb +36 -41
  3. metadata +42 -45
@@ -1,11 +1,11 @@
1
1
 
2
- # Gem::Specification for Vanaclock-1.0.2
2
+ # Gem::Specification for Vanaclock-1.0.3
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{VanaClock}
7
- s.version = "1.0.2"
8
- s.date = %q{2007-09-08}
7
+ s.version = "1.0.3"
8
+ s.date = %q{2007-09-20}
9
9
  s.summary = %q{VanaClock is a clock for Final Fantasy Online written in jruby and java swing. JRuby is required to run this clock.}
10
10
  s.email = %q{ttilley@gmail.com}
11
11
  s.homepage = %q{http://vanatime.rubyforge.org/}
@@ -16,19 +16,19 @@ Gem::Specification.new do |s|
16
16
  s.authors = ["Travis Tilley"]
17
17
  s.files = ["README", "Manifest", "LICENSE", "lib/vana_clock.rb", "CHANGELOG", "bin/VanaClock", "VanaClock.gemspec"]
18
18
  s.executables = ["VanaClock"]
19
- s.add_dependency(%q<VanaTime>, [">= 2.0.0"])
19
+ s.add_dependency(%q<VanaTime>, [">= 2.1.0"])
20
20
  end
21
21
 
22
22
 
23
23
  # # Original Rakefile source (requires the Echoe gem):
24
24
  #
25
- # version = "1.0.2"
25
+ # version = "1.0.3"
26
26
  #
27
27
  # ENV['RUBY_FLAGS'] = ""
28
28
  #
29
29
  # begin
30
30
  # require 'rubygems'
31
- # gem 'echoe', '=2.3'
31
+ # gem 'echoe', '=2.4'
32
32
  # require 'echoe'
33
33
  #
34
34
  # Echoe.new('VanaClock', version) do |p|
@@ -38,7 +38,7 @@ end
38
38
  # p.url = "http://vanatime.rubyforge.org/"
39
39
  # p.author = 'Travis Tilley'
40
40
  # p.email = "ttilley@gmail.com"
41
- # p.dependencies = ["VanaTime >=2.0.0"]
41
+ # p.dependencies = ["VanaTime >=2.1.0"]
42
42
  # end
43
43
  #
44
44
  # rescue LoadError => boom
@@ -27,7 +27,7 @@ module VanaClock
27
27
  @clock = clock
28
28
  end
29
29
  def actionPerformed(event)
30
- @clock.time_manager.earth_time=(Time.now)
30
+ @clock.time_manager.update_earth_time(Time.now)
31
31
  end
32
32
  end
33
33
 
@@ -163,54 +163,49 @@ module VanaClock
163
163
  clock_window.getContentPane.add clock_container
164
164
 
165
165
  # create the procs that update UI elements
166
- on_second = lambda do |time|
167
- @vana_time.setText time.to_s
168
- @earth_time.setText time.earth_time.to_s
166
+ on_time_string = lambda do |m,o,n|
167
+ @vana_time.setText "#{m.time.date_string} #{n}"
169
168
  end
170
- on_day = lambda do |day|
171
- @vana_day.setText day.to_s
169
+ on_earth_time = lambda do |m,o,n|
170
+ @earth_time.setText n.to_s
172
171
  end
173
- on_moon_percent = lambda do |moon|
174
- @moon_percent.setText moon.percent
172
+ on_day_string = lambda do |m,o,n|
173
+ @vana_day.setText n
175
174
  end
176
- on_moon_phase = lambda do |moon|
177
- @phase_name.setText moon.phase
178
- @next_phase_name.setText moon.next_phase
175
+ on_moon_percent_string = lambda do |m,o,n|
176
+ @moon_percent.setText n
179
177
  end
180
- on_optimal_phase = lambda do |moon|
181
- @optimal_phase_name.setText moon.optimal_phase
178
+ on_moon_phase_name = lambda do |m,o,n|
179
+ @phase_name.setText n
182
180
  end
183
- on_phase_count = lambda do |countdown|
184
- @next_phase_countdown.setText countdown.to_next
181
+ on_next_phase_name = lambda do |m,o,n|
182
+ @next_phase_name.setText n
185
183
  end
186
- on_optimal_count = lambda do |countdown|
187
- @optimal_phase_countdown.setText countdown.to_optimal
184
+ on_optimal_phase = lambda do |m,o,n|
185
+ @optimal_phase_name.setText n
188
186
  end
189
-
190
- # create time, day, and moon objects
191
- vt = FFXI::VanaTime.now
192
- vd = FFXI::VanaDay.new(vt)
193
- vm = FFXI::VanaMoon.new(vt.earth_time)
194
-
195
- # draw the UI
196
- on_second.call vt
197
- on_day.call vd
198
- on_moon_percent.call vm
199
- on_moon_phase.call vm
200
- on_optimal_phase.call vm
201
-
202
- # manage the above
187
+ on_phase_count = lambda do |m,o,n|
188
+ @next_phase_countdown.setText n
189
+ end
190
+ on_optimal_count = lambda do |m,o,n|
191
+ @optimal_phase_countdown.setText n
192
+ end
193
+
194
+ # set up the time manager
203
195
  @time_manager = FFXI::TimeManager.new
204
- @time_manager.manage(vt, vd, vm)
205
-
206
- # register callbacks
207
- @time_manager.callback_proc(MS_SECOND, on_second)
208
- @time_manager.callback_proc("day", on_day)
209
- @time_manager.callback_proc("moon_percent", on_moon_percent)
210
- @time_manager.callback_proc("moon_phase", on_moon_phase)
211
- @time_manager.callback_proc("next_optimal_phase", on_optimal_phase)
212
- @time_manager.callback_proc("next_phase_countdown", on_phase_count)
213
- @time_manager.callback_proc("optimal_phase_countdown", on_optimal_count)
196
+ @time_manager.callback(:time_string, on_time_string)
197
+ @time_manager.callback(:earth_time, on_earth_time)
198
+ @time_manager.callback(:day_string, on_day_string)
199
+ @time_manager.callback(:moon_percent_string, on_moon_percent_string)
200
+ @time_manager.callback(:moon_phase_name, on_moon_phase_name)
201
+ @time_manager.callback(:next_phase_name, on_next_phase_name)
202
+ @time_manager.callback(:optimal_phase_name, on_optimal_phase)
203
+ @time_manager.callback(:next_phase_countdown_string, on_phase_count)
204
+ @time_manager.callback(:optimal_phase_countdown_string,
205
+ on_optimal_count)
206
+
207
+ # enable cascading updates and do the first update
208
+ @time_manager.enable_cascading_updates(Time.now)
214
209
 
215
210
  # create AbstractAction
216
211
  update_action = UpdateAction.new
metadata CHANGED
@@ -1,33 +1,12 @@
1
- --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
- name: VanaClock
5
- version: !ruby/object:Gem::Version
6
- version: 1.0.2
7
- date: 2007-09-08 00:00:00 -04:00
8
- summary: VanaClock is a clock for Final Fantasy Online written in jruby and java swing. JRuby is required to run this clock.
9
- require_paths:
10
- - lib
11
- email: ttilley@gmail.com
1
+ --- !ruby/object:Gem::Specification
12
2
  homepage: http://vanatime.rubyforge.org/
13
- rubyforge_project: vanatime
14
- description: VanaClock is a clock for Final Fantasy Online written in jruby and java swing. JRuby is required to run this clock.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
25
- platform: ruby
26
- signing_key:
27
- cert_chain:
3
+ extensions: []
4
+ executables:
5
+ - VanaClock
6
+ version: !ruby/object:Gem::Version
7
+ version: 1.0.3
28
8
  post_install_message:
29
- authors:
30
- - Travis Tilley
9
+ date: 2007-09-20 04:00:00 +00:00
31
10
  files:
32
11
  - README
33
12
  - Manifest
@@ -36,25 +15,43 @@ files:
36
15
  - CHANGELOG
37
16
  - bin/VanaClock
38
17
  - VanaClock.gemspec
39
- test_files: []
40
-
18
+ rubygems_version: 0.9.4
41
19
  rdoc_options: []
42
-
43
- extra_rdoc_files: []
44
-
45
- executables:
46
- - VanaClock
47
- extensions: []
48
-
49
- requirements: []
50
-
20
+ signing_key:
21
+ cert_chain:
22
+ name: VanaClock
23
+ has_rdoc: true
24
+ platform: ruby
25
+ summary: VanaClock is a clock for Final Fantasy Online written in jruby and java swing.
26
+ JRuby is required to run this clock.
27
+ default_executable:
28
+ bindir: bin
29
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
30
+ version:
31
+ requirements:
32
+ - - '>'
33
+ - !ruby/object:Gem::Version
34
+ version: 0.0.0
35
+ require_paths:
36
+ - lib
37
+ specification_version: 1
38
+ test_files: []
51
39
  dependencies:
52
- - !ruby/object:Gem::Dependency
40
+ - !ruby/object:Gem::Dependency
53
41
  name: VanaTime
54
42
  version_requirement:
55
- version_requirements: !ruby/object:Gem::Version::Requirement
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: 2.0.0
43
+ version_requirements: !ruby/object:Gem::Version::Requirement
60
44
  version:
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: 2.1.0
49
+ description: VanaClock is a clock for Final Fantasy Online written in jruby and java
50
+ swing. JRuby is required to run this clock.
51
+ authors:
52
+ - Travis Tilley
53
+ email: ttilley@gmail.com
54
+ extra_rdoc_files: []
55
+ requirements: []
56
+ rubyforge_project: vanatime
57
+ autorequire: