WxVanaClock 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/WxVanaClock.gemspec +5 -5
- data/lib/wx_vana_clock.rb +89 -95
- metadata +44 -49
data/WxVanaClock.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Wxvanaclock-1.0.
|
2
|
+
# Gem::Specification for Wxvanaclock-1.0.3
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{WxVanaClock}
|
7
|
-
s.version = "1.0.
|
8
|
-
s.date = %q{2007-09-
|
7
|
+
s.version = "1.0.3"
|
8
|
+
s.date = %q{2007-09-21}
|
9
9
|
s.summary = %q{WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.}
|
10
10
|
s.email = %q{ttilley@gmail.com}
|
11
11
|
s.homepage = %q{http://vanatime.rubyforge.org/}
|
@@ -23,13 +23,13 @@ end
|
|
23
23
|
|
24
24
|
# # Original Rakefile source (requires the Echoe gem):
|
25
25
|
#
|
26
|
-
# version = "1.0.
|
26
|
+
# version = "1.0.3"
|
27
27
|
#
|
28
28
|
# ENV['RUBY_FLAGS'] = ""
|
29
29
|
#
|
30
30
|
# begin
|
31
31
|
# require 'rubygems'
|
32
|
-
# gem 'echoe', '=2.
|
32
|
+
# gem 'echoe', '=2.4'
|
33
33
|
# require 'echoe'
|
34
34
|
#
|
35
35
|
# Echoe.new('WxVanaClock', version) do |p|
|
data/lib/wx_vana_clock.rb
CHANGED
@@ -1,113 +1,107 @@
|
|
1
|
-
gem 'VanaTime', '>=2.
|
1
|
+
gem 'VanaTime', '>=2.1.1'
|
2
2
|
require 'vana_time'
|
3
3
|
gem 'wxruby', '>=1.9.0'
|
4
4
|
require 'wx'
|
5
5
|
|
6
6
|
module WxVanaClock
|
7
|
-
|
8
|
-
|
7
|
+
class ClockFrame < Wx::Frame
|
8
|
+
include FFXI::Constants
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
def initialize(parent)
|
11
|
+
super()
|
12
|
+
$xrc.load_frame_subclass(self, nil, 'ClockFrame')
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
14
|
+
# get all the text controls
|
15
|
+
@vana_day =
|
16
|
+
Wx::Window.find_window_by_id(Wx::xrcid('VanaDay'), self)
|
17
|
+
@vana_time =
|
18
|
+
Wx::Window.find_window_by_id(Wx::xrcid('VanaTime'), self)
|
19
|
+
@earth_time =
|
20
|
+
Wx::Window.find_window_by_id(Wx::xrcid('EarthTime'), self)
|
21
|
+
@moon_percent =
|
22
|
+
Wx::Window.find_window_by_id(Wx::xrcid('MoonPercent'), self)
|
23
|
+
@phase_name =
|
24
|
+
Wx::Window.find_window_by_id(Wx::xrcid('PhaseName'), self)
|
25
|
+
@next_phase_countdown =
|
26
|
+
Wx::Window.find_window_by_id(Wx::xrcid('NextPhaseCountdown'), self)
|
27
|
+
@next_phase_name =
|
28
|
+
Wx::Window.find_window_by_id(Wx::xrcid('NextPhaseName'), self)
|
29
|
+
@optimal_phase_countdown =
|
30
|
+
Wx::Window.find_window_by_id(Wx::xrcid('OptimalPhaseCountdown'), self)
|
31
|
+
@optimal_phase_name =
|
32
|
+
Wx::Window.find_window_by_id(Wx::xrcid('OptimalPhaseName'), self)
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
34
|
+
# create the procs that update UI elements
|
35
|
+
on_time_string = lambda do |m,o,n|
|
36
|
+
@vana_time.change_value "#{m.time.date_string} #{n}"
|
37
|
+
end
|
38
|
+
on_earth_time = lambda do |m,o,n|
|
39
|
+
@earth_time.change_value n.to_s
|
40
|
+
end
|
41
|
+
on_day_string = lambda do |m,o,n|
|
42
|
+
@vana_day.change_value n
|
43
|
+
end
|
44
|
+
on_moon_percent_string = lambda do |m,o,n|
|
45
|
+
@moon_percent.change_value n
|
46
|
+
end
|
47
|
+
on_moon_phase_name = lambda do |m,o,n|
|
48
|
+
@phase_name.change_value n
|
49
|
+
end
|
50
|
+
on_next_phase_name = lambda do |m,o,n|
|
51
|
+
@next_phase_name.change_value n
|
52
|
+
end
|
53
|
+
on_optimal_phase = lambda do |m,o,n|
|
54
|
+
@optimal_phase_name.change_value n
|
55
|
+
end
|
56
|
+
on_phase_count = lambda do |m,o,n|
|
57
|
+
@next_phase_countdown.change_value n
|
58
|
+
end
|
59
|
+
on_optimal_count = lambda do |m,o,n|
|
60
|
+
@optimal_phase_countdown.change_value n
|
61
|
+
end
|
57
62
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
63
|
+
# set up the time manager
|
64
|
+
@time_manager = FFXI::TimeManager.new
|
65
|
+
@time_manager.callback(:time_string, on_time_string)
|
66
|
+
@time_manager.callback(:earth_time_string, on_earth_time)
|
67
|
+
@time_manager.callback(:day_string, on_day_string)
|
68
|
+
@time_manager.callback(:moon_percent_string, on_moon_percent_string)
|
69
|
+
@time_manager.callback(:moon_phase_name, on_moon_phase_name)
|
70
|
+
@time_manager.callback(:next_phase_name, on_next_phase_name)
|
71
|
+
@time_manager.callback(:optimal_phase_name, on_optimal_phase)
|
72
|
+
@time_manager.callback(:next_phase_countdown_string, on_phase_count)
|
73
|
+
@time_manager.callback(:optimal_phase_countdown_string,
|
74
|
+
on_optimal_count)
|
62
75
|
|
63
|
-
|
64
|
-
|
65
|
-
on_day.call vd
|
66
|
-
on_moon_percent.call vm
|
67
|
-
on_moon_phase.call vm
|
68
|
-
on_optimal_phase.call vm
|
76
|
+
# enable cascading updates and do the first update
|
77
|
+
@time_manager.enable_cascading_updates(Time.now)
|
69
78
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
@time_manager.callback_proc("moon_percent", on_moon_percent)
|
78
|
-
@time_manager.callback_proc("moon_phase", on_moon_phase)
|
79
|
-
@time_manager.callback_proc("next_optimal_phase", on_optimal_phase)
|
80
|
-
@time_manager.callback_proc("next_phase_countdown", on_phase_count)
|
81
|
-
@time_manager.callback_proc("optimal_phase_countdown", on_optimal_count)
|
82
|
-
|
83
|
-
# create timer object, give it ID of 9000 and set owner to self
|
84
|
-
@timer = Wx::Timer.new(self, 9000)
|
85
|
-
# register the timer as an event
|
86
|
-
evt_timer(9000) {|event| notify(event)}
|
87
|
-
# set the timer to fire off every 35 milliseconds
|
88
|
-
@timer.start(35)
|
89
|
-
end
|
79
|
+
# create timer object, give it ID of 9000 and set owner to self
|
80
|
+
@timer = Wx::Timer.new(self, 9000)
|
81
|
+
# register the timer as an event
|
82
|
+
evt_timer(9000) {|event| notify(event)}
|
83
|
+
# set the timer to fire off every 35 milliseconds
|
84
|
+
@timer.start(35)
|
85
|
+
end
|
90
86
|
|
91
|
-
|
92
|
-
|
93
|
-
@time_manager.earth_time = now
|
94
|
-
@earth_time.change_value now.to_s
|
95
|
-
end
|
87
|
+
def notify(event)
|
88
|
+
@time_manager.update_earth_time Time.now
|
96
89
|
end
|
90
|
+
end
|
97
91
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
92
|
+
class ClockApp < Wx::App
|
93
|
+
def on_init
|
94
|
+
# create a resource handler
|
95
|
+
$xrc = Wx::XmlResource.get()
|
96
|
+
$xrc.init_all_handlers()
|
103
97
|
|
104
|
-
|
105
|
-
|
106
|
-
|
98
|
+
# load resource file
|
99
|
+
xrc_file = File.join(File.dirname(__FILE__), 'wxvc-xrc.xml')
|
100
|
+
$xrc.load(xrc_file)
|
107
101
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
102
|
+
# show the main frame
|
103
|
+
@clock = ClockFrame.new(self)
|
104
|
+
@clock.show(true)
|
112
105
|
end
|
106
|
+
end
|
113
107
|
end
|
metadata
CHANGED
@@ -1,33 +1,12 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
|
-
name: WxVanaClock
|
5
|
-
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.2
|
7
|
-
date: 2007-09-08 00:00:00 -04:00
|
8
|
-
summary: WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: ttilley@gmail.com
|
1
|
+
--- !ruby/object:Gem::Specification
|
12
2
|
homepage: http://vanatime.rubyforge.org/
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
+
- WxVanaClock
|
6
|
+
version: !ruby/object:Gem::Version
|
7
|
+
version: 1.0.3
|
28
8
|
post_install_message:
|
29
|
-
|
30
|
-
- Travis Tilley
|
9
|
+
date: 2007-09-21 04:00:00 +00:00
|
31
10
|
files:
|
32
11
|
- README
|
33
12
|
- Manifest
|
@@ -37,34 +16,50 @@ files:
|
|
37
16
|
- CHANGELOG
|
38
17
|
- bin/WxVanaClock
|
39
18
|
- WxVanaClock.gemspec
|
40
|
-
|
41
|
-
|
19
|
+
rubygems_version: 0.9.4
|
42
20
|
rdoc_options: []
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
21
|
+
signing_key:
|
22
|
+
cert_chain:
|
23
|
+
name: WxVanaClock
|
24
|
+
has_rdoc: true
|
25
|
+
platform: ruby
|
26
|
+
summary: WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.
|
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: []
|
52
39
|
dependencies:
|
53
|
-
- !ruby/object:Gem::Dependency
|
40
|
+
- !ruby/object:Gem::Dependency
|
54
41
|
name: VanaTime
|
55
42
|
version_requirement:
|
56
|
-
version_requirements: !ruby/object:Gem::Version::Requirement
|
43
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
44
|
+
version:
|
57
45
|
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
46
|
+
- - '>='
|
47
|
+
- !ruby/object:Gem::Version
|
60
48
|
version: 2.0.0
|
61
|
-
|
62
|
-
- !ruby/object:Gem::Dependency
|
49
|
+
- !ruby/object:Gem::Dependency
|
63
50
|
name: wxruby
|
64
51
|
version_requirement:
|
65
|
-
version_requirements: !ruby/object:Gem::Version::Requirement
|
52
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
53
|
+
version:
|
66
54
|
requirements:
|
67
|
-
- -
|
68
|
-
- !ruby/object:Gem::Version
|
55
|
+
- - '>='
|
56
|
+
- !ruby/object:Gem::Version
|
69
57
|
version: 1.9.0
|
70
|
-
|
58
|
+
description: WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.
|
59
|
+
authors:
|
60
|
+
- Travis Tilley
|
61
|
+
email: ttilley@gmail.com
|
62
|
+
extra_rdoc_files: []
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project: vanatime
|
65
|
+
autorequire:
|