… | |
… | |
1636 | ); |
1636 | ); |
1637 | |
1637 | |
1638 | $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username"); |
1638 | $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username"); |
1639 | $table->add_at (1, 4, new DC::UI::Entry |
1639 | $table->add_at (1, 4, new DC::UI::Entry |
1640 | text => $CFG->{profile}{default}{user}, |
1640 | text => $CFG->{profile}{default}{user}, |
1641 | tooltip => "The name of your character on the server.", |
1641 | tooltip => "The name of your character on the server. The name is case-sensitive!", |
1642 | on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 } |
1642 | on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 } |
1643 | ); |
1643 | ); |
1644 | |
1644 | |
1645 | $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password"); |
1645 | $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password"); |
1646 | $table->add_at (1, 5, new DC::UI::Entry |
1646 | $table->add_at (1, 5, new DC::UI::Entry |
… | |
… | |
1809 | col_expand => [0, 1, 0, 1], |
1809 | col_expand => [0, 1, 0, 1], |
1810 | ); |
1810 | ); |
1811 | |
1811 | |
1812 | for ( |
1812 | for ( |
1813 | ["General", 0, 0, |
1813 | ["General", 0, 0, |
1814 | ["Enable autopickup" => PICKUP_NEWMODE, \$PICKUP_ENABLE], |
|
|
1815 | ["Inhibit autopickup" => PICKUP_INHIBIT], |
1814 | ["Inhibit autopickup" => PICKUP_INHIBIT], |
1816 | ["Stop before pickup" => PICKUP_STOP], |
1815 | ["Stop before pickup" => PICKUP_STOP], |
1817 | ["Debug autopickup" => PICKUP_DEBUG], |
1816 | ["Debug autopickup" => PICKUP_DEBUG], |
1818 | ], |
1817 | ], |
1819 | ["Weapons", 0, 6, |
1818 | ["Weapons", 0, 6, |
… | |
… | |
1868 | $::CFG->{pickup} |= $mask; |
1867 | $::CFG->{pickup} |= $mask; |
1869 | } else { |
1868 | } else { |
1870 | $::CFG->{pickup} &= ~$mask; |
1869 | $::CFG->{pickup} &= ~$mask; |
1871 | } |
1870 | } |
1872 | |
1871 | |
1873 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1872 | $::CONN->send_pickup ($::CFG->{pickup}) |
1874 | if defined $::CONN; |
1873 | if defined $::CONN; |
1875 | |
1874 | |
1876 | 0 |
1875 | 0 |
1877 | }); |
1876 | }); |
1878 | |
1877 | |
… | |
… | |
1895 | }); |
1894 | }); |
1896 | |
1895 | |
1897 | $table->add_at (3, 18, new DC::UI::Button |
1896 | $table->add_at (3, 18, new DC::UI::Button |
1898 | text => "set", |
1897 | text => "set", |
1899 | on_activate => sub { |
1898 | on_activate => sub { |
1900 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1899 | $::CONN->send_pickup ($::CFG->{pickup}) |
1901 | if defined $::CONN; |
1900 | if defined $::CONN; |
1902 | 0 |
1901 | 0 |
1903 | }); |
1902 | }); |
1904 | |
1903 | |
1905 | $r |
1904 | $r |
… | |
… | |
2068 | |
2067 | |
2069 | sub keyboard_setup { |
2068 | sub keyboard_setup { |
2070 | DC::Macro::keyboard_setup |
2069 | DC::Macro::keyboard_setup |
2071 | } |
2070 | } |
2072 | |
2071 | |
2073 | sub help_window { |
2072 | sub make_help_window { |
2074 | my $win = new DC::UI::Toplevel |
2073 | my $win = new DC::UI::Toplevel |
2075 | x => 'center', |
2074 | x => 'center', |
2076 | y => 'center', |
2075 | y => 'center', |
2077 | z => 4, |
2076 | z => 4, |
2078 | name => 'doc_browser', |
2077 | name => 'doc_browser', |
… | |
… | |
2167 | |
2166 | |
2168 | $load_node->((DC::Pod::find @path)[0]); |
2167 | $load_node->((DC::Pod::find @path)[0]); |
2169 | $win->show; |
2168 | $win->show; |
2170 | }; |
2169 | }; |
2171 | |
2170 | |
2172 | $win |
2171 | $HELP_WINDOW = $win; |
2173 | } |
2172 | } |
2174 | |
2173 | |
2175 | sub open_quit_dialog { |
2174 | sub open_quit_dialog { |
2176 | unless ($QUIT_DIALOG) { |
2175 | unless ($QUIT_DIALOG) { |
2177 | $QUIT_DIALOG = new DC::UI::Toplevel |
2176 | $QUIT_DIALOG = new DC::UI::Toplevel |
… | |
… | |
2210 | |
2209 | |
2211 | $QUIT_DIALOG->show; |
2210 | $QUIT_DIALOG->show; |
2212 | $QUIT_DIALOG->grab_focus; |
2211 | $QUIT_DIALOG->grab_focus; |
2213 | } |
2212 | } |
2214 | |
2213 | |
2215 | sub make_menuframe { |
2214 | sub make_menubar { |
2216 | $MENUFRAME = new DC::UI::Toplevel |
2215 | $MENUFRAME = new DC::UI::Toplevel |
2217 | border => 0, |
2216 | border => 0, |
2218 | force_x => 0, |
2217 | force_x => 0, |
2219 | force_y => 0, |
2218 | force_y => 0, |
2220 | force_w => $::WIDTH, |
2219 | force_w => $::WIDTH, |
… | |
… | |
2230 | # tooltip => "Toggles the server message log, where the client collects <i>all</i> messages from the server."); |
2229 | # tooltip => "Toggles the server message log, where the client collects <i>all</i> messages from the server."); |
2231 | |
2230 | |
2232 | make_playerbook; |
2231 | make_playerbook; |
2233 | |
2232 | |
2234 | $MENUPOPUP = DC::UI::Menu->new (items => [ |
2233 | $MENUPOPUP = DC::UI::Menu->new (items => [ |
2235 | ["Setup…" , sub { $SETUP_DIALOG->toggle_visibility}], |
2234 | ["Setup…\tF9" , sub { $SETUP_DIALOG->toggle_visibility }], |
2236 | ["Playerbook…\tTab", sub { $PL_WINDOW ->toggle_visibility}], |
2235 | ["Playerbook…\tTab" , sub { $PL_WINDOW ->toggle_visibility }], |
|
|
2236 | ["…Statistics\tF2" , sub { toggle_player_page ($::STATS_PAGE) }], |
|
|
2237 | ["…Skills\tF3" , sub { toggle_player_page ($::SKILL_PAGE) }], |
|
|
2238 | ["…Spells\tF4" , sub { toggle_player_page ($::SPELL_PAGE) }], |
|
|
2239 | ["…Inventory\tF5" , sub { toggle_player_page ($::INVENTORY_PAGE) }], |
2237 | ["Help Browser…" , sub { $HELP_WINDOW ->toggle_visibility}], |
2240 | ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], |
2238 | ["Quit…" , sub { |
2241 | ["Quit…" , sub { |
2239 | if ($CONN) { |
2242 | if ($CONN) { |
2240 | open_quit_dialog; |
2243 | open_quit_dialog; |
2241 | } else { |
2244 | } else { |
2242 | EV::unloop EV::UNLOOP_ALL; |
2245 | EV::unloop EV::UNLOOP_ALL; |
2243 | } |
2246 | } |
2244 | }], |
2247 | }], |
2245 | ]); |
2248 | ]); |
2246 | |
2249 | |
2247 | $BUTTONBAR->add (new DC::UI::Button text => "Menu…", |
2250 | $BUTTONBAR->add (new DC::UI::Button text => "Menu…", |
2248 | tooltip => "Shows the main menu", |
2251 | tooltip => "Shows the main menu", |
2249 | on_button_down => sub { $MENUPOPUP->popup ($_[1]) }, |
2252 | on_button_down => sub { |
|
|
2253 | my ($self, $ev) = @_; |
|
|
2254 | local $ev->{x} = 0; |
|
|
2255 | local $ev->{y} = 0; |
|
|
2256 | $MENUPOPUP->popup ($ev); |
|
|
2257 | }, |
2250 | ); |
2258 | ); |
2251 | |
2259 | |
2252 | $MENUBAR->add ($GAUGES->{prg} = new DC::UI::ExperienceProgress |
2260 | $MENUBAR->add ($GAUGES->{exp} = new DC::UI::ExperienceProgress |
2253 | c_rescale => 1, |
|
|
2254 | padding_x => 6, |
2261 | padding_x => 6, |
2255 | padding_y => 3, |
2262 | padding_y => 3, |
2256 | force_w => $::WIDTH * 0.1, |
|
|
2257 | tooltip => "This progress bar shows your progress towards the next character level.", |
2263 | tooltip => "This progress bar shows your progress towards the next character level.", |
|
|
2264 | template => " Exp: 8,888,888,888 (lvl 188) ", |
2258 | ); |
2265 | ); |
2259 | $MENUBAR->add ($GAUGES->{exp} = new DC::UI::Label |
2266 | |
2260 | align => 1, can_hover => 1, can_events => 1, |
2267 | $MENUBAR->add ($PICKUP_ENABLE = new DC::UI::CheckBox # checkbox bad, button better? |
2261 | text => "Total Experience", |
2268 | tooltip => "Automatic Pickup Enable - when this checkbox is enabled, then your character " |
2262 | tooltip => "#stat_exp", |
2269 | . "will automatically pick up items as defined by your item pickup settings " |
2263 | fontsize => 0.8, |
2270 | . "in the playerbook. Often (e.g. in apartments) you want to temporarily " |
|
|
2271 | . "disable autopickup by disdabling this checkbox.", |
|
|
2272 | state => $CFG->{pickup} & PICKUP_INHIBIT ? 0 : 1, |
|
|
2273 | on_changed => sub { |
|
|
2274 | my ($self, $value) = @_; |
|
|
2275 | $CFG->{pickup} &= ~PICKUP_INHIBIT; |
|
|
2276 | $CFG->{pickup} |= PICKUP_INHIBIT unless $_[1]; |
|
|
2277 | $CONN->send_pickup ($CFG->{pickup}) |
|
|
2278 | if $CONN; |
|
|
2279 | }, |
2264 | ); |
2280 | ); |
|
|
2281 | |
2265 | $MENUBAR->add ($GAUGES->{sklprg} = new DC::UI::ExperienceProgress |
2282 | $MENUBAR->add ($GAUGES->{skillexp} = new DC::UI::ExperienceProgress |
2266 | c_rescale => 1, |
2283 | c_rescale => 1, |
2267 | padding_x => 6, |
2284 | padding_x => 6, |
2268 | padding_y => 3, |
2285 | padding_y => 3, |
2269 | force_w => $::WIDTH * 0.2, |
2286 | force_w => $::WIDTH * 0.2, |
2270 | tooltip => "This progress bar shows the currently used skill and your progress towards the next skill level of that skill.", |
2287 | tooltip => "This progress bar shows the currently used skill and your progress towards the next skill level of that skill.", |
|
|
2288 | template => "two handed weapons 99%", |
2271 | ); |
2289 | ); |
|
|
2290 | |
2272 | $MENUBAR->add ($GAUGES->{range} = new DC::UI::Label |
2291 | $MENUBAR->add ($GAUGES->{range} = new DC::UI::Label |
2273 | expand => 1, |
2292 | expand => 1, |
2274 | align => 1, can_hover => 1, can_events => 1, |
2293 | align => 1, can_hover => 1, can_events => 1, |
2275 | text => "Range and Combat Slots", |
2294 | text => "Range and Combat Slots", |
2276 | tooltip => "#stat_ranged", |
2295 | tooltip => "#stat_ranged", |
… | |
… | |
2530 | . "After pressing the combo the binding will be saved automatically and the " |
2549 | . "After pressing the combo the binding will be saved automatically and the " |
2531 | . "binding editor closes"); |
2550 | . "binding editor closes"); |
2532 | $SETUP_NOTEBOOK->add_tab (Debug => debug_setup, |
2551 | $SETUP_NOTEBOOK->add_tab (Debug => debug_setup, |
2533 | "Some debuggin' options. Do not ask."); |
2552 | "Some debuggin' options. Do not ask."); |
2534 | |
2553 | |
|
|
2554 | make_help_window; |
2535 | make_menuframe; |
2555 | make_menubar; |
2536 | |
2556 | |
2537 | $SETUP_DIALOG->show; |
2557 | $SETUP_DIALOG->show; |
2538 | $MESSAGE_WINDOW->show; |
2558 | $MESSAGE_WINDOW->show; |
2539 | } |
2559 | } |
2540 | |
2560 | |
… | |
… | |
2706 | effects_enable => 1, |
2726 | effects_enable => 1, |
2707 | effects_volume => 1, |
2727 | effects_volume => 1, |
2708 | bgm_enable => 1, |
2728 | bgm_enable => 1, |
2709 | bgm_volume => 0.5, |
2729 | bgm_volume => 0.5, |
2710 | output_rate => "", |
2730 | output_rate => "", |
2711 | pickup => 0, |
2731 | pickup => PICKUP_SPELLBOOK | PICKUP_SKILLSCROLL | PICKUP_VALUABLES, |
2712 | inv_sort => "mtime", |
2732 | inv_sort => "mtime", |
2713 | default => "profile", # default profile |
2733 | default => "profile", # default profile |
2714 | show_tips => 1, |
2734 | show_tips => 1, |
2715 | logview_max_par => 1000, |
2735 | logview_max_par => 1000, |
2716 | shift_fire_stop => 0, |
2736 | shift_fire_stop => 0, |