… | |
… | |
17 | use Carp (); |
17 | use Carp (); |
18 | |
18 | |
19 | our $VERSION; |
19 | our $VERSION; |
20 | |
20 | |
21 | BEGIN { |
21 | BEGIN { |
22 | $VERSION = '2.02'; |
22 | $VERSION = '2.04'; |
23 | |
23 | |
24 | use XSLoader; |
24 | use XSLoader; |
25 | XSLoader::load "Deliantra::Client", $VERSION; |
25 | XSLoader::load "Deliantra::Client", $VERSION; |
26 | } |
26 | } |
27 | |
27 | |
… | |
… | |
141 | sub find_rcfile($) { |
141 | sub find_rcfile($) { |
142 | my $path; |
142 | my $path; |
143 | |
143 | |
144 | for (@RC_PATH, "") { |
144 | for (@RC_PATH, "") { |
145 | $path = "$RC_BASE/$_/$_[0]"; |
145 | $path = "$RC_BASE/$_/$_[0]"; |
146 | return $path if -r $path; |
146 | return $path if -e $path; |
147 | } |
147 | } |
148 | |
148 | |
149 | die "FATAL: can't find required file \"$_[0]\" in \"$RC_BASE\"\n"; |
149 | die "FATAL: can't find required file \"$_[0]\" in \"$RC_BASE\"\n"; |
150 | } |
150 | } |
151 | |
151 | |
… | |
… | |
154 | |
154 | |
155 | open my $fh, $file |
155 | open my $fh, $file |
156 | or return; |
156 | or return; |
157 | |
157 | |
158 | local $/; |
158 | local $/; |
159 | JSON::XS->new->utf8->relaxed->decode (<$fh>) |
159 | eval { JSON::XS->new->utf8->relaxed->decode (<$fh>) } |
160 | } |
160 | } |
161 | |
161 | |
162 | sub set_theme($) { |
162 | sub set_theme($) { |
163 | return if $RC_THEME eq $_[0]; |
163 | return if $RC_THEME eq $_[0]; |
164 | $RC_THEME = $_[0]; |
164 | $RC_THEME = $_[0]; |