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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines