… | |
… | |
425 | |
425 | |
426 | $win |
426 | $win |
427 | } |
427 | } |
428 | |
428 | |
429 | sub make_stats_window { |
429 | sub make_stats_window { |
430 | my $tgw = new CFClient::UI::FancyFrame x => $WIDTH * 2/5, y => 0, title => "Stats"; |
430 | my $tgw = new CFClient::UI::FancyFrame title => "Stats"; |
431 | |
431 | |
432 | $tgw->add (new CFClient::UI::Window child => my $vb = new CFClient::UI::VBox); |
432 | $tgw->add (new CFClient::UI::Window child => my $vb = new CFClient::UI::VBox); |
433 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
433 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
434 | can_hover => 1, can_events => 1, |
434 | can_hover => 1, can_events => 1, |
435 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
435 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
… | |
… | |
438 | tooltip => "The map you are currently on (if supported by the server)."); |
438 | tooltip => "The map you are currently on (if supported by the server)."); |
439 | |
439 | |
440 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
440 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
441 | $hb->add (my $tbl = new CFClient::UI::Table expand => 1); |
441 | $hb->add (my $tbl = new CFClient::UI::Table expand => 1); |
442 | |
442 | |
443 | my $black = [0, 0, 0]; |
443 | my $color2 = [1, 1, 0]; |
444 | |
444 | |
445 | for ( |
445 | for ( |
446 | [0, 0, st_str => "Str", 30, "<b>Physical Strength</b>, determines damage dealt with weapons, how much you can carry, and how often you can attack"], |
446 | [0, 0, st_str => "Str", 30, "<b>Physical Strength</b>, determines damage dealt with weapons, how much you can carry, and how often you can attack"], |
447 | [0, 1, st_dex => "Dex", 30, "<b>Dexterity</b>, your physical agility. Determines chance of being hit and affects armor class and speed"], |
447 | [0, 1, st_dex => "Dex", 30, "<b>Dexterity</b>, your physical agility. Determines chance of being hit and affects armor class and speed"], |
448 | [0, 2, st_con => "Con", 30, "<b>Constitution</b>, physical health and toughness. Determines how many healthpoints you can have"], |
448 | [0, 2, st_con => "Con", 30, "<b>Constitution</b>, physical health and toughness. Determines how many healthpoints you can have"], |
… | |
… | |
461 | my ($col, $row, $id, $label, $template, $tooltip) = @$_; |
461 | my ($col, $row, $id, $label, $template, $tooltip) = @$_; |
462 | |
462 | |
463 | $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label |
463 | $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label |
464 | font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, align => +1, template => $template, tooltip => $tooltip); |
464 | font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, align => +1, template => $template, tooltip => $tooltip); |
465 | $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label |
465 | $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label |
466 | font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $black, valign => 0, align => -1, text => $label, tooltip => $tooltip); |
466 | font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0, align => -1, text => $label, tooltip => $tooltip); |
467 | } |
467 | } |
468 | |
468 | |
469 | $hb->add (my $tbl2 = new CFClient::UI::Table expand => 1); |
469 | $hb->add (my $tbl2 = new CFClient::UI::Table expand => 1); |
470 | |
470 | |
471 | my $row = 0; |
471 | my $row = 0; |
… | |
… | |
884 | $vb2->add ($INVR = new CFClient::UI::Inventory expand => 1); |
884 | $vb2->add ($INVR = new CFClient::UI::Inventory expand => 1); |
885 | |
885 | |
886 | $invwin |
886 | $invwin |
887 | } |
887 | } |
888 | |
888 | |
|
|
889 | sub make_help_window { |
|
|
890 | my $win = new CFClient::UI::FancyFrame |
|
|
891 | user_w => $WIDTH * (7/8), user_h => $HEIGHT * (7/8), title => "Documentation"; |
|
|
892 | |
|
|
893 | $win->add (my $vbox = new CFClient::UI::VBox); |
|
|
894 | |
|
|
895 | $vbox->add (my $buttons = new CFClient::UI::HBox); |
|
|
896 | $vbox->add (my $viewer = new CFClient::UI::TextView expand => 1, fontsize => 0.8); |
|
|
897 | |
|
|
898 | for ( |
|
|
899 | [intro => "Introduction"], |
|
|
900 | [command_help => "Commands"], |
|
|
901 | [skill_help => "Skills"], |
|
|
902 | ) { |
|
|
903 | my ($pod, $label) = @$_; |
|
|
904 | |
|
|
905 | $buttons->add (new CFClient::UI::Button |
|
|
906 | text => $label, |
|
|
907 | connect_activate => sub { |
|
|
908 | my $parser = new Pod::POM; |
|
|
909 | my $pom = $parser->parse_file (CFClient::find_rcfile "pod/$pod.pod"); |
|
|
910 | |
|
|
911 | $viewer->clear; |
|
|
912 | |
|
|
913 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
|
|
914 | for @{ CFClient::pod_to_pango_list $pom }; |
|
|
915 | }, |
|
|
916 | ); |
|
|
917 | } |
|
|
918 | |
|
|
919 | $viewer->add_paragraph ([1, 1, 0, 1], "<big>Use one of the buttons above to display a document.</big>"); |
|
|
920 | |
|
|
921 | $win |
|
|
922 | } |
|
|
923 | |
889 | sub sdl_init { |
924 | sub sdl_init { |
890 | CFClient::SDL_Init |
925 | CFClient::SDL_Init |
891 | and die "SDL::Init failed!\n"; |
926 | and die "SDL::Init failed!\n"; |
892 | } |
927 | } |
893 | |
928 | |
… | |
… | |
985 | CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; |
1020 | CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; |
986 | status "Configuration Saved"; |
1021 | status "Configuration Saved"; |
987 | }, |
1022 | }, |
988 | ); |
1023 | ); |
989 | |
1024 | |
|
|
1025 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => make_help_window, |
|
|
1026 | tooltip => "View Documentation"); |
|
|
1027 | |
990 | $BUTTONBAR->add (new CFClient::UI::Button |
1028 | $BUTTONBAR->add (new CFClient::UI::Button |
991 | text => "Quit", |
1029 | text => "Quit", |
992 | tooltip => "Terminates the program", |
1030 | tooltip => "Terminates the program", |
993 | connect_activate => sub { |
1031 | connect_activate => sub { |
994 | if ($CONN) { |
1032 | if ($CONN) { |
995 | open_quit_dialog |
1033 | open_quit_dialog; |
996 | } else { |
1034 | } else { |
997 | exit 1 |
1035 | exit; |
998 | } |
1036 | } |
999 | }, |
1037 | }, |
1000 | ); |
1038 | ); |
1001 | |
1039 | |
1002 | $BUTTONBAR->show; |
1040 | $BUTTONBAR->show; |
… | |
… | |
1642 | return unless $CONN; |
1680 | return unless $CONN; |
1643 | |
1681 | |
1644 | $FLOORBOX->clear; |
1682 | $FLOORBOX->clear; |
1645 | $FLOORBOX->add (new CFClient::UI::Empty expand => 1); |
1683 | $FLOORBOX->add (new CFClient::UI::Empty expand => 1); |
1646 | |
1684 | |
1647 | my $count = 4; |
1685 | my $count = 7; |
1648 | for (@{ $CONN->{container}{0} }) { |
1686 | for (@{ $CONN->{container}{0} }) { |
1649 | if (--$count) { |
1687 | if (--$count) { |
1650 | $FLOORBOX->add (new CFClient::UI::InventoryItem item => $_); |
1688 | $FLOORBOX->add (new CFClient::UI::InventoryItem item => $_); |
1651 | } else { |
1689 | } else { |
1652 | $FLOORBOX->add (new CFClient::UI::Label text => "More..."); |
1690 | $FLOORBOX->add (new CFClient::UI::Label text => "More..."); |
… | |
… | |
1876 | |
1914 | |
1877 | Event::loop; |
1915 | Event::loop; |
1878 | |
1916 | |
1879 | END { CFClient::SDL_Quit } |
1917 | END { CFClient::SDL_Quit } |
1880 | |
1918 | |
|
|
1919 | =head1 NAME |
|
|
1920 | |
1881 | =head1 pclient - Crossfire+ and Crossfire game client |
1921 | pclient - A Crossfire+ and Crossfire game client |
1882 | |
1922 | |
1883 | Pclient is a Crossfire+ and Crossfire game client. |
1923 | =head1 SYNOPSIS |
1884 | |
1924 | |
1885 | =head2 Features |
1925 | Just run it - no commandline arguments are supported. |
1886 | |
|
|
1887 | =over 4 |
|
|
1888 | |
|
|
1889 | =item Fullscreen Map |
|
|
1890 | |
|
|
1891 | PClient can uses a fullscreen map, which greatly enhances how much of the |
|
|
1892 | game world you can see. |
|
|
1893 | |
|
|
1894 | =item Persistent Map Cache (Crossfire+ only) |
|
|
1895 | |
|
|
1896 | PClient can persistently cache all map data it received from the |
|
|
1897 | server. This not only allows it to display an overview map, but also |
|
|
1898 | ensures that once-explored areas will be available the next time you want |
|
|
1899 | to explore more. |
|
|
1900 | |
|
|
1901 | =item Hardware acceleration |
|
|
1902 | |
|
|
1903 | Unlike most Crossfire clients, PClient take advantage of OpenGL hardware |
|
|
1904 | acceleration. Most modern graphics cards have difficulties with 2D |
|
|
1905 | acceleration, while 3D graphics is accelerated well. |
|
|
1906 | |
|
|
1907 | =item No arbitrary limits |
|
|
1908 | |
|
|
1909 | Unlike other Crossfire clients, pclient does not suffer from arbitrary |
|
|
1910 | limits (like a fixed amount of face numbers). There are still limits, but |
|
|
1911 | they are not arbitrarily low :) |
|
|
1912 | |
|
|
1913 | =back |
|
|
1914 | |
1926 | |
1915 | =head1 USAGE |
1927 | =head1 USAGE |
1916 | |
1928 | |
1917 | =head2 The Map |
1929 | Pclient utilises OpenGL for all UI elements and the game. It is supposed to be used |
1918 | |
1930 | fullscreen and interactively. |
1919 | The map is always displayed in the background, behind all other windows and UI elements. |
|
|
1920 | |
|
|
1921 | #TODO# middle-click scrolls |
|
|
1922 | # |
|
|
1923 | # keys: |
|
|
1924 | # |
|
|
1925 | # a apply |
|
|
1926 | # keypad moves, kp_5 applies ranged attack to self |
|
|
1927 | |
|
|
1928 | Starting to type enters the I<completion mode>. In that mode, you can type |
|
|
1929 | abbreviations or commands and have them executed as soon as they match a |
|
|
1930 | valid command. This is best explained by a few examples: |
|
|
1931 | |
|
|
1932 | Typing B<climb> will display a list of commands with I<climb> in their |
|
|
1933 | name, such as I<ready_skill climbing> and I<use_skill climbing>. |
|
|
1934 | |
|
|
1935 | You can abbreviate commands by typing only the first character of every |
|
|
1936 | word (or even characters within the word - the client will try to make |
|
|
1937 | a good guess, as long as the characters are in order). For example, |
|
|
1938 | typing I<iwor> will likely select I<invoke word of recall>, while I<ccfo> |
|
|
1939 | will select I<cast create food>. Likewise, I<rscli> will likely select |
|
|
1940 | I<ready_skill climbing> and I<usl> will give you I<use_skill levitation>. |
|
|
1941 | |
|
|
1942 | You can enter space and other text as arguemnt to the command. For |
|
|
1943 | example, C<cfoo waybread> will expand to C<cast create food waybread>. |
|
|
1944 | |
|
|
1945 | =head2 The map overview |
|
|
1946 | |
|
|
1947 | #TODO# |
|
|
1948 | |
|
|
1949 | =head2 The Status area in the lower right corner |
|
|
1950 | |
|
|
1951 | #TODO# |
|
|
1952 | |
|
|
1953 | =head2 The I<Statistics>/I>Stats> window |
|
|
1954 | |
|
|
1955 | #TODO# |
|
|
1956 | |
|
|
1957 | =head1 FAQ |
|
|
1958 | |
|
|
1959 | =over 4 |
|
|
1960 | |
|
|
1961 | =item The client is very sluggish and slow, what can I do about this? |
|
|
1962 | |
|
|
1963 | Most likely, you don't have accelerated OpenGL support. Try to find a |
|
|
1964 | newer driver, or a driver from your hardware vendor, that features OpenGL |
|
|
1965 | support. |
|
|
1966 | |
|
|
1967 | If this is not an option, the following Setup options reduce the load and |
|
|
1968 | will likely make the client playable with sofwtare rendering (it will |
|
|
1969 | still be slow, though): |
|
|
1970 | |
|
|
1971 | =over 4 |
|
|
1972 | |
|
|
1973 | =item B<Video Mode> should be set as low as possible (e.g. 640x480) |
|
|
1974 | |
|
|
1975 | =item Enable B<Fast & Ugly> mode |
|
|
1976 | |
|
|
1977 | =item Disable B<Fog of War> |
|
|
1978 | |
|
|
1979 | =item Increase B<Map Scale> |
|
|
1980 | |
|
|
1981 | =back |
|
|
1982 | |
|
|
1983 | =back |
|
|
1984 | |
1931 | |
1985 | =head1 AUTHOR |
1932 | =head1 AUTHOR |
1986 | |
1933 | |
1987 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1934 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1988 | |
1935 | |