Deliantra-Client

 view release on metacpan or  search on metacpan

DC/Item.pm  view on Meta::CPAN

143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
            : (
               ["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

1
2
3
4
5
6
7
8
9
10
11
package DC::Macro;
 
 
use List::Util ();
use DC::UI;
 
our $REFRESH_MACRO_LIST;
 
our %DEFAULT_KEYMAP = (
   (map +("($_)" => "!completer $_"), "a" .. "z"),

DC/Macro.pm  view on Meta::CPAN

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
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

327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
   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

352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
   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

417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
            }) 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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package DC::MapWidget;
 
 
use List::Util qw(min max);
 
use DC;
use DC::UI;
 
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

745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
   $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

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
use Guard ();
 
 
use DC;
use DC::DB;
use DC::UI;
use DC::Pod;
 
 
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

582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
   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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
 
 
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
 
 
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

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
   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

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
       '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

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
use DC::UI;
use DC::Pod;
 
$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

2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
   $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

2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
# 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.901 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )