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.40 by root, Fri Jun 2 02:12:04 2006 UTC vs.
Revision 1.44 by elmex, Fri Jun 2 16:32:12 2006 UTC

108 108
109our $BIND_WINDOW; 109our $BIND_WINDOW;
110our $BIND_EDITOR; 110our $BIND_EDITOR;
111 111
112our $SPELL_LIST; 112our $SPELL_LIST;
113our $PICKUP_CFG;
113 114
114sub status { 115sub status {
115 $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); 116 $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
116} 117}
117 118
710} 711}
711 712
712sub metaserver_dialog { 713sub metaserver_dialog {
713 my $dialog = new CFClient::UI::FancyFrame 714 my $dialog = new CFClient::UI::FancyFrame
714 title => "Server List", 715 title => "Server List",
716 name => 'metaserver_dialog',
715 x => 'center', 717 x => 'center',
716 y => 'center', 718 y => 'center',
717 child => (my $vbox = new CFClient::UI::VBox), 719 child => (my $vbox = new CFClient::UI::VBox),
718 on_visibility_change => sub { 720 on_visibility_change => sub {
719 update_metaserver if $_[1]; 721 update_metaserver if $_[1];
927 on_activate => sub { exit }, 929 on_activate => sub { exit },
928 ); 930 );
929 } 931 }
930 932
931 $QUIT_DIALOG->show; 933 $QUIT_DIALOG->show;
934}
935
936sub make_pickup_cfg_window {
937 $PICKUP_CFG = new CFClient::UI::FancyFrame
938 title => "Autopickup configuration",
939 x => "center",
940 y => "center",
941 force_w => $WIDTH * 3/10,
942 force_h => $HEIGHT * 9/10;
943
944 my $tbl = new CFClient::UI::Table;
945 my $tblrow = 0;
946
947 $PICKUP_CFG->add (my $sw = new CFClient::UI::ScrolledWindow scrolled => $tbl, expand => 1);
948
949 for (
950 ["Enable (new) autopickup" => CFClient::Pickup::PU_NEWMODE],
951 ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT],
952 ["Stop before pickup" => CFClient::Pickup::PU_STOP],
953 ["Debug autopickup" => CFClient::Pickup::PU_DEBUG],
954 ["Weapons"],
955 ["All weapons" => CFClient::Pickup::PU_ALLWEAPON],
956 ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON],
957 ["Bows" => CFClient::Pickup::PU_BOW],
958 ["Arrows" => CFClient::Pickup::PU_ARROW],
959 ["Armour"],
960 ["Helmets" => CFClient::Pickup::PU_HELMET],
961 ["Shields" => CFClient::Pickup::PU_SHIELD],
962 ["Body Armour" => CFClient::Pickup::PU_ARMOUR],
963 ["Boots" => CFClient::Pickup::PU_BOOTS],
964 ["Gloves" => CFClient::Pickup::PU_GLOVES],
965 ["Cloaks" => CFClient::Pickup::PU_CLOAK],
966 ["Readables"],
967 ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK],
968 ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL],
969 ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES],
970 ["Misc"],
971 ["Food" => CFClient::Pickup::PU_FOOD],
972 ["Drinks" => CFClient::Pickup::PU_DRINK],
973 ["Valuables (Money, Gems)" => CFClient::Pickup::PU_VALUABLES],
974 ["Keys" => CFClient::Pickup::PU_KEY],
975 ["Magical Items" => CFClient::Pickup::PU_MAGICAL],
976 ["Potions" => CFClient::Pickup::PU_POTION],
977 ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE],
978 ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED],
979 ["Jewelery" => CFClient::Pickup::PU_JEWELS],
980 )
981 {
982 unless (defined $_->[1]) {
983 $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => 0);
984 } else {
985 my $mask = $_->[1];
986 $tbl->add (0, $tblrow, new CFClient::UI::Label text => $_->[0], align => -1);
987 $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox
988 state => $CFG->{pickup} & $mask,
989 on_changed => sub {
990 my ($box, $value) = @_;
991 if ($value) {
992 $CFG->{pickup} |= $mask;
993 } else {
994 $CFG->{pickup} = $CFG->{pickup} & ~$mask;
995 }
996 $::CONN->send (sprintf "command pickup %u", $CFG->{pickup});
997 });
998 }
999 }
1000
1001 $PICKUP_CFG
932} 1002}
933 1003
934sub make_inventory_window { 1004sub make_inventory_window {
935 my $invwin = $INV_WINDOW = new CFClient::UI::FancyFrame 1005 my $invwin = $INV_WINDOW = new CFClient::UI::FancyFrame
936 x => "center", 1006 x => "center",
1060 $BIND_WINDOW 1130 $BIND_WINDOW
1061} 1131}
1062 1132
1063sub make_help_window { 1133sub make_help_window {
1064 my $win = new CFClient::UI::FancyFrame 1134 my $win = new CFClient::UI::FancyFrame
1135 x => 'center',
1136 y => 'center',
1137 name => 'doc_browser',
1065 def_w => int $WIDTH * 7/8, 1138 force_w => int $WIDTH * 7/8,
1066 def_h => int $HEIGHT * 7/8, 1139 force_h => int $HEIGHT * 7/8,
1067 title => "Documentation"; 1140 title => "Documentation";
1068 1141
1069 $win->add (my $vbox = new CFClient::UI::VBox); 1142 $win->add (my $vbox = new CFClient::UI::VBox);
1070 1143
1071 $vbox->add (my $buttons = new CFClient::UI::HBox); 1144 $vbox->add (my $buttons = new CFClient::UI::HBox);
1072 $vbox->add (my $viewer = new CFClient::UI::TextView expand => 1, fontsize => 0.8); 1145 $vbox->add (my $viewer = new CFClient::UI::TextView expand => 1, fontsize => 0.8);
1153 force_y => "max", 1226 force_y => "max",
1154 child => $STATUSBOX, 1227 child => $STATUSBOX,
1155 )->show; 1228 )->show;
1156 1229
1157 CFClient::UI::FancyFrame->new ( 1230 CFClient::UI::FancyFrame->new (
1231 title => "Mini Map",
1232 name => "mapmap",
1158 x => 0, 1233 x => 0,
1159 y => $FONTSIZE + 8, 1234 y => $FONTSIZE + 8,
1160 border_bg => [1, 1, 1, 192/255], 1235 border_bg => [1, 1, 1, 192/255],
1161 bg => [1, 1, 1, 0], 1236 bg => [1, 1, 1, 0],
1162 child => ($MAPMAP = new CFClient::MapWidget::MapMap 1237 child => ($MAPMAP = new CFClient::MapWidget::MapMap
1232 1307
1233 $BUTTONBAR->add (new CFClient::UI::Flopper 1308 $BUTTONBAR->add (new CFClient::UI::Flopper
1234 text => "Spells", 1309 text => "Spells",
1235 other => make_spell_list, 1310 other => make_spell_list,
1236 tooltip => "The spell list"); 1311 tooltip => "The spell list");
1312
1313 $BUTTONBAR->add (new CFClient::UI::Flopper
1314 text => "Pickup",
1315 other => make_pickup_cfg_window,
1316 tooltip => "The pickup dialog");
1317
1237 1318
1238 $BUTTONBAR->add (new CFClient::UI::Button 1319 $BUTTONBAR->add (new CFClient::UI::Button
1239 text => "Quit", 1320 text => "Quit",
1240 tooltip => "Terminates the program", 1321 tooltip => "Terminates the program",
1241 on_activate => sub { 1322 on_activate => sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines