--- deliantra/server/ext/widget.ext 2007/12/27 19:41:26 1.21 +++ deliantra/server/ext/widget.ext 2007/12/28 12:44:45 1.22 @@ -98,31 +98,6 @@ EOF die if $@; -sub demo_start { - my ($ns) = @_; - - my $ws = $ns->{csc} = $ns->new_widgetset; - - my ($tl, $entry) = $ws->template (inline => $cg_template, - [ - toplevel => {}, - entry => { - text => "xyz", - on_changed => sub { - warn "changed<@_>\n";#d# - }, - }, - ], - ); - - $tl->show; - - $ns->{xxxw} = [$tl, $entry];#d# - -# $ws->find ("setup_notebook")->add ($ws->{tab}); -# $ws->find ("setup_dialog")->toggle_visibility; -} - sub csc_start { my ($ns) = @_; @@ -171,19 +146,37 @@ $ws->{tl} = $w; $w->show; + +# my ($tl, $entry) = $ws->template (inline => $cg_template, +# [ +# toplevel => {}, +# entry => { +# text => "xyz", +# on_changed => sub { +# warn "changed<@_>\n";#d# +# }, +# }, +# ], +# ); +# +# $tl->show; +# +# $ns->{xxxw} = [$tl, $entry];#d# +# +# $ws->find ("setup_notebook")->add ($ws->{tab}); +# $ws->find ("setup_dialog")->toggle_visibility; } cf::player->attach ( on_login => sub { my ($pl) = @_; - return unless $cf::CFG{devel}; - my $ns = $pl->ns; - return unless $ns->{can_widget}; + + return unless $cf::CFG{devel}; + #csc_start $ns; - demo_start $ns; }, ); @@ -289,13 +282,14 @@ my ($self, $type, $template, $args, $done_cb) = @_; my %cfg; - my @res; while (@$args) { my ($name, $args) = splice @$args, 0, 2, (); my $proxy = $self->alloc; + $self->{delete $args->{alias} or $name} = $proxy; + Scalar::Util::weaken ($self->{_w}{$proxy->{id}} = $proxy); Scalar::Util::weaken ($proxy->{ws} = $self); @@ -307,8 +301,6 @@ %$args, id => $proxy->{id}, }; - - push @res, $proxy; } if ($done_cb) { @@ -321,14 +313,17 @@ }); } + if ($type eq "face") { + $self->{ns}->send_face ($template, 100); + $self->{ns}->flush_fx; + } + $self->msg (ws_ct => $self->{id}, $type => $template, $done_cb, \%cfg, ); - - @res } sub find {