wxrcg 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/views/abilities_frame.rb +64 -64
- data/lib/views/char_select_dialog.rb +5 -5
- data/lib/views/dm_screen_frame.rb +4 -4
- data/lib/views/weapon_screen_frame.rb +33 -32
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -8,19 +8,19 @@ class WxRCG_frame < Wx::Frame
|
|
8
8
|
@box_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
9
9
|
|
10
10
|
#Name
|
11
|
-
@name_label = Wx::StaticText.new(
|
12
|
-
@name_edit = Wx::TextCtrl.new(
|
11
|
+
@name_label = Wx::StaticText.new(@panel, -1, "Character Name")
|
12
|
+
@name_edit = Wx::TextCtrl.new(@panel, -1)
|
13
13
|
|
14
14
|
#Race Choice
|
15
|
-
@race_label = Wx::StaticText.new(
|
16
|
-
@race_choice = Wx::Choice.new(
|
15
|
+
@race_label = Wx::StaticText.new(@panel, -1, "Race")
|
16
|
+
@race_choice = Wx::Choice.new(@panel, -1)
|
17
17
|
#Set up Choices
|
18
18
|
choices = race_list
|
19
19
|
choices.each {|choice| @race_choice.append(choice.name)}
|
20
20
|
|
21
21
|
#Ability to Enhance
|
22
|
-
@ability_label = Wx::StaticText.new(
|
23
|
-
@ability_choice = Wx::Choice.new(
|
22
|
+
@ability_label = Wx::StaticText.new(@panel, -1, "Ability to Enhance")
|
23
|
+
@ability_choice = Wx::Choice.new(@panel, -1)
|
24
24
|
@ability_label.enable(false)
|
25
25
|
@ability_choice.enable(false)
|
26
26
|
#Set up Choices
|
@@ -28,67 +28,60 @@ class WxRCG_frame < Wx::Frame
|
|
28
28
|
choices.each {|choice| @ability_choice.append(choice)}
|
29
29
|
|
30
30
|
# Spin Controls
|
31
|
-
@str_spinctrl = Wx::SpinCtrl.new(
|
32
|
-
@dex_spinctrl = Wx::SpinCtrl.new(
|
33
|
-
@con_spinctrl = Wx::SpinCtrl.new(
|
34
|
-
@int_spinctrl = Wx::SpinCtrl.new(
|
35
|
-
@wis_spinctrl = Wx::SpinCtrl.new(
|
36
|
-
@cha_spinctrl = Wx::SpinCtrl.new(
|
31
|
+
@str_spinctrl = Wx::SpinCtrl.new(@panel,:min => 7, :max => 18, :initial => 10)
|
32
|
+
@dex_spinctrl = Wx::SpinCtrl.new(@panel,:min => 7, :max => 18, :initial => 10)
|
33
|
+
@con_spinctrl = Wx::SpinCtrl.new(@panel,:min => 7, :max => 18, :initial => 10)
|
34
|
+
@int_spinctrl = Wx::SpinCtrl.new(@panel,:min => 7, :max => 18, :initial => 10)
|
35
|
+
@wis_spinctrl = Wx::SpinCtrl.new(@panel,:min => 7, :max => 18, :initial => 10)
|
36
|
+
@cha_spinctrl = Wx::SpinCtrl.new(@panel,:min => 7, :max => 18, :initial => 10)
|
37
37
|
|
38
38
|
# Save Button
|
39
|
-
@save_btn = Wx::Button.new(
|
39
|
+
@save_btn = Wx::Button.new(@panel,:label=>'Save')
|
40
40
|
|
41
41
|
# load Button
|
42
|
-
@load_btn = Wx::Button.new(
|
42
|
+
@load_btn = Wx::Button.new(@panel,:label=>'Load')
|
43
43
|
|
44
44
|
#Set up Labels
|
45
|
-
col_1_txt = Wx::StaticText.new(
|
46
|
-
col_2_txt = Wx::StaticText.new(
|
47
|
-
col_3_txt = Wx::StaticText.new(
|
48
|
-
col_4_txt = Wx::StaticText.new(
|
49
|
-
col_5_txt = Wx::StaticText.new(
|
50
|
-
col_6_txt = Wx::StaticText.new(
|
51
|
-
@str_ab_txt = Wx::StaticText.new(
|
52
|
-
@dex_ab_txt = Wx::StaticText.new(
|
53
|
-
@con_ab_txt = Wx::StaticText.new(
|
54
|
-
@int_ab_txt = Wx::StaticText.new(
|
55
|
-
@wis_ab_txt = Wx::StaticText.new(
|
56
|
-
@cha_ab_txt = Wx::StaticText.new(
|
57
|
-
@str_rm_txt = Wx::StaticText.new(
|
58
|
-
@dex_rm_txt = Wx::StaticText.new(
|
59
|
-
@con_rm_txt = Wx::StaticText.new(
|
60
|
-
@int_rm_txt = Wx::StaticText.new(
|
61
|
-
@wis_rm_txt = Wx::StaticText.new(
|
62
|
-
@cha_rm_txt = Wx::StaticText.new(
|
63
|
-
@str_to_txt = Wx::StaticText.new(
|
64
|
-
@dex_to_txt = Wx::StaticText.new(
|
65
|
-
@con_to_txt = Wx::StaticText.new(
|
66
|
-
@int_to_txt = Wx::StaticText.new(
|
67
|
-
@wis_to_txt = Wx::StaticText.new(
|
68
|
-
@cha_to_txt = Wx::StaticText.new(
|
69
|
-
@str_am_txt = Wx::StaticText.new(
|
70
|
-
@dex_am_txt = Wx::StaticText.new(
|
71
|
-
@con_am_txt = Wx::StaticText.new(
|
72
|
-
@int_am_txt = Wx::StaticText.new(
|
73
|
-
@wis_am_txt = Wx::StaticText.new(
|
74
|
-
@cha_am_txt = Wx::StaticText.new(
|
75
|
-
@str_po_txt = Wx::StaticText.new(
|
76
|
-
@dex_po_txt = Wx::StaticText.new(
|
77
|
-
@con_po_txt = Wx::StaticText.new(
|
78
|
-
@int_po_txt = Wx::StaticText.new(
|
79
|
-
@wis_po_txt = Wx::StaticText.new(
|
80
|
-
@cha_po_txt = Wx::StaticText.new(
|
81
|
-
@blank_txt = Wx::StaticText.new(
|
82
|
-
@total_txt = Wx::StaticText.new(
|
45
|
+
col_1_txt = Wx::StaticText.new(@panel,-1,"Ability")
|
46
|
+
col_2_txt = Wx::StaticText.new(@panel,-1,"Base Score")
|
47
|
+
col_3_txt = Wx::StaticText.new(@panel,-1,"Race Mod")
|
48
|
+
col_4_txt = Wx::StaticText.new(@panel,-1,"Total")
|
49
|
+
col_5_txt = Wx::StaticText.new(@panel,-1,"Ability Mod")
|
50
|
+
col_6_txt = Wx::StaticText.new(@panel,-1,"Points")
|
51
|
+
@str_ab_txt = Wx::StaticText.new(@panel,-1,"Strength")
|
52
|
+
@dex_ab_txt = Wx::StaticText.new(@panel,-1,"Dexterity")
|
53
|
+
@con_ab_txt = Wx::StaticText.new(@panel,-1,"Constitution")
|
54
|
+
@int_ab_txt = Wx::StaticText.new(@panel,-1,"Intelegence")
|
55
|
+
@wis_ab_txt = Wx::StaticText.new(@panel,-1,"Wisdom")
|
56
|
+
@cha_ab_txt = Wx::StaticText.new(@panel,-1,"Charisma")
|
57
|
+
@str_rm_txt = Wx::StaticText.new(@panel,-1,"0")
|
58
|
+
@dex_rm_txt = Wx::StaticText.new(@panel,-1,"0")
|
59
|
+
@con_rm_txt = Wx::StaticText.new(@panel,-1,"0")
|
60
|
+
@int_rm_txt = Wx::StaticText.new(@panel,-1,"0")
|
61
|
+
@wis_rm_txt = Wx::StaticText.new(@panel,-1,"0")
|
62
|
+
@cha_rm_txt = Wx::StaticText.new(@panel,-1,"0")
|
63
|
+
@str_to_txt = Wx::StaticText.new(@panel,-1,"")
|
64
|
+
@dex_to_txt = Wx::StaticText.new(@panel,-1,"")
|
65
|
+
@con_to_txt = Wx::StaticText.new(@panel,-1,"")
|
66
|
+
@int_to_txt = Wx::StaticText.new(@panel,-1,"")
|
67
|
+
@wis_to_txt = Wx::StaticText.new(@panel,-1,"")
|
68
|
+
@cha_to_txt = Wx::StaticText.new(@panel,-1,"")
|
69
|
+
@str_am_txt = Wx::StaticText.new(@panel,-1,"")
|
70
|
+
@dex_am_txt = Wx::StaticText.new(@panel,-1,"")
|
71
|
+
@con_am_txt = Wx::StaticText.new(@panel,-1,"")
|
72
|
+
@int_am_txt = Wx::StaticText.new(@panel,-1,"")
|
73
|
+
@wis_am_txt = Wx::StaticText.new(@panel,-1,"")
|
74
|
+
@cha_am_txt = Wx::StaticText.new(@panel,-1,"")
|
75
|
+
@str_po_txt = Wx::StaticText.new(@panel,-1,"")
|
76
|
+
@dex_po_txt = Wx::StaticText.new(@panel,-1,"")
|
77
|
+
@con_po_txt = Wx::StaticText.new(@panel,-1,"")
|
78
|
+
@int_po_txt = Wx::StaticText.new(@panel,-1,"")
|
79
|
+
@wis_po_txt = Wx::StaticText.new(@panel,-1,"")
|
80
|
+
@cha_po_txt = Wx::StaticText.new(@panel,-1,"")
|
81
|
+
@blank_txt = Wx::StaticText.new(@panel,-1,"")
|
82
|
+
@total_txt = Wx::StaticText.new(@panel,-1,"")
|
83
83
|
|
84
84
|
#Add everythig into the sizer
|
85
|
-
@box_sizer.add(@name_label,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
86
|
-
@box_sizer.add(@name_edit,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
87
|
-
@box_sizer.add(@race_label,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
88
|
-
@box_sizer.add(@race_choice,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
89
|
-
@box_sizer.add(@ability_label,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
90
|
-
@box_sizer.add(@ability_choice,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
91
|
-
@box_sizer.add(@grid_sizer)
|
92
85
|
@grid_sizer.add(col_1_txt,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
93
86
|
@grid_sizer.add(col_2_txt,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
94
87
|
@grid_sizer.add(col_3_txt,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
@@ -151,6 +144,13 @@ class WxRCG_frame < Wx::Frame
|
|
151
144
|
@grid_sizer.add(@blank_txt,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
152
145
|
@grid_sizer.add(@load_btn,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
153
146
|
@grid_sizer.add(@save_btn,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
147
|
+
@box_sizer.add(@name_label,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
148
|
+
@box_sizer.add(@name_edit,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
149
|
+
@box_sizer.add(@race_label,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
150
|
+
@box_sizer.add(@race_choice,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
151
|
+
@box_sizer.add(@ability_label,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
152
|
+
@box_sizer.add(@ability_choice,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
153
|
+
@box_sizer.add(@grid_sizer,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
154
154
|
|
155
155
|
#Event Handling
|
156
156
|
evt_spinctrl(@str_spinctrl.get_id()) { |event| str_spinctrl_event(event)}
|
@@ -165,12 +165,12 @@ class WxRCG_frame < Wx::Frame
|
|
165
165
|
evt_button(@save_btn.get_id()) { |event| save_button_event(event)}
|
166
166
|
evt_button(@load_btn.get_id()) { |event| load_button_event(event)}
|
167
167
|
|
168
|
-
|
169
|
-
get_sizer.layout
|
170
|
-
get_sizer.fit(self)
|
171
|
-
|
172
|
-
update_labels
|
168
|
+
update_labels
|
173
169
|
|
170
|
+
@panel.set_sizer(@box_sizer)
|
171
|
+
@panel.layout
|
172
|
+
@panel.get_sizer.fit(self)
|
173
|
+
|
174
174
|
show
|
175
175
|
end
|
176
176
|
|
@@ -7,7 +7,7 @@ class Char_select_dialog < Wx::Dialog
|
|
7
7
|
@box_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
8
8
|
|
9
9
|
@labels = ["Name","Str", "Dex", "Con", "Int", "Wis", "Cha"]
|
10
|
-
@grid = Wx::Grid.new(
|
10
|
+
@grid = Wx::Grid.new(@panel)
|
11
11
|
@grid.create_grid(0, @labels.length)
|
12
12
|
@labels.each do |lab|
|
13
13
|
@grid.set_col_label_value(@labels.index(lab), lab)
|
@@ -32,7 +32,7 @@ class Char_select_dialog < Wx::Dialog
|
|
32
32
|
@grid.auto_size_columns
|
33
33
|
|
34
34
|
# load Button
|
35
|
-
@load_btn = Wx::Button.new(
|
35
|
+
@load_btn = Wx::Button.new(@panel,:label=>'Load')
|
36
36
|
|
37
37
|
#Add everythig into the sizer
|
38
38
|
@box_sizer.add(@grid,0,Wx::ALIGN_CENTER|Wx::ALL,5)
|
@@ -41,9 +41,9 @@ class Char_select_dialog < Wx::Dialog
|
|
41
41
|
#Event Handling
|
42
42
|
evt_button(@load_btn.get_id()) { |event| load_button_event(event)}
|
43
43
|
|
44
|
-
set_sizer(@box_sizer)
|
45
|
-
|
46
|
-
get_sizer.fit(self)
|
44
|
+
@panel.set_sizer(@box_sizer)
|
45
|
+
@panel.layout
|
46
|
+
@panel.get_sizer.fit(self)
|
47
47
|
|
48
48
|
show
|
49
49
|
end
|
@@ -21,7 +21,7 @@ class DM_screen_frame < Wx::Frame
|
|
21
21
|
@box_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
22
22
|
|
23
23
|
@labels = ["Name","Weapon", "Attack Bonus", "Damage", "Armour", "AC", "Touch", "FF", "HP", "Init Bonus"]
|
24
|
-
@grid = Wx::Grid.new(
|
24
|
+
@grid = Wx::Grid.new(@panel)
|
25
25
|
@grid.create_grid(0, @labels.length)
|
26
26
|
@labels.each do |lab|
|
27
27
|
@grid.set_col_label_value(@labels.index(lab), lab)
|
@@ -51,9 +51,9 @@ class DM_screen_frame < Wx::Frame
|
|
51
51
|
#Event Handling
|
52
52
|
evt_menu(Wx::ID_EXIT, :on_exit)
|
53
53
|
|
54
|
-
set_sizer(@box_sizer)
|
55
|
-
|
56
|
-
get_sizer.fit(self)
|
54
|
+
@panel.set_sizer(@box_sizer)
|
55
|
+
@panel.layout
|
56
|
+
@panel.get_sizer.fit(self)
|
57
57
|
|
58
58
|
show
|
59
59
|
end
|
@@ -13,33 +13,34 @@ class Weapon_screen_frame < Wx::Frame
|
|
13
13
|
self.menu_bar = menu_bar
|
14
14
|
|
15
15
|
# Set up Controls
|
16
|
-
@
|
17
|
-
@
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
@
|
22
|
-
@
|
23
|
-
@
|
24
|
-
@
|
25
|
-
@
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
34
|
-
@
|
35
|
-
@
|
36
|
-
@
|
37
|
-
@
|
38
|
-
|
39
|
-
@
|
40
|
-
@
|
41
|
-
@
|
42
|
-
@
|
16
|
+
@panel = Wx::Panel.new(self)
|
17
|
+
@name = Wx::TextCtrl.new(@panel, -1)
|
18
|
+
@name_l = Wx::StaticText.new(@panel, -1, "Weapon Name")
|
19
|
+
@training_type = Wx::Choice.new(@panel, -1)
|
20
|
+
@training_type_l = Wx::StaticText.new(@panel, -1, "Training Type")
|
21
|
+
@encumbrance_type = Wx::Choice.new(@panel, -1)
|
22
|
+
@encumbrance_type_l = Wx::StaticText.new(@panel, -1, "Encumbrance Type")
|
23
|
+
@damage = Wx::Choice.new(@panel, -1)
|
24
|
+
@damage_l = Wx::StaticText.new(@panel, -1, "End One Damage")
|
25
|
+
@damage2 = Wx::Choice.new(@panel, -1)
|
26
|
+
@damage2_l = Wx::StaticText.new(@panel, -1, "End Two Damage")
|
27
|
+
@damage_type = Wx::Choice.new(@panel, -1)
|
28
|
+
@damage_type_l = Wx::StaticText.new(@panel, -1, "Damage Type")
|
29
|
+
@critical = Wx::Choice.new(@panel, -1)
|
30
|
+
@critical_l = Wx::StaticText.new(@panel, -1, "Critical")
|
31
|
+
@size = Wx::Choice.new(@panel, -1)
|
32
|
+
@size_l = Wx::StaticText.new(@panel, -1, "Size")
|
33
|
+
@cost = Wx::TextCtrl.new(@panel, -1)
|
34
|
+
@cost_l = Wx::StaticText.new(@panel, -1, "Cost")
|
35
|
+
@range = Wx::TextCtrl.new(@panel, -1)
|
36
|
+
@range_l = Wx::StaticText.new(@panel, -1, "Range")
|
37
|
+
@weight = Wx::TextCtrl.new(@panel, -1)
|
38
|
+
@weight_l = Wx::StaticText.new(@panel, -1, "Weight")
|
39
|
+
@blank_txt = Wx::StaticText.new(@panel,-1,"")
|
40
|
+
@save_btn = Wx::Button.new(@panel,:label=>'Save')
|
41
|
+
@load_btn = Wx::Button.new(@panel,:label=>'Load')
|
42
|
+
@table = Wx::Grid.new(@panel)
|
43
|
+
@sqs = WeaponSpecialQuality.find(:all, :order => "name ASC").map {|sq| Wx::CheckBox.new(@panel, -1, sq.name)}
|
43
44
|
|
44
45
|
|
45
46
|
|
@@ -115,9 +116,9 @@ class Weapon_screen_frame < Wx::Frame
|
|
115
116
|
@main_sizer.add(@table)
|
116
117
|
|
117
118
|
# Finish Sizer Setting
|
118
|
-
set_sizer(@main_sizer)
|
119
|
-
|
120
|
-
get_sizer.fit(self)
|
119
|
+
@panel.set_sizer(@main_sizer)
|
120
|
+
@panel.layout
|
121
|
+
@panel.get_sizer.fit(self)
|
121
122
|
|
122
123
|
#Event Handling
|
123
124
|
evt_menu(Wx::ID_EXIT, :on_exit)
|
@@ -161,8 +162,8 @@ class Weapon_screen_frame < Wx::Frame
|
|
161
162
|
#Update the table, and reset everything for the next update...
|
162
163
|
update_table(weapon)
|
163
164
|
reset_fields
|
164
|
-
|
165
|
-
get_sizer.fit(self)
|
165
|
+
@panel.layout
|
166
|
+
@panel.get_sizer.fit(self)
|
166
167
|
end
|
167
168
|
|
168
169
|
def update_table(weapon)
|