Games-Axmud
view release on metacpan or search on metacpan
lib/Games/Axmud/Obj/Winmap.pm view on Meta::CPAN
# (0, 1, 4, 7), in the new winmap the cloned winzones are numbered (0, 1, 2, 3)
$count = 0;
foreach my $oldZoneObj (sort {$a <=> $b} ($self->ivValues('zoneHash'))) {
my $cloneZoneObj;
$cloneZoneObj = $oldZoneObj->clone($self, $count);
$clone->ivAdd('zoneHash', $count, $cloneZoneObj);
$count++;
}
$clone->ivPoke('zoneCount', $count);
return $clone;
}
##################
# Methods
sub setupStandardWinmap {
# Called by $self->new whenever the specified name of the winmap is one of the standard
# winmaps defined by GA::Client->constWinmapNameHash
# (Could be called by any other function in order to reset a standard winmap, probably
# after a call to $self->resetWinmap)
# Sets up the standard winmap with its winzones
#
# Return values
# 'undef' on improper arguments, if $name isn't one of the standard winmap names or if
# any of the winzones can't be created
# 1 otherwise
my ($self, $check) = @_;
# Local variables
my $zone;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->setupStandardWinmap', @_);
}
# Check that this really is a standard winmap
if (! $axmud::CLIENT->ivExists('constWinmapNameHash', $self->name)) {
return undef;
}
# (These IVs the same for all standard winmaps)
$self->ivPoke('orientation', 'top');
# Set up $self->stripInitList
if ($self->name eq 'main_wait') {
# From top to bottom, the window will contain a menu bar, toolbar, Gtk3::Grid and an
# entry box
$self->ivPush(
'stripInitList',
'Games::Axmud::Strip::MenuBar',
undef,
'Games::Axmud::Strip::Toolbar',
undef,
'Games::Axmud::Strip::Table',
undef,
'Games::Axmud::Strip::Entry',
undef,
);
} elsif ($self->name eq 'internal_wait') {
# Contains only the Gtk3::Grid
$self->ivPush(
'stripInitList',
'Games::Axmud::Strip::Table',
undef,
);
} elsif (
$self->name eq 'main_fill'
|| $self->name eq 'main_part'
|| $self->name eq 'main_empty'
) {
# From top to bottom, the window will contain a menu bar, toolbar, Gtk3::Grid, a gauge
# box, an entry box and an info box
$self->ivPush(
'stripInitList',
'Games::Axmud::Strip::MenuBar',
undef,
'Games::Axmud::Strip::Toolbar',
undef,
'Games::Axmud::Strip::Table',
undef,
'Games::Axmud::Strip::GaugeBox',
undef,
'Games::Axmud::Strip::SearchBox',
undef,
'Games::Axmud::Strip::Entry',
{
'wipe_flag' => TRUE,
'add_flag' => TRUE,
'console_flag' => TRUE,
'input_flag' => TRUE,
'search_flag' => TRUE,
'cancel_flag' => TRUE,
'switch_flag' => TRUE,
'scroll_flag' => TRUE,
'split_flag' => TRUE,
},
'Games::Axmud::Strip::ConnectInfo',
undef,
);
} elsif (
$self->name eq 'basic_fill'
|| $self->name eq 'basic_part'
|| $self->name eq 'basic_empty'
) {
# Contains only a Gtk3::Grid
$self->ivPush(
'stripInitList',
'Games::Axmud::Strip::Table',
undef,
);
} elsif (
$self->name eq 'entry_fill'
|| $self->name eq 'entry_part'
|| $self->name eq 'entry_empty'
) {
# From top to bottom, contains a Gtk3::Grid and an entry box
$self->ivPush(
'stripInitList',
'Games::Axmud::Strip::Table',
undef,
'Games::Axmud::Strip::Entry',
undef,
);
}
# Set up $self->zoneHash
if (
$self->name eq 'main_fill'
|| $self->name eq 'basic_fill'
|| $self->name eq 'entry_fill'
) {
$zone = Games::Axmud::Obj::Winzone->new($self);
if (! $zone) {
( run in 1.873 second using v1.01-cache-2.11-cpan-39bf76dae61 )