… | |
… | |
32 | Win32::GUI::SplashScreen::Done (1); |
32 | Win32::GUI::SplashScreen::Done (1); |
33 | }; |
33 | }; |
34 | } |
34 | } |
35 | } |
35 | } |
36 | |
36 | |
37 | use strict; |
37 | use common::sense; |
38 | use utf8; |
|
|
39 | |
38 | |
40 | use Carp 'verbose'; |
39 | use Carp 'verbose'; |
41 | |
40 | |
42 | # do things only needed for single-binary version (par) |
41 | # do things only needed for single-binary version (par) |
43 | BEGIN { |
42 | BEGIN { |
… | |
… | |
807 | user => $PROFILE->{user}, |
806 | user => $PROFILE->{user}, |
808 | pass => $PROFILE->{password}, |
807 | pass => $PROFILE->{password}, |
809 | mapw => $mapw, |
808 | mapw => $mapw, |
810 | maph => $maph, |
809 | maph => $maph, |
811 | |
810 | |
|
|
811 | client => "deliantra", |
812 | client => "$DC::VERSION $] $^O", |
812 | clientversion => $DC::VERSION, |
813 | |
813 | |
814 | map_widget => $MAPWIDGET, |
814 | map_widget => $MAPWIDGET, |
815 | statusbox => $STATUSBOX, |
815 | statusbox => $STATUSBOX, |
816 | map => $MAP, |
816 | map => $MAP, |
817 | mapmap => $MAPMAP, |
817 | mapmap => $MAPMAP, |
… | |
… | |
1942 | $r |
1942 | $r |
1943 | } |
1943 | } |
1944 | |
1944 | |
1945 | my %SORT_ORDER = ( |
1945 | my %SORT_ORDER = ( |
1946 | type => sub { |
1946 | type => sub { |
|
|
1947 | use sort 'stable'; |
1947 | sort { $a->{type} <=> $b->{type} or $a->{name} cmp $b->{name} } @_ |
1948 | sort { $a->{type} <=> $b->{type} or $a->{name} cmp $b->{name} } @_ |
1948 | }, |
1949 | }, |
1949 | mtime => sub { |
1950 | mtime => sub { |
|
|
1951 | use sort 'stable'; |
1950 | my $NOW = time; |
1952 | my $NOW = time; |
1951 | sort { |
1953 | sort { |
1952 | my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; |
1954 | my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; |
1953 | my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; |
1955 | my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; |
1954 | |
1956 | |
1955 | ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) |
1957 | ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) |
1956 | or $btime <=> $atime |
1958 | or $btime <=> $atime |
1957 | or $a->{type} <=> $b->{type} |
1959 | or $a->{type} <=> $b->{type} |
1958 | } @_ |
1960 | } @_ |
1959 | }, |
1961 | }, |
1960 | weight => sub { sort { |
1962 | weight => sub { |
|
|
1963 | use sort 'stable'; |
|
|
1964 | sort { |
1961 | $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) |
1965 | $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) |
1962 | or $a->{type} <=> $b->{type} |
1966 | or $a->{type} <=> $b->{type} |
1963 | } @_ }, |
1967 | } @_ |
|
|
1968 | }, |
1964 | ); |
1969 | ); |
1965 | |
1970 | |
1966 | sub inventory_widget { |
1971 | sub inventory_widget { |
1967 | my $hb = new DC::UI::HBox homogeneous => 1; |
1972 | my $hb = new DC::UI::HBox homogeneous => 1; |
1968 | |
1973 | |
… | |
… | |
2786 | my @args = @ARGV; |
2791 | my @args = @ARGV; |
2787 | |
2792 | |
2788 | my $profile = 'default'; |
2793 | my $profile = 'default'; |
2789 | |
2794 | |
2790 | for (my $i = 0; $i < @args; $i++) { |
2795 | for (my $i = 0; $i < @args; $i++) { |
2791 | if ($args[$i] eq '-profile') { |
2796 | if ($args[$i] =~ /^--?profile$/) { |
2792 | $profile = $args[$i + 1]; |
2797 | $profile = $args[$i + 1]; |
2793 | splice @args, $i, 2, (); |
2798 | splice @args, $i, 2, (); |
2794 | $i = 0; |
2799 | $i = 0; |
|
|
2800 | } elsif ($args[$i] =~ /^--?h/) { |
|
|
2801 | print STDERR "Usage: $0 [--profile name] [host [user [password]]]\n"; |
|
|
2802 | exit 0; |
2795 | } |
2803 | } |
2796 | } |
2804 | } |
2797 | |
2805 | |
2798 | $CFG->{profile}{$profile} ||= {}; |
2806 | $CFG->{profile}{$profile} ||= {}; |
2799 | $PROFILE = $CFG->{profile}{$profile}; |
2807 | $PROFILE = $CFG->{profile}{$profile}; |
… | |
… | |
2886 | |
2894 | |
2887 | deliantra - A Deliantra MORPG game client |
2895 | deliantra - A Deliantra MORPG game client |
2888 | |
2896 | |
2889 | =head1 SYNOPSIS |
2897 | =head1 SYNOPSIS |
2890 | |
2898 | |
2891 | Just run it - no commandline arguments are supported. |
2899 | deliantra [--profile name] [host [user [password]]] |
|
|
2900 | deliantra --help |
2892 | |
2901 | |
2893 | =head1 USAGE |
2902 | =head1 USAGE |
2894 | |
2903 | |
2895 | deliantra utilises OpenGL for all UI elements and the game. It is supposed to |
2904 | The deliantra client utilises OpenGL for all UI elements and the game. It |
2896 | be used in fullscreen mode and interactively. |
2905 | is supposed to be used in fullscreen mode and interactively. |
2897 | |
2906 | |
2898 | =head1 DEBUGGING |
2907 | =head1 DEBUGGING |
2899 | |
|
|
2900 | |
2908 | |
2901 | CFPLUS_DEBUG - environment variable |
2909 | CFPLUS_DEBUG - environment variable |
2902 | |
2910 | |
2903 | 1 draw borders around widgets |
2911 | 1 draw borders around widgets |
2904 | 2 add low-level widget info to tooltips |
2912 | 2 add low-level widget info to tooltips |