--- deliantra/Deliantra-Client/bin/cfplus 2006/06/03 21:59:55 1.51
+++ deliantra/Deliantra-Client/bin/cfplus 2006/06/05 22:30:35 1.59
@@ -27,7 +27,6 @@
if %PAR::LibCache;
use Time::HiRes 'time';
-use Pod::POM;
use Event;
use Crossfire;
@@ -41,6 +40,8 @@
use CFClient::UI;
use CFClient::MapWidget;
+$SIG{QUIT} = sub { Carp::cluck "QUIT" };
+
$Event::DIED = sub {
# TODO: display dialog box or so
Carp::confess $_[1];#d#TODO: remove when stable
@@ -176,9 +177,9 @@
sub stop_game {
$LOGIN_BUTTON->set_text ("Login");
+ $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER);
$SETUP_DIALOG->show;
$INV_WINDOW->hide;
- $LOGVIEW->hide;
return unless $CONN;
@@ -713,6 +714,7 @@
name => 'metaserver_dialog',
x => 'center',
y => 'center',
+ z => 3,
child => (my $vbox = new CFClient::UI::VBox),
on_visibility_change => sub {
update_metaserver if $_[1];
@@ -905,6 +907,7 @@
$QUIT_DIALOG = new CFClient::UI::FancyFrame
x => "center",
y => "center",
+ z => 50,
title => "Really Quit?",
;
@@ -936,41 +939,41 @@
for (
["General", 0, 0,
- ["Enable autopickup" => CFClient::Pickup::PU_NEWMODE],
- ["Inhibit autopickup" => CFClient::Pickup::PU_INHIBIT],
- ["Stop before pickup" => CFClient::Pickup::PU_STOP],
- ["Debug autopickup" => CFClient::Pickup::PU_DEBUG],
+ ["Enable autopickup" => PICKUP_NEWMODE],
+ ["Inhibit autopickup" => PICKUP_INHIBIT],
+ ["Stop before pickup" => PICKUP_STOP],
+ ["Debug autopickup" => PICKUP_DEBUG],
],
["Weapons", 0, 6,
- ["All weapons" => CFClient::Pickup::PU_ALLWEAPON],
- ["Missile weapons" => CFClient::Pickup::PU_MISSILEWEAPON],
- ["Bows" => CFClient::Pickup::PU_BOW],
- ["Arrows" => CFClient::Pickup::PU_ARROW],
+ ["All weapons" => PICKUP_ALLWEAPON],
+ ["Missile weapons" => PICKUP_MISSILEWEAPON],
+ ["Bows" => PICKUP_BOW],
+ ["Arrows" => PICKUP_ARROW],
],
["Armour", 0, 12,
- ["Helmets" => CFClient::Pickup::PU_HELMET],
- ["Shields" => CFClient::Pickup::PU_SHIELD],
- ["Body Armour" => CFClient::Pickup::PU_ARMOUR],
- ["Boots" => CFClient::Pickup::PU_BOOTS],
- ["Gloves" => CFClient::Pickup::PU_GLOVES],
- ["Cloaks" => CFClient::Pickup::PU_CLOAK],
+ ["Helmets" => PICKUP_HELMET],
+ ["Shields" => PICKUP_SHIELD],
+ ["Body Armour" => PICKUP_ARMOUR],
+ ["Boots" => PICKUP_BOOTS],
+ ["Gloves" => PICKUP_GLOVES],
+ ["Cloaks" => PICKUP_CLOAK],
],
["Readables", 2, 2,
- ["Spellbooks" => CFClient::Pickup::PU_SPELLBOOK],
- ["Skillscrolls" => CFClient::Pickup::PU_SKILLSCROLL],
- ["Normal Books/Scrolls" => CFClient::Pickup::PU_READABLES],
+ ["Spellbooks" => PICKUP_SPELLBOOK],
+ ["Skillscrolls" => PICKUP_SKILLSCROLL],
+ ["Normal Books/Scrolls" => PICKUP_READABLES],
],
["Misc", 2, 7,
- ["Food" => CFClient::Pickup::PU_FOOD],
- ["Drinks" => CFClient::Pickup::PU_DRINK],
- ["Valuables (Money, Gems)" => CFClient::Pickup::PU_VALUABLES],
- ["Keys" => CFClient::Pickup::PU_KEY],
- ["Magical Items" => CFClient::Pickup::PU_MAGICAL],
- ["Potions" => CFClient::Pickup::PU_POTION],
- ["Magic Devices" => CFClient::Pickup::PU_MAGIC_DEVICE],
- ["Ignore cursed" => CFClient::Pickup::PU_NOT_CURSED],
- ["Jewelery" => CFClient::Pickup::PU_JEWELS],
+ ["Food" => PICKUP_FOOD],
+ ["Drinks" => PICKUP_DRINK],
+ ["Valuables (Money, Gems)" => PICKUP_VALUABLES],
+ ["Keys" => PICKUP_KEY],
+ ["Magical Items" => PICKUP_MAGICAL],
+ ["Potions" => PICKUP_POTION],
+ ["Magic Devices" => PICKUP_MAGIC_DEVICE],
+ ["Ignore cursed" => PICKUP_NOT_CURSED],
+ ["Jewelery" => PICKUP_JEWELS],
],
)
{
@@ -1102,7 +1105,8 @@
sub {
$SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD);
$SETUP_DIALOG->show;
- });
+ },
+ );
$SETUP_DIALOG->hide;
$::BIND_EDITOR->show;
},
@@ -1126,6 +1130,7 @@
my $win = new CFClient::UI::FancyFrame
x => 'center',
y => 'center',
+ z => 2,
name => 'doc_browser',
force_w => int $WIDTH * 7/8,
force_h => int $HEIGHT * 7/8,
@@ -1147,13 +1152,13 @@
$buttons->add (new CFClient::UI::Button
text => $label,
on_activate => sub {
- my $parser = new Pod::POM;
- my $pom = $parser->parse_file (CFClient::find_rcfile "pod/$pod.pod");
+ my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod",
+ doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] };
$viewer->clear;
$viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0])
- for @{ CFClient::pod_to_pango_list $pom };
+ for @$pom;
$viewer->set_offset (0);
},
@@ -1210,7 +1215,7 @@
$BIND_EDITOR = new CFClient::UI::BindEditor (x => "max", y => 0);
$STATUSBOX = new CFClient::UI::Statusbox;
- $STATUSBOX->add ("Use Alt-Enter to toggle fullscreen mode", pri => -100, color => [1, 1, 1, 0.8]);
+ $STATUSBOX->add ("Use Alt-Enter to toggle fullscreen mode", timeout => 864000, pri => -100, color => [1, 1, 1, 0.8]);
(new CFClient::UI::Frame
bg => [0, 0, 0, 0.4],
@@ -1261,6 +1266,7 @@
name => "setup_dialog",
x => 'center',
y => 'center',
+ z => 2,
force_w => $::WIDTH * 0.6,
force_h => $::HEIGHT * 0.6,
;
@@ -1271,22 +1277,22 @@
$SETUP_NOTEBOOK->add (Server => $SETUP_SERVER = server_setup,
"Configure the server to play on, your username, password and other server-related options.");
$SETUP_NOTEBOOK->add (Pickup => autopickup_setup,
- "Configure autopicking stetings, i.e. which items you will pick up automatically when walking over them.");
+ "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them.");
$SETUP_NOTEBOOK->add (Graphics => graphics_setup,
"Configure the video mode, performance, fonts and other graphical aspects of the game.");
$SETUP_NOTEBOOK->add (Audio => audio_setup,
"Configure the use of audio, sound effects and background music.");
$SETUP_NOTEBOOK->add (Keyboard => $SETUP_KEYBOARD = keyboard_setup,
"Lets you define, edit and delete bindings."
- . "There is a shortcut for making bindings: Left Control + Insert opens the binding editor "
+ . "There is a shortcut for making bindings: Left Control + Insert opens the binding editor "
. "with nothing set and the recording started. After doing the actions you "
- . "want to record press Insert and you will be asked to press a key-combo."
+ . "want to record press Insert and you will be asked to press a key-combo. "
. "After pressing the combo the binding will be saved automatically and the "
. "binding editor closes");
$SETUP_NOTEBOOK->add (Spells => $SETUP_SPELLS = spell_setup,
"Displays all spells you have and lets you edit keyboard shortcuts for them.");
- $BUTTONBAR = new CFClient::UI::HBox x => 0, y => 0;
+ $BUTTONBAR = new CFClient::UI::Buttonbar x => 0, y => 0, z => 200; # put on top
$BUTTONBAR->add (new CFClient::UI::Flopper text => "Setup", other => $SETUP_DIALOG,
tooltip => "Toggles a dialog where you can configure all aspects of this client.");
@@ -1300,7 +1306,7 @@
tooltip => "Toggles the statistics window, where all your Stats and Resistances are being displayed at all times.");
$BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window,
tooltip => "Toggles the inventory window, where you can manage your loot (or treasures :). "
- ."You can also hit the Tab-key to show/hide the Inventory.");
+ . "You can also hit the Tab-key to show/hide the Inventory.");
$BUTTONBAR->add (new CFClient::UI::Button
text => "Save Config",