ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.134 by elmex, Mon Dec 4 15:17:14 2006 UTC vs.
Revision 1.135 by elmex, Tue Dec 5 16:53:29 2006 UTC

1927 ); 1927 );
1928 $r->add (my $vb = new CFPlus::UI::VBox); 1928 $r->add (my $vb = new CFPlus::UI::VBox);
1929 $win->add ($r); 1929 $win->add ($r);
1930 1930
1931 1931
1932 $vb->add (my $chk = new CFPlus::UI::Button text => "Disable build mode", on_activate => sub { $::IN_BUILD_MODE = undef }); 1932 $vb->add (
1933 $vb->add (my $chk = new CFPlus::UI::Button text => "ERASE", on_activate => sub { $::IN_BUILD_MODE = { do_erase => 1 } }); 1933 new CFPlus::UI::Button
1934 text => "Disable build mode",
1935 on_activate => sub { $::IN_BUILD_MODE = undef }
1936 );
1937 $vb->add (
1938 new CFPlus::UI::Button
1939 text => "ERASE",
1940 on_activate => sub { $::IN_BUILD_MODE = { do_erase => 1 } }
1941 );
1934 1942
1935 for my $itemarchname (keys %{$msg->{items}}) { 1943 for my $itemarchname (
1944 sort {
1945 $msg->{items}->{$a}->{build_arch_name}
1946 cmp $msg->{items}->{$b}->{build_arch_name}
1947 } keys %{$msg->{items}}
1948 ) {
1949 my $info = $msg->{items}->{$itemarchname};
1936 $vb->add ( 1950 $vb->add (
1937 new CFPlus::UI::Button text => "$itemarchname", 1951 new CFPlus::UI::Button text => $info->{build_arch_name},
1938 on_activate => sub { 1952 on_activate => sub {
1939 $::IN_BUILD_MODE = $itemarchname; 1953 $::IN_BUILD_MODE = { item => $itemarchname, info => $info };
1954
1955 if (grep { $msg->{items}->{$itemarchname}->{$_} } qw/has_connection has_name has_text/) {
1956 build_mode_query_arch_info ();
1957 }
1940 } 1958 }
1941 ); 1959 );
1942 } 1960 }
1943 1961
1944 $win->show; 1962 $win->show;
1963}
1964
1965sub build_mode_query_arch_info {
1966 my ($iteminfo) = $::IN_BUILD_MODE;
1967 my $itemarchname = $iteminfo->{item};
1968 my $info = $iteminfo->{info};
1969
1970 my $dialog = new CFPlus::UI::Toplevel
1971 x => "center",
1972 y => "center",
1973 z => 50,
1974 force_w => int $WIDTH * 1/2,
1975 title => "Enter information for placement of '$itemarchname'",
1976 has_close_button => 1;
1977
1978 $dialog->add (my $vb = new CFPlus::UI::VBox expand => 1);
1979
1980 $vb->add (my $table = new CFPlus::UI::Table expand => 1);
1981 my $row = 0;
1982 if ($info->{has_name}) {
1983 $table->add (0, $row, new CFPlus::UI::Label text => "Name:");
1984 $table->add (1, $row++, new CFPlus::UI::Entry expand => 1, on_changed => sub { $::IN_BUILD_MODE->{name} = $_[1]; 0 });
1985 }
1986 if ($info->{has_text}) {
1987 $table->add (0, $row, new CFPlus::UI::Label text => "Text:");
1988 $table->add (1, $row++, new CFPlus::UI::Entry expand => 1, on_changed => sub { $::IN_BUILD_MODE->{text} = $_[1]; 0 });
1989 }
1990 if ($info->{has_connection}) {
1991 $table->add (0, $row, new CFPlus::UI::Label text => "Connection ID:");
1992 $table->add (1, $row++,
1993 new CFPlus::UI::Entry
1994 expand => 1,
1995 on_changed => sub { $::IN_BUILD_MODE->{connection} = $_[1]; 0 },
1996 tooltip => "Enter the connection ID here. The connection ID connects actors like a lever to a gate or a magic ear to a gate"
1997 );
1998 }
1999
2000 $vb->add (my $hb = new CFPlus::UI::HBox expand => 1);
2001 $hb->add (new CFPlus::UI::Button
2002 text => "Close",
2003 expand => 1,
2004 on_activate => sub { $dialog->hide; 0 },
2005 );
2006 $dialog->show;
1945} 2007}
1946 2008
1947sub video_shutdown { 2009sub video_shutdown {
1948 CFPlus::OpenGL::shutdown; 2010 CFPlus::OpenGL::shutdown;
1949 2011

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines