ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Protocol.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Protocol.pm (file contents):
Revision 1.183 by root, Wed Dec 26 21:03:21 2007 UTC vs.
Revision 1.184 by root, Thu Dec 27 18:35:56 2007 UTC

19 19
20 my $self = $class->SUPER::new (%arg, 20 my $self = $class->SUPER::new (%arg,
21 setup_req => { 21 setup_req => {
22 extmap => 1, 22 extmap => 1,
23 excmd => 1, 23 excmd => 1,
24 widget => 1, 24 widget => 2,
25 %{$arg{setup_req} || {}}, 25 %{$arg{setup_req} || {}},
26 }, 26 },
27 ); 27 );
28 28
29 $self->{map_widget}->clr_commands; 29 $self->{map_widget}->clr_commands;
102} 102}
103 103
104sub ext_capabilities { 104sub ext_capabilities {
105 my ($self, %cap) = @_; 105 my ($self, %cap) = @_;
106 106
107 #$self->send ("setup sound 0"); # we use a different protocol
108 $self->update_fx_want; 107 $self->update_fx_want;
109 108
110 $self->send_exti_req (resource => "exp_table", sub { 109 $self->send_exti_req (resource => "exp_table", sub {
111 my ($exp_table) = @_; 110 my ($exp_table) = @_;
112 111
191 $ws, $id => scalar eval { 190 $ws, $id => scalar eval {
192 local $SIG{__DIE__}; 191 local $SIG{__DIE__};
193 "DC::UI::$class"->new (%$args) 192 "DC::UI::$class"->new (%$args)
194 } 193 }
195 ); 194 );
195}
196
197# widgetset create template
198sub ext_ws_ct {
199 my ($self, $ws, $template, $cfg) = @_;
200
201 $template = eval <<EOF;
202[
203 Toplevel => {
204 s_id => "toplevel",
205 title => "Character Creation",
206 x => "center",
207 y => "center",
208 z => 5,
209 s_cl => [VBox => {s_cl => [
210 Label => {
211 text => "Character Creation",
212 fontsize => 1,
213 align => 0,
214 },
215 Label => {
216 markup => "View or Edit your character attributes below, then press <b>Finish</b> to create your character",
217 fontsize => 0.8,
218 align => 0,
219 },
220 Notebook => {
221 s_cl => [
222 Label => {
223 text => "hulla-hoop"
224 },
225 Entry => {
226 s_id => "entry",
227 },
228 ],
229 },
230 Button => {
231 s_id => "finish",
232 title => "Finish",
233 },
234 ]}],
235 },
236]
237EOF
238 die if $@;
239
240 my $parse_list; $parse_list = sub {
241 my ($list) = @_;
242 my @w;
243
244 while (@$list) {
245 my ($class, $args) = splice @$list, 0, 2;
246 my $name = delete $args->{s_id};
247 my $cl = delete $args->{s_cl};
248 my $cfg = delete $cfg->{$name};
249 my $id = delete $cfg->{id};
250 my $w = eval { "DC::UI::$class"->new (%$args, %{ $cfg || {} }) }
251 or next;
252
253 $self->widget_associate ($ws, $id, $w)
254 if $id;
255
256 $w->add ($parse_list->($cl))
257 if $cl;
258
259 push @w, $w;
260 }
261
262 @w
263 };
264
265 $parse_list->($template);
266
196} 267}
197 268
198# widgetset associate 269# widgetset associate
199sub ext_ws_a { 270sub ext_ws_a {
200 my ($self, %ass) = @_; 271 my ($self, %ass) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines