… | |
… | |
81 | our $LOGVIEW; |
81 | our $LOGVIEW; |
82 | our $CONSOLE; |
82 | our $CONSOLE; |
83 | our $METASERVER; |
83 | our $METASERVER; |
84 | our $LOGIN_BUTTON; |
84 | our $LOGIN_BUTTON; |
85 | our $QUIT_DIALOG; |
85 | our $QUIT_DIALOG; |
|
|
86 | our $HOST_ENTRY; |
86 | our $SERVER_SETUP; |
87 | our $SERVER_SETUP; |
87 | |
88 | |
88 | our $FLOORBOX; |
89 | our $FLOORBOX; |
89 | our $GAUGES; |
90 | our $GAUGES; |
90 | our $STATWIDS; |
91 | our $STATWIDS; |
… | |
… | |
104 | our $INV; |
105 | our $INV; |
105 | our $INVR; |
106 | our $INVR; |
106 | our $INV_RIGHT_HB; |
107 | our $INV_RIGHT_HB; |
107 | |
108 | |
108 | our $BIND_WINDOW; |
109 | our $BIND_WINDOW; |
|
|
110 | our $BIND_EDITOR; |
|
|
111 | |
|
|
112 | our $SPELL_LIST; |
|
|
113 | our $PICKUP_CFG; |
109 | |
114 | |
110 | sub status { |
115 | sub status { |
111 | $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]); |
112 | } |
117 | } |
113 | |
118 | |
… | |
… | |
625 | |
630 | |
626 | $STATWIDS->{"res_$_"}->set_text (sprintf "%d%", $stats->{$tbl{$_}}) |
631 | $STATWIDS->{"res_$_"}->set_text (sprintf "%d%", $stats->{$tbl{$_}}) |
627 | for keys %tbl; |
632 | for keys %tbl; |
628 | } |
633 | } |
629 | |
634 | |
630 | sub metaserver_dialog { |
|
|
631 | my $dialog = new CFClient::UI::FancyFrame |
|
|
632 | title => "Server List", |
|
|
633 | child => (my $vbox = new CFClient::UI::VBox); |
|
|
634 | |
|
|
635 | $vbox->add ($dialog->{table} = new CFClient::UI::Table); |
|
|
636 | |
|
|
637 | $dialog |
|
|
638 | } |
|
|
639 | |
|
|
640 | my $METASERVER_ATIME; |
635 | my $METASERVER_ATIME; |
641 | |
636 | |
642 | sub update_metaserver { |
637 | sub update_metaserver { |
643 | my ($HOST) = @_; |
|
|
644 | |
|
|
645 | return if $METASERVER_ATIME > time; |
638 | return if $METASERVER_ATIME > time; |
646 | $METASERVER_ATIME = time + 60; |
639 | $METASERVER_ATIME = time + 60; |
647 | |
640 | |
648 | my $table = $METASERVER->{table}; |
641 | my $table = $METASERVER->{table}; |
649 | $table->clear; |
642 | $table->clear; |
… | |
… | |
701 | |
694 | |
702 | $y++; |
695 | $y++; |
703 | |
696 | |
704 | $table->add (0, $y, new CFClient::UI::VBox children => [ |
697 | $table->add (0, $y, new CFClient::UI::VBox children => [ |
705 | (new CFClient::UI::Button text => "Use", on_activate => sub { |
698 | (new CFClient::UI::Button text => "Use", on_activate => sub { |
706 | $HOST->set_text ($CFG->{host} = $host); |
699 | $HOST_ENTRY->set_text ($CFG->{host} = $host); |
|
|
700 | $METASERVER->toggle_visibility; |
707 | }), |
701 | }), |
708 | (new CFClient::UI::Empty expand => 1), |
702 | (new CFClient::UI::Empty expand => 1), |
709 | ]); |
703 | ]); |
710 | |
704 | |
711 | $table->add ($_ + 1, $y, new CFClient::UI::Label |
705 | $table->add ($_ + 1, $y, new CFClient::UI::Label |
… | |
… | |
714 | } |
708 | } |
715 | } |
709 | } |
716 | }); |
710 | }); |
717 | } |
711 | } |
718 | |
712 | |
|
|
713 | sub metaserver_dialog { |
|
|
714 | my $dialog = new CFClient::UI::FancyFrame |
|
|
715 | title => "Server List", |
|
|
716 | name => 'metaserver_dialog', |
|
|
717 | x => 'center', |
|
|
718 | y => 'center', |
|
|
719 | child => (my $vbox = new CFClient::UI::VBox), |
|
|
720 | on_visibility_change => sub { |
|
|
721 | update_metaserver if $_[1]; |
|
|
722 | }, |
|
|
723 | ; |
|
|
724 | |
|
|
725 | $vbox->add ($dialog->{table} = new CFClient::UI::Table); |
|
|
726 | |
|
|
727 | $dialog |
|
|
728 | } |
|
|
729 | |
719 | sub server_setup { |
730 | sub server_setup { |
720 | my $dialog = $SERVER_SETUP = new CFClient::UI::FancyFrame |
731 | my $dialog = $SERVER_SETUP = new CFClient::UI::FancyFrame |
721 | x => "center", |
732 | x => "center", |
722 | y => "center", |
733 | y => "center", |
723 | name => "server_setup", |
734 | name => "server_setup", |
… | |
… | |
730 | |
741 | |
731 | { |
742 | { |
732 | $table->add (1, 2, my $vbox = new CFClient::UI::VBox); |
743 | $table->add (1, 2, my $vbox = new CFClient::UI::VBox); |
733 | |
744 | |
734 | $vbox->add ( |
745 | $vbox->add ( |
735 | my $HOST = new CFClient::UI::Entry |
746 | $HOST_ENTRY = new CFClient::UI::Entry |
736 | expand => 1, |
747 | expand => 1, |
737 | text => $CFG->{host}, |
748 | text => $CFG->{host}, |
738 | tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", |
749 | tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", |
739 | on_changed => sub { |
750 | on_changed => sub { |
740 | my ($self, $value) = @_; |
751 | my ($self, $value) = @_; |
… | |
… | |
742 | } |
753 | } |
743 | ); |
754 | ); |
744 | |
755 | |
745 | $METASERVER = metaserver_dialog; |
756 | $METASERVER = metaserver_dialog; |
746 | |
757 | |
747 | $vbox->add (new CFClient::UI::Flopper |
758 | $vbox->add (new CFClient::UI::Button |
748 | expand => 1, |
759 | expand => 1, |
749 | text => "Server List", |
760 | text => "Server List", |
750 | other => $METASERVER, |
761 | other => $METASERVER, |
751 | tooltip => "Show a list of available crossfire servers", |
762 | tooltip => "Show a list of available crossfire servers", |
752 | on_open => sub { |
763 | on_activate => sub { $METASERVER->toggle_visibility }, |
753 | update_metaserver $HOST; |
|
|
754 | } |
|
|
755 | ); |
764 | ); |
756 | } |
765 | } |
757 | |
766 | |
758 | $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username"); |
767 | $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username"); |
759 | $table->add (1, 4, new CFClient::UI::Entry |
768 | $table->add (1, 4, new CFClient::UI::Entry |
… | |
… | |
862 | }, |
871 | }, |
863 | on_activate => sub { |
872 | on_activate => sub { |
864 | my ($input, $text) = @_; |
873 | my ($input, $text) = @_; |
865 | $input->set_text (''); |
874 | $input->set_text (''); |
866 | |
875 | |
867 | if ($text =~ /^\/bind\s+(.*)$/) { |
|
|
868 | CFClient::Recorder::open_binding_dialog ([$1]); |
|
|
869 | } elsif ($text =~ /^\/(.*)/) { |
876 | if ($text =~ /^\/(.*)/) { |
870 | $::CONN->user_send ($1); |
877 | $::CONN->user_send ($1); |
871 | } else { |
878 | } else { |
872 | my $say_cmd = $::CFG->{say_command} || 'say'; |
879 | my $say_cmd = $::CFG->{say_command} || 'say'; |
873 | $::CONN->user_send ("$say_cmd $text"); |
880 | $::CONN->user_send ("$say_cmd $text"); |
874 | } |
881 | } |
… | |
… | |
919 | } |
926 | } |
920 | |
927 | |
921 | $QUIT_DIALOG->show; |
928 | $QUIT_DIALOG->show; |
922 | } |
929 | } |
923 | |
930 | |
|
|
931 | sub make_pickup_cfg_window { |
|
|
932 | $PICKUP_CFG = new CFClient::UI::FancyFrame |
|
|
933 | title => "Autopickup configuration", |
|
|
934 | x => "center", |
|
|
935 | y => "center", |
|
|
936 | force_w => $WIDTH * 6/10, |
|
|
937 | force_h => $HEIGHT * 9/10; |
|
|
938 | |
|
|
939 | |
|
|
940 | $PICKUP_CFG->add (my $vb = new CFClient::UI::VBox); |
|
|
941 | $vb->add (my $gen_tbl = new CFClient::UI::Table expand => 1); |
|
|
942 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
|
|
943 | $hb->add (my $ltbl = new CFClient::UI::Table expand => 1); |
|
|
944 | $hb->add (my $rtbl = new CFClient::UI::Table expand => 1); |
|
|
945 | |
|
|
946 | my $tbl = 0; |
|
|
947 | my $tblrow = 0; |
|
|
948 | |
|
|
949 | for ( |
|
|
950 | ["General", $gen_tbl], |
|
|
951 | ["Enable autopickup" => CFClient::Pickup::PU_NEWMODE], |
|
|
952 | ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT], |
|
|
953 | ["Stop before pickup" => CFClient::Pickup::PU_STOP], |
|
|
954 | ["Debug autopickup" => CFClient::Pickup::PU_DEBUG], |
|
|
955 | ["Weapons", $ltbl], |
|
|
956 | ["All weapons" => CFClient::Pickup::PU_ALLWEAPON], |
|
|
957 | ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON], |
|
|
958 | ["Bows" => CFClient::Pickup::PU_BOW], |
|
|
959 | ["Arrows" => CFClient::Pickup::PU_ARROW], |
|
|
960 | ["Armour"], |
|
|
961 | ["Helmets" => CFClient::Pickup::PU_HELMET], |
|
|
962 | ["Shields" => CFClient::Pickup::PU_SHIELD], |
|
|
963 | ["Body Armour" => CFClient::Pickup::PU_ARMOUR], |
|
|
964 | ["Boots" => CFClient::Pickup::PU_BOOTS], |
|
|
965 | ["Gloves" => CFClient::Pickup::PU_GLOVES], |
|
|
966 | ["Cloaks" => CFClient::Pickup::PU_CLOAK], |
|
|
967 | ["Readables", $rtbl], |
|
|
968 | ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK], |
|
|
969 | ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL], |
|
|
970 | ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES], |
|
|
971 | ["Misc"], |
|
|
972 | ["Food" => CFClient::Pickup::PU_FOOD], |
|
|
973 | ["Drinks" => CFClient::Pickup::PU_DRINK], |
|
|
974 | ["Valuables (Money, Gems)" => CFClient::Pickup::PU_VALUABLES], |
|
|
975 | ["Keys" => CFClient::Pickup::PU_KEY], |
|
|
976 | ["Magical Items" => CFClient::Pickup::PU_MAGICAL], |
|
|
977 | ["Potions" => CFClient::Pickup::PU_POTION], |
|
|
978 | ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE], |
|
|
979 | ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED], |
|
|
980 | ["Jewelery" => CFClient::Pickup::PU_JEWELS], |
|
|
981 | ) |
|
|
982 | { |
|
|
983 | if (ref $_->[1]) { |
|
|
984 | $tbl = $_->[1]; |
|
|
985 | $tblrow = 0; |
|
|
986 | $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => -1); |
|
|
987 | } elsif (not defined $_->[1]) { |
|
|
988 | $tbl->add (0, $tblrow++, new CFClient::UI::Label text => $_->[0], align => -1); |
|
|
989 | } else { |
|
|
990 | my $mask = $_->[1]; |
|
|
991 | $tbl->add (0, $tblrow, new CFClient::UI::Label text => $_->[0], align => 1, expand => 1); |
|
|
992 | $tbl->add (1, $tblrow++, new CFClient::UI::CheckBox |
|
|
993 | state => $CFG->{pickup} & $mask, |
|
|
994 | on_changed => sub { |
|
|
995 | my ($box, $value) = @_; |
|
|
996 | if ($value) { |
|
|
997 | $::CFG->{pickup} |= $mask; |
|
|
998 | } else { |
|
|
999 | $::CFG->{pickup} = $::CFG->{pickup} & ~$mask; |
|
|
1000 | } |
|
|
1001 | $::CONN->send (sprintf "command pickup %u", $::CFG->{pickup}) |
|
|
1002 | if defined $::CONN; |
|
|
1003 | }); |
|
|
1004 | } |
|
|
1005 | } |
|
|
1006 | |
|
|
1007 | $PICKUP_CFG |
|
|
1008 | } |
|
|
1009 | |
924 | sub make_inventory_window { |
1010 | sub make_inventory_window { |
925 | my $invwin = $INV_WINDOW = new CFClient::UI::FancyFrame |
1011 | my $invwin = $INV_WINDOW = new CFClient::UI::FancyFrame |
926 | x => "center", |
1012 | x => "center", |
927 | y => "center", |
1013 | y => "center", |
928 | def_w => $WIDTH * 9/10, |
1014 | force_w => $WIDTH * 9/10, |
929 | def_h => $HEIGHT * 9/10, |
1015 | force_h => $HEIGHT * 9/10, |
930 | title => "Inventory", |
1016 | title => "Inventory", |
931 | name => "inventory_window", |
|
|
932 | ; |
1017 | ; |
933 | |
1018 | |
934 | $invwin->add (my $hb = new CFClient::UI::HBox homogeneous => 1); |
1019 | $invwin->add (my $hb = new CFClient::UI::HBox homogeneous => 1); |
935 | |
1020 | |
936 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
1021 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
… | |
… | |
947 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
1032 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
948 | |
1033 | |
949 | $invwin |
1034 | $invwin |
950 | } |
1035 | } |
951 | |
1036 | |
|
|
1037 | sub make_spell_list { |
|
|
1038 | $SPELL_LIST = new CFClient::UI::SpellList |
|
|
1039 | force_w => $WIDTH * (9/10), |
|
|
1040 | force_h => $HEIGHT * (9/10); |
|
|
1041 | $SPELL_LIST |
|
|
1042 | } |
|
|
1043 | |
952 | sub make_binding_window { |
1044 | sub make_binding_window { |
953 | my $binding_list = new CFClient::UI::VBox; |
1045 | my $binding_list = new CFClient::UI::VBox; |
954 | |
1046 | |
|
|
1047 | my $refresh; |
955 | my $refresh = sub { |
1048 | $refresh = sub { |
956 | $binding_list->clear (); |
1049 | $binding_list->clear (); |
957 | |
1050 | |
958 | for my $mod (keys %{$::CFG->{bindings}}) { |
1051 | for my $mod (keys %{$::CFG->{bindings}}) { |
959 | for my $sym (keys %{$::CFG->{bindings}->{$mod}}) { |
1052 | for my $sym (keys %{$::CFG->{bindings}->{$mod}}) { |
960 | my $cmds = $::CFG->{bindings}->{$mod}->{$sym}; |
1053 | my $cmds = $::CFG->{bindings}->{$mod}->{$sym}; |
961 | next unless ref $cmds eq 'ARRAY' and @$cmds > 0; |
1054 | next unless ref $cmds eq 'ARRAY' and @$cmds > 0; |
962 | |
1055 | |
963 | my $lbl = join "; ", @$cmds; |
1056 | my $lbl = join "; ", @$cmds; |
964 | my $nam = CFClient::Recorder::keycombo_to_name ($mod, $sym); |
1057 | my $nam = CFClient::Binder::keycombo_to_name ($mod, $sym); |
965 | $binding_list->add (my $hb = new CFClient::UI::HBox); |
1058 | $binding_list->add (my $hb = new CFClient::UI::HBox); |
966 | $hb->add (new CFClient::UI::Button |
1059 | $hb->add (new CFClient::UI::Button |
967 | text => "delete", |
1060 | text => "delete", |
|
|
1061 | tooltip => "Deletes the binding", |
968 | on_activate => sub { |
1062 | on_activate => sub { |
969 | $binding_list->remove ($hb); |
1063 | $binding_list->remove ($hb); |
970 | delete $::CFG->{bindings}->{$mod}->{$sym}; |
1064 | delete $::CFG->{bindings}->{$mod}->{$sym}; |
971 | }); |
1065 | }); |
|
|
1066 | |
|
|
1067 | $hb->add (new CFClient::UI::Button |
|
|
1068 | text => "edit", |
|
|
1069 | tooltip => "Edits the binding", |
|
|
1070 | on_activate => sub { |
|
|
1071 | $::BIND_EDITOR->set_binding ( |
|
|
1072 | $mod, $sym, $::CFG->{bindings}->{$mod}->{$sym}, |
|
|
1073 | sub { |
|
|
1074 | my ($nmod, $nsym, $ncmds) = @_; |
|
|
1075 | delete $::CFG->{bindings}->{$mod}->{$sym}; |
|
|
1076 | $::CFG->{bindings}->{$nmod}->{$nsym} = $ncmds; |
|
|
1077 | $refresh->(); |
|
|
1078 | $::BIND_WINDOW->show; |
|
|
1079 | }, |
|
|
1080 | sub { |
|
|
1081 | $::BIND_WINDOW->show; |
|
|
1082 | }); |
|
|
1083 | $::BIND_EDITOR->show; |
|
|
1084 | $::BIND_WINDOW->hide; |
|
|
1085 | }); |
|
|
1086 | |
972 | $hb->add (new CFClient::UI::Label text => "($nam)"); |
1087 | $hb->add (new CFClient::UI::Label text => "(Key: $nam)"); |
973 | $hb->add (new CFClient::UI::Label text => $lbl, expand => 1); |
1088 | $hb->add (new CFClient::UI::Label text => $lbl, expand => 1); |
974 | } |
1089 | } |
975 | } |
1090 | } |
976 | }; |
1091 | }; |
977 | |
1092 | |
… | |
… | |
984 | on_visibility_change => sub { |
1099 | on_visibility_change => sub { |
985 | my ($self, $visible) = @_; |
1100 | my ($self, $visible) = @_; |
986 | $refresh->() if $visible; |
1101 | $refresh->() if $visible; |
987 | }; |
1102 | }; |
988 | |
1103 | |
|
|
1104 | $BIND_WINDOW->add (my $vb = new CFClient::UI::VBox); |
989 | $BIND_WINDOW->add ($binding_list); |
1105 | $vb->add ($binding_list); |
|
|
1106 | $vb->add (my $hb = new CFClient::UI::HBox); |
|
|
1107 | $hb->add (new CFClient::UI::Button |
|
|
1108 | text => "record new", |
|
|
1109 | expand => 1, |
|
|
1110 | tooltip => "This button opens the binding editor with an empty binding.", |
|
|
1111 | on_activate => sub { |
|
|
1112 | $::BIND_EDITOR->set_binding (undef, undef, [], |
|
|
1113 | sub { |
|
|
1114 | my ($mod, $sym, $cmds) = @_; |
|
|
1115 | $::CFG->{bindings}->{$mod}->{$sym} = $cmds; |
|
|
1116 | $refresh->(); |
|
|
1117 | $::BIND_WINDOW->show; |
|
|
1118 | }, |
|
|
1119 | sub { |
|
|
1120 | $::BIND_WINDOW->show; |
|
|
1121 | }); |
|
|
1122 | $::BIND_WINDOW->hide; |
|
|
1123 | $::BIND_EDITOR->show; |
|
|
1124 | }, |
|
|
1125 | ); |
|
|
1126 | $hb->add (new CFClient::UI::Button |
|
|
1127 | text => "close", |
|
|
1128 | tooltip => "Closes the binding window", |
|
|
1129 | expand => 1, |
|
|
1130 | on_activate => sub { |
|
|
1131 | $::BIND_WINDOW->hide; |
|
|
1132 | } |
|
|
1133 | ); |
|
|
1134 | |
990 | $refresh->(); |
1135 | $refresh->(); |
991 | $BIND_WINDOW |
1136 | $BIND_WINDOW |
992 | } |
1137 | } |
993 | |
1138 | |
994 | sub make_help_window { |
1139 | sub make_help_window { |
995 | my $win = new CFClient::UI::FancyFrame |
1140 | my $win = new CFClient::UI::FancyFrame |
|
|
1141 | x => 'center', |
|
|
1142 | y => 'center', |
|
|
1143 | name => 'doc_browser', |
996 | def_w => int $WIDTH * 7/8, |
1144 | force_w => int $WIDTH * 7/8, |
997 | def_h => int $HEIGHT * 7/8, |
1145 | force_h => int $HEIGHT * 7/8, |
998 | title => "Documentation"; |
1146 | title => "Documentation"; |
999 | |
1147 | |
1000 | $win->add (my $vbox = new CFClient::UI::VBox); |
1148 | $win->add (my $vbox = new CFClient::UI::VBox); |
1001 | |
1149 | |
1002 | $vbox->add (my $buttons = new CFClient::UI::HBox); |
1150 | $vbox->add (my $buttons = new CFClient::UI::HBox); |
1003 | $vbox->add (my $viewer = new CFClient::UI::TextView expand => 1, fontsize => 0.8); |
1151 | $vbox->add (my $viewer = new CFClient::UI::TextView expand => 1, fontsize => 0.8); |
… | |
… | |
1070 | padding => 0, |
1218 | padding => 0, |
1071 | z => 100, |
1219 | z => 100, |
1072 | force_x => "max", |
1220 | force_x => "max", |
1073 | force_y => 0; |
1221 | force_y => 0; |
1074 | $DEBUG_STATUS->show; |
1222 | $DEBUG_STATUS->show; |
1075 | |
1223 | |
|
|
1224 | $BIND_EDITOR = new CFClient::UI::BindEditor (x => "max", y => 0); |
|
|
1225 | |
1076 | $STATUSBOX = new CFClient::UI::Statusbox; |
1226 | $STATUSBOX = new CFClient::UI::Statusbox; |
1077 | $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", pri => -100, color => [1, 1, 1, 0.8]); |
1227 | $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", pri => -100, color => [1, 1, 1, 0.8]); |
1078 | |
1228 | |
1079 | (new CFClient::UI::Frame |
1229 | (new CFClient::UI::Frame |
1080 | bg => [0, 0, 0, 0.4], |
1230 | bg => [0, 0, 0, 0.4], |
… | |
… | |
1082 | force_y => "max", |
1232 | force_y => "max", |
1083 | child => $STATUSBOX, |
1233 | child => $STATUSBOX, |
1084 | )->show; |
1234 | )->show; |
1085 | |
1235 | |
1086 | CFClient::UI::FancyFrame->new ( |
1236 | CFClient::UI::FancyFrame->new ( |
|
|
1237 | title => "Map", |
|
|
1238 | name => "mapmap", |
1087 | x => 0, |
1239 | x => 0, |
1088 | y => $FONTSIZE + 8, |
1240 | y => $FONTSIZE + 8, |
1089 | border_bg => [1, 1, 1, 192/255], |
1241 | border_bg => [1, 1, 1, 192/255], |
1090 | bg => [1, 1, 1, 0], |
1242 | bg => [1, 1, 1, 0], |
1091 | child => ($MAPMAP = new CFClient::MapWidget::MapMap |
1243 | child => ($MAPMAP = new CFClient::MapWidget::MapMap |
… | |
… | |
1130 | make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D |
1282 | make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D |
1131 | |
1283 | |
1132 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window, |
1284 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window, |
1133 | tooltip => "Toggles the statistics window, where all your Stats and Resistances are being displayed at all times."); |
1285 | tooltip => "Toggles the statistics window, where all your Stats and Resistances are being displayed at all times."); |
1134 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window, |
1286 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window, |
1135 | tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :)."); |
1287 | tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :)." |
|
|
1288 | ."You can also hit the Tab-key to show/hide the Inventory."); |
1136 | |
1289 | |
1137 | $BUTTONBAR->add (new CFClient::UI::Button |
1290 | $BUTTONBAR->add (new CFClient::UI::Button |
1138 | text => "Save Config", |
1291 | text => "Save Config", |
1139 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1292 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1140 | on_activate => sub { |
1293 | on_activate => sub { |
… | |
… | |
1148 | tooltip => "View Documentation"); |
1301 | tooltip => "View Documentation"); |
1149 | |
1302 | |
1150 | $BUTTONBAR->add (new CFClient::UI::Flopper |
1303 | $BUTTONBAR->add (new CFClient::UI::Flopper |
1151 | text => "Bindings", |
1304 | text => "Bindings", |
1152 | other => make_binding_window, |
1305 | other => make_binding_window, |
1153 | tooltip => "Lets you delete bindings you have made with the recorder" |
1306 | tooltip => |
1154 | ); |
1307 | "Lets you define, edit and delete bindings." |
1155 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "[Rec]", other => CFClient::Recorder::make_window, |
1308 | ."There is a shortcut for making bindings: LCTRL+Insert opens the binding editor " |
1156 | tooltip => "This feature lets you record a series of actions (eg. walking a path or ready a skill) and bind them to keys"); |
1309 | ."with nothing set and the recording started. After doing the actions you " |
|
|
1310 | ."want to record press Insert and you will be asked to press a key-combo." |
|
|
1311 | ."After pressing the combo the binding will be saved automatically and the " |
|
|
1312 | ."binding editor closes"); |
|
|
1313 | |
|
|
1314 | $BUTTONBAR->add (new CFClient::UI::Flopper |
|
|
1315 | text => "Spells", |
|
|
1316 | other => make_spell_list, |
|
|
1317 | tooltip => "The spell list"); |
|
|
1318 | |
|
|
1319 | $BUTTONBAR->add (new CFClient::UI::Flopper |
|
|
1320 | text => "Pickup", |
|
|
1321 | other => make_pickup_cfg_window, |
|
|
1322 | tooltip => "The pickup dialog"); |
|
|
1323 | |
1157 | |
1324 | |
1158 | $BUTTONBAR->add (new CFClient::UI::Button |
1325 | $BUTTONBAR->add (new CFClient::UI::Button |
1159 | text => "Quit", |
1326 | text => "Quit", |
1160 | tooltip => "Terminates the program", |
1327 | tooltip => "Terminates the program", |
1161 | on_activate => sub { |
1328 | on_activate => sub { |
… | |
… | |
1246 | |
1413 | |
1247 | my %demo;#d# |
1414 | my %demo;#d# |
1248 | |
1415 | |
1249 | sub force_refresh { |
1416 | sub force_refresh { |
1250 | $fps = $fps * 0.95 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.05; |
1417 | $fps = $fps * 0.95 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.05; |
1251 | debug sprintf "%3.2f", $fps; |
1418 | debug sprintf "%3.2f", $fps if $ENV{CFPLUS_DEBUG} & 4; |
1252 | |
1419 | |
1253 | $CFClient::UI::ROOT->draw; |
1420 | $CFClient::UI::ROOT->draw; |
1254 | |
1421 | |
1255 | $WANT_REFRESH = 0; |
1422 | $WANT_REFRESH = 0; |
1256 | $CAN_REFRESH = 0; |
1423 | $CAN_REFRESH = 0; |
… | |
… | |
1489 | =head1 USAGE |
1656 | =head1 USAGE |
1490 | |
1657 | |
1491 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used |
1658 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used |
1492 | fullscreen and interactively. |
1659 | fullscreen and interactively. |
1493 | |
1660 | |
|
|
1661 | =head1 DEBUGGING |
|
|
1662 | |
|
|
1663 | |
|
|
1664 | CFPLUS_DEBUG - environment variable |
|
|
1665 | |
|
|
1666 | 1 draw borders around widgets |
|
|
1667 | 2 add low-level widget info to tooltips |
|
|
1668 | 4 show fps |
|
|
1669 | 8 suppress tooltips |
|
|
1670 | |
1494 | =head1 AUTHOR |
1671 | =head1 AUTHOR |
1495 | |
1672 | |
1496 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1673 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1497 | |
1674 | |
1498 | |
1675 | |