--- deliantra/Deliantra-Client/DC.pm 2008/08/19 17:38:29 1.186 +++ deliantra/Deliantra-Client/DC.pm 2008/09/02 16:25:27 1.187 @@ -18,6 +18,8 @@ use Carp (); +our $VERSION; + BEGIN { $VERSION = '0.9975'; @@ -26,6 +28,7 @@ } use utf8; +use strict qw(vars subs); use AnyEvent (); use Pod::POM (); @@ -144,15 +147,24 @@ package DC; +our $RC_THEME = "."; +our $RC_BASE; + +for (grep !ref, @INC) { + $RC_BASE = "$_/Deliantra/Client/private/resources"; + last if -d $RC_BASE; +} + sub find_rcfile($) { my $path; - for (grep !ref, @INC) { - $path = "$_/Deliantra/Client/private/resources/$_[0]"; - return $path if -r $path; - } + $path = "$RC_BASE/$RC_THEME/$_[0]"; + return $path if -r $path; + + $path = "$RC_BASE/$_[0]"; + return $path if -r $path; - die "FATAL: can't find required file $_[0]\n"; + die "FATAL: can't find required file \"$_[0]\" in \"$RC_BASE\"\n"; } sub read_cfg {