… | |
… | |
1673 | child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), |
1673 | child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), |
1674 | ); |
1674 | ); |
1675 | |
1675 | |
1676 | $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username"); |
1676 | $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username"); |
1677 | $table->add_at (1, 4, new DC::UI::Entry |
1677 | $table->add_at (1, 4, new DC::UI::Entry |
1678 | text => $CFG->{profile}{default}{user}, |
1678 | text => $PROFILE->{user}, |
1679 | tooltip => "The name of your character on the server. The name is case-sensitive!", |
1679 | tooltip => "The name of your character on the server. The name is case-sensitive!", |
1680 | on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 } |
1680 | on_changed => sub { my ($self, $value) = @_; $PROFILE->{user} = $value; 1 } |
1681 | ); |
1681 | ); |
1682 | |
1682 | |
1683 | $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password"); |
1683 | $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password"); |
1684 | $table->add_at (1, 5, new DC::UI::Entry |
1684 | $table->add_at (1, 5, new DC::UI::Entry |
1685 | text => $CFG->{profile}{default}{password}, |
1685 | text => $PROFILE->{password}, |
1686 | hidden => 1, |
1686 | hidden => 1, |
1687 | tooltip => "The password for your character.", |
1687 | tooltip => "The password for your character.", |
1688 | on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{password} = $value; 1 } |
1688 | on_changed => sub { my ($self, $value) = @_; $PROFILE->{password} = $value; 1 } |
1689 | ); |
1689 | ); |
1690 | |
1690 | |
1691 | $table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button |
1691 | $table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button |
1692 | expand => 1, |
1692 | expand => 1, |
1693 | text => "Login / Register", |
1693 | text => "Login / Register", |
… | |
… | |
1729 | $table->add_at (1, $row, my $vbox = new DC::UI::VBox); |
1729 | $table->add_at (1, $row, my $vbox = new DC::UI::VBox); |
1730 | |
1730 | |
1731 | $vbox->add ( |
1731 | $vbox->add ( |
1732 | $HOST_ENTRY = new DC::UI::Entry |
1732 | $HOST_ENTRY = new DC::UI::Entry |
1733 | expand => 1, |
1733 | expand => 1, |
1734 | text => $CFG->{profile}{default}{host}, |
1734 | text => $PROFILE->{host}, |
1735 | tooltip => "The hostname or ip address of the Deliantra server to connect to (e.g. <b>gameserver.deliantra.net</b>)", |
1735 | tooltip => "The hostname or ip address of the Deliantra server to connect to (e.g. <b>gameserver.deliantra.net</b>)", |
1736 | on_changed => sub { |
1736 | on_changed => sub { |
1737 | my ($self, $value) = @_; |
1737 | my ($self, $value) = @_; |
1738 | $CFG->{profile}{default}{host} = $value; |
1738 | $PROFILE->{host} = $value; |
1739 | 1 |
1739 | 1 |
1740 | } |
1740 | } |
1741 | ); |
1741 | ); |
1742 | |
1742 | |
1743 | if (0) { #d# disabled |
1743 | if (0) { #d# disabled |
… | |
… | |
2781 | |
2781 | |
2782 | while (my ($k, $v) = each %DEF_CFG) { |
2782 | while (my ($k, $v) = each %DEF_CFG) { |
2783 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2783 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2784 | } |
2784 | } |
2785 | |
2785 | |
2786 | $CFG->{profile}{default}{host} ||= "gameserver.deliantra.net"; |
2786 | my @args = @ARGV; |
|
|
2787 | |
|
|
2788 | my $profile = 'default'; |
|
|
2789 | |
|
|
2790 | for (my $i = 0; $i < @args; $i++) { |
|
|
2791 | if ($args[$i] =~ /^--?profile$/) { |
|
|
2792 | $profile = $args[$i + 1]; |
|
|
2793 | splice @args, $i, 2, (); |
|
|
2794 | $i = 0; |
|
|
2795 | } elsif ($args[$i] =~ /^--?h/) { |
|
|
2796 | print STDERR "Usage: $0 [--profile name] [host [user [password]]]\n"; |
|
|
2797 | exit 0; |
|
|
2798 | } |
|
|
2799 | } |
|
|
2800 | |
|
|
2801 | $CFG->{profile}{$profile} ||= {}; |
2787 | $PROFILE = $CFG->{profile}{default}; |
2802 | $PROFILE = $CFG->{profile}{$profile}; |
|
|
2803 | $PROFILE->{host} ||= "gameserver.deliantra.net"; |
2788 | |
2804 | |
2789 | $PROFILE->{host} = $ARGV[0] if @ARGV > 0; |
2805 | $PROFILE->{host} = $args[0] if @args > 0; |
2790 | $PROFILE->{user} = $ARGV[1] if @ARGV > 1; |
2806 | $PROFILE->{user} = $args[1] if @args > 1; |
2791 | $PROFILE->{password} = $ARGV[2] if @ARGV > 2; |
2807 | $PROFILE->{password} = $args[2] if @args > 2; |
2792 | |
2808 | |
2793 | # convert old bindings (only default profile matters) |
2809 | # convert old bindings (only default profile matters) |
2794 | if (my $bindings = delete $PROFILE->{bindings}) { |
2810 | if (my $bindings = delete $PROFILE->{bindings}) { |
2795 | while (my ($mod, $syms) = each %$bindings) { |
2811 | while (my ($mod, $syms) = each %$bindings) { |
2796 | while (my ($sym, $cmds) = each %$syms) { |
2812 | while (my ($sym, $cmds) = each %$syms) { |
… | |
… | |
2873 | |
2889 | |
2874 | deliantra - A Deliantra MORPG game client |
2890 | deliantra - A Deliantra MORPG game client |
2875 | |
2891 | |
2876 | =head1 SYNOPSIS |
2892 | =head1 SYNOPSIS |
2877 | |
2893 | |
2878 | Just run it - no commandline arguments are supported. |
2894 | deliantra [--profile name] [host [user [password]]] |
|
|
2895 | deliantra --help |
2879 | |
2896 | |
2880 | =head1 USAGE |
2897 | =head1 USAGE |
2881 | |
2898 | |
2882 | deliantra utilises OpenGL for all UI elements and the game. It is supposed to |
2899 | The deliantra client utilises OpenGL for all UI elements and the game. It |
2883 | be used in fullscreen mode and interactively. |
2900 | is supposed to be used in fullscreen mode and interactively. |
2884 | |
2901 | |
2885 | =head1 DEBUGGING |
2902 | =head1 DEBUGGING |
2886 | |
|
|
2887 | |
2903 | |
2888 | CFPLUS_DEBUG - environment variable |
2904 | CFPLUS_DEBUG - environment variable |
2889 | |
2905 | |
2890 | 1 draw borders around widgets |
2906 | 1 draw borders around widgets |
2891 | 2 add low-level widget info to tooltips |
2907 | 2 add low-level widget info to tooltips |