view release on metacpan or search on metacpan
143144145146147148149150151152153154155156157158159160161162163
: (
[
"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
1234567891011package
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
169170171172173174175176177178179180181182183184185186187188189my
$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
327328329330331332333334335336337338339340341342343344345346347
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
352353354355356357358359360361362363364365366367368369370371372
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
417418419420421422423424425426427428429430431432433434435436
})
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
1234567891011121314151617181920package
DC::MapWidget;
use
common::sense;
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
745746747748749750751752753754755756757758759760761762763764765
$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
345678910111213141516171819202122
DC/Protocol.pm view on Meta::CPAN
582583584585586587588589590591592593594595596597598599600601602603
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
123456789101112131415package
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
123456789101112131415package
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
58596061626364656667686970717273747576777879
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
;
202122232425262728293031323334353637383940DC/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
9293949596979899100101102103104105106107108109110111112
'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
116117118119120121122123124125126127128129130131132133134135136use
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::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
215121522153215421552156215721582159216021612162216321642165216621672168216921702171
$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
24972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534# 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,