Deliantra-Client

 view release on metacpan or  search on metacpan

DC/Item.pm  view on Meta::CPAN

               : (
                  ["lock",   sub { $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) }],
                  ["$move_prefix all",   sub { $::CONN->send ("move $targ $self->{tag} 0") }],
                  ["$move_prefix <n>", 
                     sub {
                        do_n_dialog (sub { $::CONN->send ("move $targ $self->{tag} $_[0]") })
                     }
                  ]
               )
            ),
            ["bind <i>apply $shortname</i> to a key"   => sub { DC::Macro::quick_macro ["apply $self->{name}"] }],
         );

         DC::UI::Menu->new (items => \@menu_items)->popup ($ev);
      }

      1
   };

   my $tooltip_std =
      "<small>"

DC/Macro.pm  view on Meta::CPAN

package DC::Macro;

use common::sense;

use List::Util ();
use DC::UI;

our $REFRESH_MACRO_LIST;

our %DEFAULT_KEYMAP = (
   (map +("($_)" => "!completer $_"), "a" .. "z"),

DC/Macro.pm  view on Meta::CPAN

   my $window;
   
   my $done = sub {
      $window->disconnect_all ("delete");
      $window->disconnect_all ("focus_out");
      $window->destroy;
      &$end_cb;
   };

   $window = new DC::UI::Toplevel
      title => "Edit Macro Trigger",
      x     => "center",
      y     => "center",
      z     => 1000,
      can_events => 1,
      can_focus  => 1,
      has_close_button => 1,
      on_delete => sub {
         $done->(0);
         1
      },

DC/Macro.pm  view on Meta::CPAN

      state      => $::CFG->{shift_fire_stop},
      tooltip    => "If this checkbox is enabled you will stop fire only if you stop pressing shift.",
      on_changed => sub {
         my ($cbox, $value) = @_;
         $::CFG->{shift_fire_stop} = $value;
         0
      },
   );

   $list->add (new DC::UI::FancyFrame
      label => "Macros",
      child => (my $macros = new DC::UI::VBox),
   );

   my $refresh;

   my $tooltip_common = "\n\n<small>Left click - edit macro\nMiddle click - invoke macro\nRight click - further options</small>";
   my $tooltip_trigger = "The event that triggers execution of this macro, usually a key combination.";
   my $tooltip_commands = "The commands that comprise the macro.";

   my $edit_macro = sub {

DC/Macro.pm  view on Meta::CPAN

         text    => "Return",
         tooltip => "Return to the macro list.",
         on_activate => sub {
            $kbd_setup->clear;
            $kbd_setup->add ($list);
            $refresh->();
            1
         },
      );
      $kbd_setup->add (new DC::UI::FancyFrame
         label => "Edit Macro",
         child => (my $editor = new DC::UI::Table col_expand => [0, 1]),
      );

      $editor->add_at (0, 1, new DC::UI::Label
         text    => "Trigger",
         tooltip => $tooltip_trigger,
         can_hover  => 1,
         can_events => 1,
      );
      $editor->add_at (0, 2, new DC::UI::Label

DC/Macro.pm  view on Meta::CPAN

               }) if $::CONN;
            } else {
               $widget->set_text ("Start Recording");
               $::CONN->record if $::CONN;
            }
         },
      );
   };

   $macros->add (new DC::UI::Button
      text    => "New Macro",
      tooltip => "Creates a new, empty, macro you can edit.",
      on_activate => sub {
         my $macro = { };
         push @{ $::PROFILE->{macro} }, $macro;
         $edit_macro->($macro);
      },
   );

   $macros->add (my $macrolist = new DC::UI::Table col_expand => [0, 1]);

DC/MapWidget.pm  view on Meta::CPAN

package DC::MapWidget;

use common::sense;

use List::Util qw(min max);

use DC;
use DC::OpenGL;
use DC::UI;
use DC::Macro;

our @ISA = DC::UI::Base::;

our @TEX_HIDDEN = map {
   new_from_resource DC::Texture # MUST be POT
        "hidden-$_.png", mipmap => 1, wrap => 1
   } 0, 1, 2;

my $magicmap_tex =
      new_from_resource DC::Texture "magicmap.png",

