Games-Axmud
view release on metacpan or search on metacpan
lib/Games/Axmud/Obj/Link.pm view on Meta::CPAN
# http://deathmud.org - a URL opened by GA::Client->browserCmd (anything
# matching GA::Client->constUrlRegex)
# deathmud.org - a URL opened by GA::Client->browserCmd (anything
# matching GA::Client->constShortUrlRegex)
#
# (type = 'mail')
# mailto:god@deathmud.org - an email sent by GA::Client->emailCmd
# admin@deathmud.org - an email sent by GA::Client->emailCmd
#
# ($type = 'telnet')
# telnet://deathmud.org:6666 - a new connection to a world, using telnet
# telnet://deathmud.org - a new connection to a world, port 23
#
# ($type = 'ssh')
# ssh://deathmud.org:6666 - a new connection to a world, using SSH
# ssh://deathmud.org - a new connection to a world, generic port
#
# ($type = 'ssl')
# ssl://deathmud.org:6666 - a new connection to a world, using SSL
# ssl://deathmud.org - a new connection to a world, generic port
#
# ($type = 'cmd')
# <any string> - a clickable world command (used with MXP)
#
# ($type = 'image')
# <any string> - a clickable image, which sends the string as a world
# command. If the string contains %x and/or %y, they
# are substituted for the x/y coordinates of the mouse
# click
#
# NB If 'undef' or an empty string , nothing happens when the user clicks the link
# link
# NB MXP links can't be ssh:// or ssl://
href => '',
# The clickable text displayed, e.g. 'Click here for DeathMud website'. If 'undef', an
# empty string is stored as an IV (in the expectation that it will be updated with
# some text). For non-MXP links, will be the same as $href. For images, 'undef' or an
# empty string (since there is no text)
text => '',
# A hint for this link, if specified ('undef' if not)
hint => undef,
# The expire name, for links that expire, if specified ('undef' if not)
expireName => undef,
# Flag set to TRUE when the link expires
expiredFlag => FALSE,
# Flag set to TRUE if this is an MXP link, FALSE if it's a normal link
mxpFlag => FALSE,
# Flag set to TRUE if an MXP <SEND>..</SEND> specified PROMPT as one of its arguments
mxpPromptFlag => FALSE,
# Flag set to TRUE if an MXP link's corresponding command should be sent to the world
# invisibly, FALSE if it should be visible (or not) as any other world command is
mxpInvisFlag => FALSE,
# Mode for Pueblo links, which are implemented in the same way as MXP <A> or <SEND>
# links, depending on arguments
# 'not_link' - not a Pueblo link, 'href_link' - <A HREF=...>, 'cmd_link'
# - <A XCH_CMD...>
puebloMode => 'not_link',
# Flag set to TRUE if a popup menu should be created when the user clicks on this link
popupFlag => FALSE,
# When ->popupFlag is TRUE, $self->href is split into a list of world commands, and
# stored in this IV (but the value of $self->href remains unchanged)
popupCmdList => [],
# When ->popupFlag is TRUE, $self->hint is split into a list of menu items, and stored
# in this IV. If there is one more menu item than there are world commands, the
# first menu item (which is actually a hint) is removed and stored in $self->hint;
# otherwise $self->hint is set back to 'undef'
popupItemList => [],
};
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
##################
# Accessors - set
##################
# Accessors - get
sub number
{ $_[0]->{number} }
sub textViewObj
{ $_[0]->{textViewObj} }
sub lineNum
{ $_[0]->{lineNum} }
sub posn
{ $_[0]->{posn} }
sub type
{ $_[0]->{type} }
sub href
{ $_[0]->{href} }
sub text
{ $_[0]->{text} }
sub hint
{ $_[0]->{hint} }
sub expireName
{ $_[0]->{expireName} }
sub expiredFlag
{ $_[0]->{expiredFlag} }
sub mxpFlag
{ $_[0]->{mxpFlag} }
sub mxpPromptFlag
{ $_[0]->{mxpPromptFlag} }
sub mxpInvisFlag
{ $_[0]->{mxpInvisFlag} }
sub puebloMode
{ $_[0]->{puebloMode} }
sub popupFlag
{ $_[0]->{popupFlag} }
sub popupCmdList
{ my $self = shift; return @{$self->{popupCmdList}}; }
sub popupItemList
{ my $self = shift; return @{$self->{popupItemList}}; }
}
# Package must return a true value
1
( run in 0.667 second using v1.01-cache-2.11-cpan-364913b4093 )