DC/MapWidget.pm  view on Meta::CPAN

         $self->update_labels;
         0
      },
      on_button_down => sub {
         my ($entry, $ev, $x, $y) = @_;

         if ($ev->{button} == 3) {
            (new DC::UI::Menu
               items => [
                  ["bind <i>" . (DC::asxml $self->{select}) . "</i> to a key"
                   => sub { DC::Macro::quick_macro [$self->{select}], sub { $entry->grab_focus } }]
               ],
            )->popup ($ev);
            return 1;
         }
         0
      },
      on_key_down => sub {
         my ($entry, $ev) = @_;

         my $self = $entry->{parent}{parent};

DC/Protocol.pm  view on Meta::CPAN

use common::sense;

use Guard ();

use Deliantra::Protocol::Constants;

use DC;
use DC::DB;
use DC::UI;
use DC::Pod;
use DC::Macro;
use DC::Item;

use base 'Deliantra::Protocol::Base';

our $TEX_DIALOGUE = new_from_resource DC::Texture
         "dialogue.png", minify => 1, mipmap => 1;

our $TEX_NOFACE = new_from_resource DC::Texture
        "noface.png", minify => 1, mipmap => 1, wrap => 1;

DC/Protocol.pm  view on Meta::CPAN

            my ($widget, $ev) = @_;

            if ($ev->{button} == 1) {
               $::CONN->user_send ("ready_skill $name");
            } elsif ($ev->{button} == 2) {
               $::CONN->user_send ("use_skill $name");
            } elsif ($ev->{button} == 3) {
               my $shortname = DC::shorten $name, 14;
               (new DC::UI::Menu
                  items => [
                     ["bind <i>ready_skill $shortname</i> to a key" => sub { DC::Macro::quick_macro ["ready_skill $name"] }],
                     ["bind <i>use_skill $shortname</i> to a key"   => sub { DC::Macro::quick_macro ["use_skill $name"]   }],
                  ],
               )->popup ($ev);
            } else {
               return 0;
            }

            1
         };

         my $sw = $self->{skillwid}{$idx} ||= [

DC/UI/Inventory.pm  view on Meta::CPAN

package DC::UI::Inventory;

use common::sense;

use DC::Macro;
use DC::Item;

our @ISA = DC::UI::Table::;

sub new {
   my $class = shift;

   my $self = $class->SUPER::new (
      col_expand => [0, 1, 0],
      items      => [],

DC/UI/SpellList.pm  view on Meta::CPAN

package DC::UI::SpellList;

use common::sense;

use DC::Macro;

our @ISA = DC::UI::Table::;

sub new {
   my $class = shift;

   my $self = $class->SUPER::new (
      binding  => [],
      commands => [],
      @_,

DC/UI/SpellList.pm  view on Meta::CPAN

            my ($widget, $ev) = @_;

            if ($ev->{button} == 1) {
               $::CONN->user_send ("cast $spell->{name}");
            } elsif ($ev->{button} == 2) {
               $::CONN->user_send ("invoke $spell->{name}");
            } elsif ($ev->{button} == 3) {
               my $shortname = DC::shorten $spell->{name}, 14;
               (new DC::UI::Menu
                  items => [
                     ["bind <i>cast $shortname</i> to a key"   => sub { DC::Macro::quick_macro ["cast $spell->{name}"] }],
                     ["bind <i>invoke $shortname</i> to a key" => sub { DC::Macro::quick_macro ["invoke $spell->{name}"] }],
                  ],
               )->popup ($ev);
            } else {
               return 0;
            }

            1
         };

         my $tooltip = (DC::asxml $spell->{message}) . $TOOLTIP_ALL;

MANIFEST  view on Meta::CPAN

DC/UI.pm
DC/UI/Inventory.pm
DC/UI/SpellList.pm
DC/UI/Dockable.pm
DC/UI/Dockbar.pm
DC/UI/Canvas.pm
DC/UI/ChatView.pm
DC/Item.pm
DC/Pod.pm
DC/MapWidget.pm
DC/Macro.pm

Client.pm			dummy file for CPAN

glfunc.h
texcache.c
rendercache.c
pangoopengl.h
pango-font.c
pango-fontmap.c
pango-render.c

Makefile.PL  view on Meta::CPAN

       'DC/UI/Canvas.pm'          => '$(INST_LIBDIR)/Client/private/DC/UI/Canvas.pm',
       'DC/UI/Dockable.pm'        => '$(INST_LIBDIR)/Client/private/DC/UI/Dockable.pm',
       'DC/UI/Dockbar.pm'         => '$(INST_LIBDIR)/Client/private/DC/UI/Dockbar.pm',
       'DC/UI/Inventory.pm'       => '$(INST_LIBDIR)/Client/private/DC/UI/Inventory.pm',
       'DC/UI/SpellList.pm'       => '$(INST_LIBDIR)/Client/private/DC/UI/SpellList.pm',
       'DC/UI/Canvas.pm'          => '$(INST_LIBDIR)/Client/private/DC/UI/Canvas.pm',
       'DC/UI/ChatView.pm'        => '$(INST_LIBDIR)/Client/private/DC/UI/ChatView.pm',
       'DC/Item.pm'               => '$(INST_LIBDIR)/Client/private/DC/Item.pm',
       'DC/Pod.pm'                => '$(INST_LIBDIR)/Client/private/DC/Pod.pm',
       'DC/MapWidget.pm'          => '$(INST_LIBDIR)/Client/private/DC/MapWidget.pm',
       'DC/Macro.pm'              => '$(INST_LIBDIR)/Client/private/DC/Macro.pm',
       'docwiki.pst'              => '$(INST_LIBDIR)/Client/private/resources/docwiki.pst',
       (map +($_ => "\$(INST_LIBDIR)/Client/private/$_"), manifest_resources),
    }
);

sub MY::postamble {
   my $self = shift;

   # try to add MANIFEST to CONFIGDEP
   s/^CONFIGDEP = /CONFIGDEP = MANIFEST /m

bin/deliantra  view on Meta::CPAN

use DC::UI;
use DC::UI::Canvas;
use DC::UI::Inventory;
use DC::UI::SpellList;
use DC::UI::Dockable;
use DC::UI::Dockbar;
use DC::UI::ChatView;
use DC::MessageDistributor;
use DC::Pod;
use DC::MapWidget;
use DC::Macro;

$SIG{QUIT} = sub { Carp::cluck "QUIT" };
$SIG{PIPE} = 'IGNORE';

$EV::DIED = sub {
   crash "CRASH/EV::DIED: $@" => 0;
   DC::fatal Carp::longmess $@;
};

my $MAX_FPS = 60;

bin/deliantra  view on Meta::CPAN


   $ntb->add_tab (Media => media_window,
      "License, Author and Source info for media sent by the server.");

   $ntb->set_current_page ($INVENTORY_PAGE);

   $plwin->add ($ntb);
}

sub keyboard_setup {
   DC::Macro::keyboard_setup
}

sub make_help_window {
   my $win = new DC::UI::Toplevel
      x       => 'center',
      y       => 'center',
      z       => 4,
      name    => 'doc_browser',
      force_w => int $WIDTH  * 7/8,
      force_h => int $HEIGHT * 7/8,

bin/deliantra  view on Meta::CPAN


   # due to mac os x braindamage, we simply retry with !fullscreen in case of an error
   DC::SDL_SetVideoMode $WIDTH, $HEIGHT, $rgb, $alpha, $FULLSCREEN
      or DC::SDL_SetVideoMode $WIDTH, $HEIGHT, $rgb, $alpha, !$FULLSCREEN
      or die "SDL_SetVideoMode failed: " . (DC::SDL_GetError) . "\n";

   $SDL_ACTIVE = 1;
   $LAST_REFRESH = time - 0.01;

   DC::OpenGL::init;
   DC::Macro::init;

   $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize};

   $DC::UI::ROOT->configure (0, 0, $WIDTH, $HEIGHT);#d#

   #############################################################################

   if ($DEBUG_STATUS) {
      DC::UI::rescale_widgets $WIDTH / $old_w, $HEIGHT / $old_h;
   } else {
      # create/configure the widgets

      $DC::UI::ROOT->connect (key_down => sub {
         my (undef, $ev) = @_;

         if (my @macros = DC::Macro::find $ev) {
            DC::Macro::execute $_ for @macros;

            return 1;
         }

         0
      });

      $DEBUG_STATUS = new DC::UI::Label
         padding => 0,
         z       => 100,



( run in 0.652 second using v1.01-cache-2.11-cpan-49f99fa48dc )