view release on metacpan or search on metacpan
lib/Games/Axmud/Client.pm view on Meta::CPAN
=> $axmud::SCRIPT . ' label',
'Games::Axmud::Table::Button'
=> $axmud::SCRIPT . ' button',
'Games::Axmud::Table::CheckButton'
=> $axmud::SCRIPT . ' check button',
'Games::Axmud::Table::RadioButton'
=> $axmud::SCRIPT . ' radio button',
'Games::Axmud::Table::Entry'
=> $axmud::SCRIPT . ' entry box',
'Games::Axmud::Table::ComboBox'
=> $axmud::SCRIPT . ' combobox',
'Games::Axmud::Table::SimpleList'
=> $axmud::SCRIPT . ' simple list',
'Games::Axmud::Table::TextView'
=> $axmud::SCRIPT . ' simple textview',
'Games::Axmud::Table::Pane'
=> $axmud::SCRIPT . ' window pane',
'Games::Axmud::Table::PseudoWin'
=> $axmud::SCRIPT . ' pseudo-window',
},
# The customisable registry hash of table objects, in the form
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# Check for improper arguments
if (! defined $grid || ! defined $slWidget || ! defined $columns || defined $check) {
return $axmud::CLIENT->writeImproper(
$self->_objClass . '->routesTab_addEditButtons',
@_,
);
}
# Add comboboxes, check buttons and entries
$self->addLabel($grid, 'Route type',
1, 4, 8, 9);
@typeList = ('road', 'quick', 'circuit');
my $combo = $self->addComboBox($grid, undef, \@typeList, '',
TRUE, # No 'undef' value used
4, 5, 8, 9);
my $checkButton = $self->addCheckButton($grid, 'Hoppable', undef, TRUE,
5, 7, 8, 9);
# New routes should be hoppable by default
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
foreach my $item ($axmud::CLIENT->constColourTagList) {
push (@comboList, 'ul_' . $item);
}
foreach my $item ($axmud::CLIENT->constBoldColourTagList) {
push (@comboList, 'UL_' . $item);
}
# (Don't use the generic combobox code so that the tags are always displayed in the same
# order)
my $comboBox = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # No 'undef' value used
9, 13, 8, 9);
$current = $self->getEditHash_scalarIV('useTextColour');
if ($current) {
# Display the current value of the IV in the combobox
OUTER: for (my $count = 0; $count < scalar @comboList; $count++) {
if ($comboList[$count] eq $current) {
$comboBox->set_active($count);
$matchFlag = TRUE;
last OUTER;
}
}
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# Set the IV only if this radiobutton has been selected
if ($radioButton2->get_active()) {
$self->ivAdd('editHash', $flagIV, TRUE);
$label->set_markup('<i>' . $stringList[3] . '</i>');
$label2->set_markup('<i>' . $stringList[4] . '</i>');
}
});
# Prepare lists for insertion into comboboxes
@comboList = $axmud::CLIENT->constColourTagList;
foreach my $item (@comboList) {
push (@comboList2, 'ul_' . $item);
}
@comboList3 = $axmud::CLIENT->constStyleTagList;
# Add editing combos / buttons in bottom-right corner
# First set - standard text colour tags
my $comboBox = $self->addComboBox($grid, undef, \@comboList, 'Standard text colour tags:',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
push (@ivList, $modTag);
$self->ivAdd('editHash', $tagListIV, \@ivList);
# Update the textview
$buffer->set_text(join("\n", @ivList));
}
});
# Fifth set - style tags
# NB 'Dummy' style tags can be added to the GA::Obj::Component object, although this is not
# recommended, so they are not included in the combobox
my $comboBox3 = $self->addComboBox($grid, undef, \@comboList3, 'Style tags:',
TRUE, # No 'undef' value used
4, 10, 11, 12);
my $button7 = $self->patternsTags1Tab_addButton(
$grid,
11,
$tagListIV,
$buffer,
$comboBox3,
'Style tags:',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# 'u#FFFFFF'; RGB tags are case-insensitive
if ($text =~ m/^u?\#[0-9A-F]{6}$/i) {
return 1;
} else {
return undef;
}
}
sub patternsTags1Tab_addButton {
# Called by $self->patternsTags1Tab to add a Gtk3::Button next to a combobox
#
# Expected arguments
# $grid - The Gtk3::Grid for this tab
# $row - The position in the grid of the buttons
# $iv - The IV being edited (e.g. 'startTagList')
# $buffer - The buffer of the Gtk3::TextView used to display the IV
# $comboBox - The Gtk3::ComboBox used alongside the Gtk3::Button
# $title - The title used at the top of the combobox
#
# Return values
# 'undef' on improper arguments
# The Gtk3::Button created, otherwise
my ($self, $grid, $row, $iv, $buffer, $comboBox, $title, $check) = @_;
# Check for improper arguments
if (
! defined $grid || ! defined $row || ! defined $iv || ! defined $buffer
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# Update the textview
$buffer->set_text(join("\n", @ivList));
}
});
return $button;
}
sub patternsTags1Tab_addBoldButton {
# Called by $self->patternsTags1Tab to add another Gtk3::Button next to a combobox
#
# Expected arguments
# $grid - The Gtk3::Grid for this tab
# $row - The position in the grid of the buttons
# $iv - The IV being edited (e.g. 'startTagList')
# $buffer - The buffer of the Gtk3::TextView used to display the IV
# $comboBox - The Gtk3::ComboBox used alongside the Gtk3::Button
# $title - The title used at the top of the combobox
#
# Return values
# 'undef' on improper arguments
# The Gtk3::Button created, otherwise
my ($self, $grid, $row, $iv, $buffer, $comboBox, $title, $check) = @_;
# Check for improper arguments
if (
! defined $grid || ! defined $row || ! defined $iv || ! defined $buffer
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Term', 'text',
'Number', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->numbersTab_refreshList($slWidget, (scalar @columnList / 2), 'numberHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Term',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Number (indeterminate = -1):',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'float', 0, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Value', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->numbersTab_refreshList($slWidget, (scalar @columnList / 2), 'clockDayHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Value:',
7, 10, 8, 9);
@comboList = (0, 1);
my $combo = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # No 'undef' value used
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Value', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->numbersTab_refreshList($slWidget, (scalar @columnList / 2), 'clockHourHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Value',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'float', 0, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Value', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->numbersTab_refreshList($slWidget, (scalar @columnList / 2), 'clockMinuteHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Value',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'float', 0, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'sentientHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, FALSE,
10, 12, 8, 9);
$entry2->set_text('sentient');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'creatureHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, FALSE,
10, 12, 8, 9);
$entry2->set_text('creature');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'portableTypeHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
@comboList = $self->getEditHash_listIV('portableTypeList');
my $comboBox = $self->addComboBox($grid, undef, \@comboList, '',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'decorationTypeHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
@comboList = $self->getEditHash_listIV('decorationTypeList');
my $comboBox = $self->addComboBox($grid, undef, \@comboList, '',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'guildHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, FALSE,
10, 12, 8, 9);
$entry2->set_text('guild');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'raceHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, FALSE,
10, 12, 8, 9);
$entry2->set_text('race');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'weaponHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, FALSE,
10, 12, 8, 9);
$entry2->set_text('weapon');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'armourHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, FALSE,
10, 12, 8, 9);
$entry2->set_text('armour');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'garmentHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, 0,
10, 12, 8, 9);
$entry2->set_text('garment');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Plural pattern', 'text',
'Singular ending', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'pluralEndingHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Plural pattern',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Singular ending',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 0, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Singular pattern', 'text',
'Plural ending', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'reversePluralEndingHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Singular pattern',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 0, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Plural ending',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Singular noun', 'text',
'Plural noun', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'pluralNounHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Singular noun',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Plural noun',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Word', 'text',
'Type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'adjHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Word',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Type',
7, 10, 8, 9);
my $entry2 = $self->addEntry($grid, undef, FALSE,
10, 12, 8, 9);
$entry2->set_text('adj');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Declined ending pattern', 'text',
'Undeclined ending', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'adjEndingHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Declined ending pattern',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Undeclined ending',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Undeclined ending pattern', 'text',
'Declined ending', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'reverseAdjEndingHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Undeclined ending pattern',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Declined ending',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Undeclined form', 'text',
'Declined form', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'declinedAdjHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Undeclined form',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Declined form',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pseudo noun', 'text',
'Replacement noun', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'pseudoNounHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pseudo noun (pattern)',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 12, 8, 9);
$self->addLabel($grid, 'Replacement noun',
1, 4, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 12, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pseudo object', 'text',
'Replacement object', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'pseudoObjHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pseudo object (pattern)',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 12, 8, 9);
$self->addLabel($grid, 'Replacement object (if any)',
1, 4, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 0, undef,
4, 12, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pseudo adjective', 'text',
'Replacement adjective', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'pseudoAdjHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pseudo adjective (pattern)',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
4, 12, 8, 9);
$self->addLabel($grid, 'Replacement adjective (if any)',
1, 4, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 0, undef,
4, 12, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
} else {
# 'Edit' direction. Fill the entry boxes with the selected direction's data
$entry->set_text($dir);
if (defined $abbrev) {
$entry2->set_text($abbrev);
}
$entry3->set_text($opp);
$entry4->set_text($oppAbbrev);
# Make the right choice visible in the combobox
$posn = 0; # Default is the 'don't auto-allocate' string
if ($auto) {
OUTER: for (my $index = 0; $index < 18; $index++) {
if ($comboList[$index] eq $auto) {
$posn = $index;
last OUTER;
}
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
$opp = $axmud::CLIENT->trimWhitespace($opp, TRUE);
if ($oppAbbrev) {
$oppAbbrev = $axmud::CLIENT->trimWhitespace($oppAbbrev, TRUE);
}
$auto = $combo->get_active_text();
if ($auto eq $noAutoString) {
# User selected 'Don't auto-allocate' in the combobox; the dictionary's
# ->secondaryAutoHash expects a key-value pair, with a value set to 'undef'
$auto = undef;
}
# Need to check that the user hasn't added a primary direction (standard or custom)
# or an existing secondary direction
# Import data from the affected IVs. We can't use ->combDirHash because it hasn't
# been updated yet, if any changes have been made in this window
if ($self->ivExists('editHash', 'primaryDirHash')) {
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
if ($profObj->category ne 'world') {
push (@profList, $profObj->name);
}
}
@sortedList = sort {lc($a) cmp lc($b)} (@profList);
# ...and put the current world profile at the top of the list
unshift (@sortedList, $self->session->currentWorld->name);
# Add entries/comboboxes for adding world model objects
$self->addLabel($grid, 'Profile',
1, 3, 8, 9);
my $combo = $self->addComboBox($grid, undef, \@sortedList, '',
TRUE, # No 'undef' value used
3, 6, 8, 9);
$self->addLabel($grid, 'Command sequence',
1, 3, 9, 10);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 12, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Door type', 'text',
'Command sequence', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'doorHash');
# Add entries/comboboxes for adding world model objects
$self->addLabel($grid, 'Profile',
1, 3, 8, 9);
@comboList = qw(break pick unlock open close lock);
my $combo = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # No 'undef' value used
3, 6, 8, 9);
$self->addLabel($grid, 'Command sequence',
1, 3, 9, 10);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Light status', 'text',
'Verbose descrip', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'descripHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Light status',
1, 3, 8, 9);
@comboList = $self->session->worldModelObj->lightStatusList;
my $combo = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # No 'undef' value used
3, 6, 8, 9);
$self->addLabel($grid, 'Verbose description',
1, 3, 9, 10);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
}
@sortedList = sort {lc($a) cmp lc($b)} (@charList);
# Put the current char (if any) at the beginning of the list
if ($self->session->currentChar) {
unshift (@sortedList, $self->session->currentChar->name);
}
# Add entries/comboboxes for adding new key/value pairs
$self->addLabel($grid, 'Character',
1, 3, 8, 9);
my $combo = $self->addComboBox($grid, undef, \@sortedList, '',
TRUE, # No 'undef' value used
3, 6, 8, 9);
$self->addLabel($grid, 'Number of visits',
7, 9, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV(
$slWidget,
scalar (@columnList / 2),
'involuntaryExitPatternHash',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 12, 8, 9);
$self->addLabel($grid, '(Optional) direction or destination room number',
1, 4, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', undef, undef,
4, 12, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV(
$slWidget,
scalar (@columnList / 2),
'repulseExitPatternHash',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 12, 8, 9);
$self->addLabel($grid, '(Optional) direction or destination room number',
1, 4, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', undef, undef,
4, 12, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Substring #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'fightMsgList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Substring #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'interactionMsgList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# 1 otherwise
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->expandNotebook', @_);
}
# The combobox in $self->rooms2Tab (used by 'Rooms' pages 2, 4 and 6) must be updated
# whenever the user adds/deletes a room statement component (in page 1). Use a special IV
# to store the comboboxes to update
$self->{comboHash} = {};
# The simple lists on these tabs must also be updated, when the user deletes a component on
# page 1. Use a special IV to store the simple lists to update
$self->{simpleListHash} = {};
# If this is a current profile, set a flag
if ($self->session->currentWorld eq $self->editObj) {
$self->ivPoke('currentFlag', TRUE);
}
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
8, 11, 7, 8);
$self->addEntryWithIcon($grid, 'excessCmdDelay', 'float', 0.1, undef,
11, 13, 7, 8, 6, 4);
# Tab complete
return 1;
}
sub settings10Tab_refreshCombo {
# Resets the combobox displayed by $self->settings10Tab
#
# Expected arguments
# $combo - The Gtk3::Combo
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $combo, $check) = @_;
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my (
$mode,
%hash,
);
$mode = $comboHash{$combo->get_active_text()};
%hash = $self->getEditHash_hashIV('termOverrideHash');
$hash{termTypeMode} = $mode;
$self->ivAdd('editHash', 'termOverrideHash', \%hash);
# Reset the combobox
$combo->set_active(0);
# Refresh the simple list
$self->refreshList_hashIV($slWidget, (scalar @columnList / 2), 'termOverrideHash');
});
my $button2 = $self->addButton(
$grid,
'Don\'t use',
'Don\'t use this setting in the session',
undef,
10, 12, 7, 8);
$button2->signal_connect('clicked' => sub {
my %hash = $self->getEditHash_hashIV('termOverrideHash');
delete $hash{'termTypeMode'};
$self->ivAdd('editHash', 'termOverrideHash', \%hash);
# Reset the combobox
$combo->set_active(0);
# Refresh the simple list
$self->refreshList_hashIV($slWidget, (scalar @columnList / 2), 'termOverrideHash');
});
$self->addLabel($grid, 'Custom client name',
1, 3, 8, 9);
my $entry = $self->addEntry($grid, undef, TRUE,
3, 8, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
if ($mode eq 'Enabled') {
$flag = TRUE;
} else {
$flag = FALSE;
}
%hash = $self->getEditHash_hashIV('termOverrideHash');
$hash{$iv} = $flag;
$self->ivAdd('editHash', 'termOverrideHash', \%hash);
# Reset the comboboxes
$combo2->set_active(0);
$combo3->set_active(0);
# Refresh the simple list
$self->refreshList_hashIV($slWidget, (scalar @columnList / 2), 'termOverrideHash');
});
my $button8 = $self->addButton(
$grid,
'Don\'t use',
'Don\'t use this setting in the session',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
$iv,
%hash,
);
$iv = $comboHash2{$combo2->get_active_text()};
%hash = $self->getEditHash_hashIV('termOverrideHash');
delete $hash{$iv};
$self->ivAdd('editHash', 'termOverrideHash', \%hash);
# Reset the comboboxes
$combo2->set_active(0);
$combo3->set_active(0);
# Refresh the simple list
$self->refreshList_hashIV($slWidget, (scalar @columnList / 2), 'termOverrideHash');
});
my $button9 = $self->addButton(
$grid,
'Reset',
'Reset the list of override settings',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Min. size', 'int',
'Max. size', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->rooms1Tab_refreshList($slWidget, (scalar @columnList / 2));
# Add entries/comboboxes for adding new components
$self->addLabel($grid, 'Type:',
1, 2, 8, 9);
@comboList = $axmud::CLIENT->constComponentTypeList;
# The first item in the list is 'anchor', which is a special kind of component which doesn't
# have a corresponding GA::Obj::Component; remove it from the list
shift @comboList;
my $comboBox = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # No 'undef' value used
2, 6, 8, 9);
# ->signal_connect appears below...
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# ...and store it again
$self->ivAdd('editHash', $iv, \@modList);
}
return 1;
}
sub rooms1Tab_refreshCombos {
# Resets the comboboxes stored in $self->comboHash
#
# Expected arguments
# (none besides $self)
#
# Optional arguments
# @comboList - A list of items to store in each combobox, once it has been emptied (can
# be an empty list)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, @comboList) = @_;
# Local variables
my @sortedList;
# (No improper arguments to check)
# Sort the list of components, and add the anchor line (which doesn't appear in the
# ->componentHash IV)
@sortedList = sort {lc($a) cmp lc($b)} (@comboList);
push(@sortedList, 'anchor');
# Update each combobox in turn
foreach my $combo ($self->ivValues('comboHash')) {
$self->resetComboBox($combo, @sortedList);
}
return 1;
}
sub rooms2Tab {
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Colour tag', 'text',
'Exit state', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 3, 9);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'exitStateTagHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Colour tag',
1, 3, 9, 10);
my $entry = $self->addEntryWithIcon($grid, undef, \&rooms15Tab_checkEntry, undef, undef,
3, 6, 9, 10);
$self->addLabel($grid, 'Exit state',
1, 3, 10, 11);
@comboList = (
'open',
'closed',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Exit alias (pattern)', 'text',
'Replacement string', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 3, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'exitAliasHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Exit alias',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
3, 6, 8, 9);
$self->addLabel($grid, 'Replacement string',
6, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Replacement contents', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 3, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'specialPatternHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 6, 8, 9);
$self->addLabel($grid, 'Replacement',
7, 8, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
8, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Transient exit pattern', 'text',
'Destination room #', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 10);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'transientExitPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Transient exit pattern',
1, 3, 10, 11);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
3, 6, 10, 11);
$self->addLabel($grid, '(Optional) desination room #',
6, 9, 10, 11);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 0, undef,
9, 12, 10, 11);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Follow pattern', 'text',
'Direction substring #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 10);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'followPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Follow pattern',
1, 3, 10, 11);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
3, 6, 10, 11);
$self->addLabel($grid, 'Substring # for direction',
6, 9, 10, 11);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
9, 12, 10, 11);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Follow anchor pattern', 'text',
'Direction substring #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 10);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'followAnchorPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Follow anchor pattern',
1, 3, 10, 11);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
3, 6, 10, 11);
$self->addLabel($grid, 'Substring # for direction',
6, 9, 10, 11);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
9, 12, 10, 11);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Command', 'text',
'How often to send', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 3, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'statusCmdHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Command',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 8, 9);
$self->addLabel($grid, 'Sent how often (in seconds):',
6, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 1, 6);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'gaugeFormatList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Variable:',
1, 2, 6, 7);
@comboList = sort {lc($a) cmp lc($b)} (
$taskObj->ivKeys('constCharVarHash'),
$taskObj->ivKeys('constFixedVarHash'),
);
my $comboBox = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # No 'undef' value used
2, 6, 6, 7);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'MSDP variable', 'text',
'Status task variable', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'msdpStatusVarHash');
# Add entries/comboboxes for adding new variables
$self->addLabel($grid, 'MSDP variable',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 8, 9);
$self->addLabel($grid, 'Status task variable',
6, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'MXP variable', 'text',
'Status task variable', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'mxpStatusVarHash');
# Add entries/comboboxes for adding new variables
$self->addLabel($grid, 'MXP entity',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 8, 9);
$self->addLabel($grid, 'Status task variable',
6, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'groupPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
3, 12, 8, 9);
$self->addLabel($grid, 'Substring #:',
1, 3, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
3, 6, 9, 10, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Unit', 'text',
'Max units', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'barPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 6, 8, 9);
$self->addLabel($grid, 'Unit:',
6, 7, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
7, 9, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Substring #', 'int',
'Display', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'affectPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 12, 8, 9);
$self->addLabel($grid, 'Substring #:',
1, 2, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
2, 6, 9, 10, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Stat', 'text',
'Display', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'statPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 12, 8, 9);
$self->addLabel($grid, 'Substring #:',
1, 2, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
2, 6, 9, 10, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Mode', 'text',
'Position', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'inventoryPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Type:',
8, 9, 8, 9);
@comboList = (
'wield', 'hold', 'wear', 'carry',
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 10);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'inventoryIgnorePatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 10, 11);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 10, 11);
$self->addLabel($grid, 'Mode:',
8, 10, 10, 11);
my $comboBox = $self->addComboBox($grid, undef, ['hide', 'show'], '',
TRUE, # No 'undef' value used
10, 12, 10, 11);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Mode', 'text',
'Condition', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'conditionPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 12, 8, 9);
$self->addLabel($grid, 'Substring #:',
1, 3, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
3, 5, 9, 10, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Command', 'text',
'How often to send', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 3, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'inventoryCmdHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Command',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 8, 9);
$self->addLabel($grid, 'Sent how often (in seconds):',
6, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Channel', 'text',
'Only in task window', 'bool',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 9);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'channelList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 9, 10);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 12, 9, 10);
$self->addLabel($grid, 'Channel name (1-16 chars):',
1, 2, 10, 11);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, 16,
2, 6, 10, 11,
16, 16);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Target #', 'int',
'Direction #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'targetLeavesPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
3, 12, 8, 9);
$self->addLabel($grid, 'Target substring #:',
1, 3, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
3, 6, 9, 10, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'targetArrivesPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
3, 12, 8, 9);
$self->addLabel($grid, 'Target substring #:',
1, 3, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
3, 6, 9, 10, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Substring #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'fightStartedPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'cannotFindTargetPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'targetAlreadyDeadPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Substring #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'targetKilledPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'fightDefeatPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Pattern', 'text',
'Substring #', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV($slWidget, scalar (@columnList / 2), 'wimpyEngagedPatternList');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'interactionStartedPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'cannotInteractPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'interactionSuccessPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'interactionFailPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'interactionFightPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_listIV(
$slWidget,
scalar (@columnList / 2),
'interactionDisasterPatternList',
);
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Pattern:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'regex', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Target substring #:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Currency unit', 'text',
'Value', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'currencyHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Currency unit:',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 8, 9);
$self->addLabel($grid, 'Value (in standard units):',
6, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'float', 0, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Stat', 'text',
'Value', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'statHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Stat',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Default value (usually 0):',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'float', 0, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Skill', 'text',
'Maximum level', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'skillMaxLevelHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Skill:',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Max level:',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 0, undef,
9, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Main noun', 'text',
'Number of kills', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'fightVictimHash');
# Add entries/comboboxes for adding new records
$self->addLabel($grid, 'Main noun',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Number of kills',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Base string', 'text',
'Number of kills', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'fightVictimStringHash');
# Add entries/comboboxes for adding new records
$self->addLabel($grid, 'Base string',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Number of kills',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Main noun', 'text',
'Success count', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'interactionVictimHash');
# Add entries/comboboxes for adding new records
$self->addLabel($grid, 'Main noun',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Success count',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV(
$slWidget,
scalar (@columnList / 2),
'interactionVictimStringHash',
);
# Add entries/comboboxes for adding new records
$self->addLabel($grid, 'Base string',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Success count',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Affect', 'text',
'Value', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'affectHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Affect',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Value (not in use)',
7, 10, 8, 9);
# (Left commented out, in case we want to assign values to the IV's key-value pairs later)
# my $entry2 = $self->addEntryWithIcon($grid, undef, 'float', 0, undef,
# 10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Stat', 'text',
'Value', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'statHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Stat',
1, 4, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
4, 7, 8, 9);
$self->addLabel($grid, 'Current value',
7, 10, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'float', 0, undef,
10, 12, 8, 9);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Command', 'text',
'How often', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 3, 10);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'statusCmdHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Command',
1, 3, 10, 11);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 10, 11);
$self->addLabel($grid, 'Sent how often (in seconds):',
6, 9, 10, 11);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
9, 12, 10, 11);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Command', 'text',
'Sent how often', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 10);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'inventoryCmdHash');
# Add entries/comboboxes for adding new patterns
$self->addLabel($grid, 'Command',
1, 3, 10, 11);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 10, 11);
$self->addLabel($grid, 'Sent how often (in seconds):',
6, 9, 10, 11);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
9, 12, 10, 11);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
11, 13, 7, 8);
# Text-to-speech (TTS) settings
$self->addLabel($grid, '<b>Text-to-speech settings</b> <i>(see also pages 3-5)</i>',
7, 13, 8, 9);
$self->addLabel($grid, 'TTS configuration used',
8, 11, 9, 10);
if ($self->editObj->ttsFlag) {
# Use an editable combobox if TTS allowed in this task...
@comboList3 = sort {lc($a) cmp lc($b)} ($axmud::CLIENT->ivKeys('ttsObjHash'));
my $combo = $self->addComboBox($grid, 'ttsConfig', \@comboList3, '',
FALSE, # 'undef' value used
11, 13, 9, 10);
} else {
# ...otherwise, use a normal entry
$self->addEntry($grid, 'ttsConfig', FALSE,
11, 13, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Command', 'text',
'Interval (secs)', 'int',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'cmdHash');
# Add entries/comboboxes for adding new commands
$self->addLabel($grid, 'Command',
1, 2, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
2, 8, 8, 9);
$self->addLabel($grid, 'Interval',
8, 9, 8, 9);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'int', 1, undef,
9, 12, 8, 9, 4, 4);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
);
# No strip object is selected in the simple list, so reset initialisation widgets
$self->stripsTab_resetInitWidgets(
$noStripString, $noneString,
FALSE,
$entry, $comboBox3, $button9, $button10, $button11, $button12, $button13,
);
});
# Key/value combobox
$comboBox3->signal_connect('changed' => sub {
my $key = $comboBox3->get_active_text();
if ($key && $key ne $noStripString && $key ne $noneString) {
# Sensitise/desensitise widgets, depending on whether this key is a flag, or not
if ($key =~ m/_flag$/) {
$self->desensitiseWidgets($entry, $button9, $button11);
$self->sensitiseWidgets($button12, $button13);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
}
# Reset the simple list
$self->resetListData($slWidget, [@dataList], $columns);
return 1;
}
sub stripsTab_getComboList {
# Called by $self->stripsTab to populate a combobox
#
# Expected arguments
# (none besides $self)
#
# Return values
# An empty list on improper arguments
# A list of combobox items otherwise
my ($self, $check) = @_;
# Local variables
my (
@emptyList, @returnList,
%constHash, %customHash,
);
# Check for improper arguments
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
$self->ivAdd('editHash', 'stripInitList', \@ivList);
return 1;
}
sub stripsTab_updateCombo2 {
# Called by $self->stripsTab
# Sensitise/desensitise the add buttons, depending on whether the strip object specified in
# the combobox is jealous and is already in the list IV
#
# Expected arguments
# $comboBox2, $button, $button2
# - The affected widgets
# $comboHashRef - $axmud::CLIENT->customStripHash, reversed and referenced
# $tempObjHashRef - Reference to a hash of temporary strip objects (so we can access their
# initialisation settings, etc)
#
# Return values
# 'undef' on improper arguments
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
sub stripsTab_setInitWidgets {
# Called by $self->stripsTab
# Sets and sensitises/desensitises the initialisation widgets when a strip object in the
# simple list is selected
#
# Expected arguments
# $number - The number of the selected (matches the position of a two-element
# group in $self->editObj->stripInitList)
# $noStripString, $noneString
# - Text to use in the comboboxes
# $entry, $comboBox3, $button9, $button10, $button11, $button12, $button13
# - List of widgets to desensitise
# %tempObjHash - A hash of temporary strip objects, one for each package name, so we
# can access their IVs
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my (
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
}
sub stripsTab_resetInitWidgets {
# Called by $self->stripsTab
# Resets and desensitises the initialisation widgets when a strip object in the simple list
# is unselected, or when a strip object with an empty initialisation hash is selected
#
# Expected arguments
# $noStripString, $noneString
# - Text to use in the comboboxes
# $flag - Flag set to TRUE if a strip object is selected in the simple list,
# FALSE if not
# $entry, $comboBox3, $button9, $button10, $button11, $button12, $button13
# - List of widgets to desensitise
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my (
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# Reset the simple list
$self->resetListData($slWidget, [@dataList], $columns);
return 1;
}
sub initTab_updateWidgets {
# Called by $self->stripsTab
# Sensitises/desensitises widgets depending on which item is the active one in the combobox
#
# Expected arguments
# $key - The active item in the combobox
# $entry, $button, $button2, $button3, $button4, $button5
# - The widgets to update
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $key, $entry, $button, $button2, $button3, $button4, $button5, $check) = @_;
# Check for improper arguments
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Room name', 'text',
'World command used to get there', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'teleportHash');
# Add entries/comboboxes for adding new variables
$self->addLabel($grid, 'Room name',
1, 3, 8, 9);
my $entry = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 6, 8, 9);
$self->addLabel($grid, 'Equivalent world command',
1, 3, 9, 10);
my $entry2 = $self->addEntryWithIcon($grid, undef, 'string', 1, undef,
3, 12, 9, 10);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
my $button12 = $self->addButton(
$grid,
'Restore defaults',
'Restore default flag colours/priorities',
undef,
8, 12, 12, 13,
TRUE, # Irreversible
);
# Signal connect - combobox
$combo->signal_connect('changed' => sub {
my $descrip = $combo->get_active_text();
# (Set the IV immediately, so ->roomFlags1Tab_refreshList can use it)
$self->editObj->set_roomFlagShowMode($descripHash{$descrip});
# Reset widgets
$self->roomFlags1Tab_refreshList($slWidget, scalar (@columnList / 2), $sortMode);
$entry->set_text('');
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
'Window/task name', 'text',
'Window type', 'text',
);
my $slWidget = $self->addSimpleList($grid, undef, \@columnList,
1, 12, 2, 8);
# Initialise the list
$self->refreshList_hashIV($slWidget, scalar (@columnList / 2), 'reservedHash');
# Add entries/comboboxes for adding windows (zonemodels can't be edited if the parent
# zonemap is a current zonemap in any workspace grid)
if (! $axmud::CLIENT->checkCurrentZonemap($self->editObj->zonemapObj->name)) {
$self->addLabel($grid, 'Window type',
1, 3, 8, 9);
@comboList = ('main', 'map', 'protocol', 'fixed', 'custom', 'external');
my $combo = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # No 'undef' value used
3, 6, 8, 9);
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# my $comboBox = $self->addComboBox($grid, 'some_IV', \@comboList, '', FALSE,
# 0, 6, 0, 1);
#
# Expected arguments
# $grid - The tab's Gtk3::Grid object
# $iv - A string naming the IV set when the user chooses an item in the combo
# box. If 'undef', nothing happens when the user chooses an item in
# the box; it's up to the calling function to check the box's state
# $listRef - Reference to a list with initial values (can be an empty list)
# $title - A string used as a title, e.g. 'Choose your favourite colour' - if an
# empty string, the item at the top of the combobox list is the
# current value of the IV
# $noUndefFlag - If set to TRUE, the combo is populated only with the items in
# $listRef. If set to FALSE (or 'undef'), the first item in the combo
# is an empty value used to set the IV to 'undef'
# $leftAttach, $rightAttach, $topAttach, $bottomAttach
# - The position of the combo box in the grid
#
# Optional arguments
#
# Return values
lib/Games/Axmud/Generic.pm view on Meta::CPAN
) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->addComboBox', @_);
}
# Check that the position in the grid makes sense
if (! $self->checkPosn($leftAttach, $rightAttach, $topAttach, $bottomAttach)) {
return undef;
}
# Create the combobox
my $comboBox = Gtk3::ComboBoxText->new();
# Populate the combobox
if ($title) {
# The first item in the combobox list is a title
$comboBox->append_text($title);
$comboBox->set_active(0);
} elsif ($iv) {
if ($noUndefFlag) {
if (defined $self->editObj->$iv) {
# The first item is the current value of the IV, if there is one
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# Otherwise set the IV to the specified value
} else {
$self->ivAdd('editHash', $iv, $text);
}
}
});
}
# Add the combobox to the grid
$comboBox->set_hexpand(TRUE);
$comboBox->set_vexpand(FALSE);
$grid->attach(
$comboBox,
$leftAttach,
$topAttach,
($rightAttach - $leftAttach),
($bottomAttach - $topAttach),
);
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# 0, 6, 0, 1);
# my $comboBox = $self->useComboBox($grid, 'some_attribute', \@comboList, '',
# 0, 6, 0, 1);
#
# Expected arguments
# $grid - The tab's Gtk3::Grid object
# $attrib - The name of the attribute set when the check button is toggled (matches
# a key in $self->attribHash and GA::Interface::Trigger->attribHash)
# $listRef - Reference to a list with initial values (can be an empty list)
# $title - A string used as a title, e.g. 'Choose your favourite colour' - if an
# empty string, the item at the top of the combobox list is the current
# value of the attribute
# $leftAttach, $rightAttach, $topAttach, $bottomAttach
# - The position of the combo box in the grid
#
# Return values
# 'undef' on improper arguments or if the widget's position in the Gtk3::Grid is invalid
# Otherwise the Gtk3::ComboBox created
my (
$self, $grid, $attrib, $listRef, $title, $leftAttach, $rightAttach, $topAttach,
lib/Games/Axmud/Generic.pm view on Meta::CPAN
) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->useComboBox', @_);
}
# Check that the position in the grid makes sense
if (! $self->checkPosn($leftAttach, $rightAttach, $topAttach, $bottomAttach)) {
return undef;
}
# Create the combobox
my $comboBox = Gtk3::ComboBoxText->new();
# Populate the combobox
if ($title) {
# The first item in the combobox list is a title
$comboBox->append_text($title);
$comboBox->set_active(0);
} else {
$current = $self->editObj->ivShow('attribHash', $attrib);
if ($current) {
# The first item is the current value of the IV, if there is one
$comboBox->append_text($current);
lib/Games/Axmud/Generic.pm view on Meta::CPAN
$self->ivAdd('attribHash', $attrib, '');
# Otherwise set the attribute to the specified value
} else {
$self->ivAdd('attribHash', $attrib, $text);
}
}
});
# Add the combobox to the grid
$comboBox->set_hexpand(TRUE);
$comboBox->set_vexpand(FALSE);
$grid->attach(
$comboBox,
$leftAttach,
$topAttach,
($rightAttach - $leftAttach),
($bottomAttach - $topAttach),
);
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# 1 otherwise
my ($self, $combo, @comboList) = @_;
# Check for improper arguments
if (! defined $combo) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->resetComboBox', @_);
}
# Empty the combobox
my $treeModel = $combo->get_model();
$treeModel->clear();
# Fill it with the new list of items
if (@comboList) {
foreach my $item (@comboList) {
$combo->append_text($item);
}
lib/Games/Axmud/Generic.pm view on Meta::CPAN
}
sub triggerAttributesTab_setColours {
# Called by $self->triggerAttributes2Tab to add radio buttons for setting a colour attribute
#
# Expected arguments
# $grid - The Gtk3::Grid
# $labelText - The label text to use (e.g. 'Text colour')
# $attrib - The attibute to set (e.g. 'style_text')
# $comboListRef - Reference to a list of standard colour tags to display in a combobox
# $row - The Gtk3::Grid row on which the radio buttons are drawn
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $grid, $labelText, $attrib, $comboListRef, $row, $check) = @_;
# Check for improper arguments
if (
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# Return the response
return @emptyList;
}
}
sub showComboDialogue {
# Can be called by any function
# Shows a short message in a 'dialogue' window with the buttons 'ok' and 'cancel'
# Prompts the user to choose a line from a combobox; returns the chosen line if the 'ok'
# button is pressed, but 'undef' if either the cancel button is pressed or the window is
# closed
#
# Expected arguments
# $title - The title to display, e.g. 'File Save'
# $text - The message to display. Can be pango markup text, or just plain text
#
# Optional arguments
# $listRef - Reference to a list of scalars to be used in the combo box. If
# 'undef', the combo box will be empty
lib/Games/Axmud/Generic.pm view on Meta::CPAN
),
);
} else {
$label->set_markup(Glib::Markup::escape_text($text));
}
my $comboBox = Gtk3::ComboBoxText->new();
$vBox2->pack_start($comboBox, FALSE, FALSE, $spacing);
# Fill the combobox with the specified lines, and display the first line
foreach my $line (@$listRef) {
$comboBox->append_text($line);
}
$comboBox->set_active(0);
# Display the 'dialogue' window. Without this combination of Gtk calls, the window is not
# consistently active (don't know why this works; it just does)
$dialogueWin->show_all();
$dialogueWin->present();
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# Don't use TTS to read out the same combo item consecutively
$lastThing = $text;
return undef;
});
$comboBox->signal_connect('changed' => sub {
my $text = $comboBox->get_active_text();
# (Use the mouse to focus on the combobox)
if (! defined $lastThing || $lastThing ne $text) {
$axmud::CLIENT->ttsAddUrgentJob(
$text . ' selected',
'dialogue',
TRUE,
);
}
# Don't use TTS to read out the same combo item consecutively
$lastThing = $text;
return undef;
});
# Make sure that the first item in the combobox has been read out
if (! defined $lastThing || (@$listRef && $lastThing ne $$listRef[0])) {
if (@$listRef) {
$axmud::CLIENT->ttsAddUrgentJob(
$$listRef[0] . ' selected',
'dialogue',
);
} else {
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# my $comboBox = $self->addComboBox(
# $grid, undef, \@comboList, '', FALSE,
# 0, 6, 0, 1);
#
# The referenced function (if specified) receives an argument list in the form:
# ($self, combo_box_widget, selected_text)
#
# Expected arguments
# $grid - The Gtk3::Grid itself
# $funcRef - Reference to the function to call when the user selects something in
# the combobox. If 'undef', it's up to the calling function to create
# a ->signal_connect method
# $listRef - Reference to a list with initial values (can be an empty list)
# $title - A string used as a title, e.g. 'Choose your favourite colour' - if
# 'undef', a title isn't used (use an empty string for an initially-
# empty combobox)
# $leftAttach, $rightAttach, $topAttach, $bottomAttach
# - The position of the combo box in the table
#
# Return values
# 'undef' on improper arguments or if the widget's position in the Gtk3::Grid is invalid
# Otherwise the Gtk3::ComboBox created
my (
$self, $grid, $funcRef, $listRef, $title, $leftAttach, $rightAttach, $topAttach,
$bottomAttach, $check,
lib/Games/Axmud/Generic.pm view on Meta::CPAN
) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->addComboBox', @_);
}
# Check that the position in the table makes sense
if (! $self->checkPosn($leftAttach, $rightAttach, $topAttach, $bottomAttach)) {
return undef;
}
# Create the combobox
my $comboBox = Gtk3::ComboBoxText->new();
# Populate the combobox
if (defined $title) {
# The first item in the combobox list is a title
$comboBox->append_text($title);
}
foreach my $item (@$listRef) {
$comboBox->append_text($item);
}
$comboBox->set_active(0);
lib/Games/Axmud/Generic.pm view on Meta::CPAN
my $text = $comboBox->get_active_text();
# If the user has selected the title, ignore it
if (! defined $title || $text ne $title) {
&$funcRef($self, $comboBox, $text);
}
});
}
# Add the combobox to the grid
$comboBox->set_hexpand(TRUE);
$comboBox->set_vexpand(FALSE);
$grid->attach(
$comboBox,
$leftAttach,
$topAttach,
($rightAttach - $leftAttach),
($bottomAttach - $topAttach),
);
lib/Games/Axmud/Obj/MiniWorld.pm view on Meta::CPAN
_parentWorld => undef, # No parent file
_privFlag => FALSE, # All IVs are public
# IVs
# ---
# The GA::Profile::World object (or GA::Obj::BasicWorld) and its ->name
name => $name,
worldObj => $worldObj,
# An IV initially set to the world profile's last connected character (might be set
# to 'undef'. When the user selects a character from the table's combobox, this IV is
# set to that value (or to 'undef' if the 'no character' item is selected)
selectChar => $selectChar,
# Login account mode - whether an account name is needed to login to this world, as well
# as the usual character name/password. Used only to set the label text in some of
# the Connections window's 'dialogue' windows; doesn't affect the automatic login
# process
loginAccountMode => $loginAccountMode,
# Hash of IVs, in the form
# $propHash{iv_name} = scalar_value
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
sub resetComboBox {
# Called by $self->createGridWidgets, ->resetGridWidgets and ->updateGridWidgets
# Not sure how to empty a Gtk3::ComboBox, so we'll just destroy the old one, and replace it
# with a new one
#
# Expected arguments
# (none besides $self)
#
# Optional arguments
# $destroyFlag - If TRUE, a combobox already exists, and must be deleted. If FALSE (or
# 'undef'), the combobox is being drawn for the first time
# @charList - A list of characters to display in the combobpx. If empty, the
# combobox will contain only the '<no character>' string. If not
# empty, the '<no character>' is added to @charList as the first item
#
# Return values
# 'undef' on improper arguments
# Otherwise returns the Gtk3::ComboBox created
my ($self, $destroyFlag, @charList) = @_;
# Local variables
my ($count, $index);
# (No improper arguments to check)
# If a Gtk3::ComboBox already exists, destroy it
if ($destroyFlag) {
$axmud::CLIENT->desktopObj->removeWidget($self->grid, $self->comboBox);
}
# Create a new combobox
unshift (@charList, $self->noCharString);
my $comboBox = $self->addComboBox($self->grid, undef, \@charList, undef,
4, 8, 7, 8);
# If the current mini-world object specifies a character, make that the combobox's active
# item. Otherwise, make the '<no character>' string the active item
$index = 0;
if ($self->miniWorldObj && $self->miniWorldObj->selectChar) {
$count = -1;
OUTER: foreach my $string (@charList) {
$count++;
if ($string eq $self->miniWorldObj->selectChar) {
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
$self->editPwdButton->set_sensitive(TRUE);
$self->editAccButton->set_sensitive(TRUE);
} else {
$self->editPwdButton->set_sensitive(FALSE);
$self->editAccButton->set_sensitive(FALSE);
}
}
# Now we can add the combobox's ->signal_connect, which updates the mini-world object when
# a character is selected
$comboBox->signal_connect('changed' => sub {
my $char = $comboBox->get_active_text();
if ($char eq $self->noCharString) {
$self->miniWorldObj->ivUndef('selectChar');
# When no character is selected, the 'pwd'/'account' buttons must be desensitised
$self->editPwdButton->set_sensitive(FALSE);
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
} else {
$self->miniWorldObj->ivPoke('selectChar', $char);
# When no character is selected, the 'pwd'/'account' buttons must be desensitised
$self->editPwdButton->set_sensitive(TRUE);
$self->editAccButton->set_sensitive(TRUE);
}
});
# The call to ->show_all() makes the new combobox visible
$self->winShowAll($self->_objClass . '->resetComboBox');
return $comboBox;
}
sub updateProfile {
# Called by $self->applyChangesCallback and ->connectWorldCallback
# Copies changes to values, stored in the specified mini-world object, to the corresponding
# world profile (if it exists)
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
$self->miniWorldObj->ivAdd('newAccountHash', $char, $account);
} else {
$self->miniWorldObj->ivAdd('accountHash', $char, undef);
$self->miniWorldObj->ivAdd('newAccountHash', $char, undef);
}
$self->miniWorldObj->ivPoke('selectChar', $char);
# Redraw the combobox
@charList = sort {lc($a) cmp lc($b)} ($self->miniWorldObj->ivKeys('passwordHash'));
my $comboBox = $self->resetComboBox(TRUE, @charList);
$self->ivPoke('comboBox', $comboBox);
}
return 1;
}
sub editPasswordCallback {
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# Local variables
my ($char, $currentPass, $newPass);
# Check for improper arguments
if (! defined $widget || defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->editPasswordCallback', @_);
}
# Get the character displayed in the combobox
$char = $self->comboBox->get_active_text();
if (! $char || $char eq $self->noCharString) {
# No character to edit
return undef;
}
# Get the current password for this character (if any)
$currentPass = $self->miniWorldObj->ivShow('passwordHash', $char);
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# Local variables
my ($string, $char, $currentAccount, $newAccount);
# Check for improper arguments
if (! defined $widget || defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->editAccountCallback', @_);
}
# Get the character displayed in the combobox
$char = $self->comboBox->get_active_text();
if (! $char || $char eq $self->noCharString) {
# No character to edit
return undef;
}
# Get the current account for this character (if any)
$currentAccount = $self->miniWorldObj->ivShow('accountHash', $char);
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
}
# Character name and password
if (defined $testList[3] && defined $testList[4]) {
$self->miniWorldObj->ivAdd('passwordHash', $testList[3], $testList[4]);
$self->miniWorldObj->ivAdd('newPasswordHash', $testList[3], $testList[4]);
$self->miniWorldObj->ivPoke('selectChar', $testList[3]);
# Redraw the combobox
@charList
= sort {lc($a) cmp lc($b)} ($self->miniWorldObj->ivKeys('passwordHash'));
my $comboBox = $self->resetComboBox(TRUE, @charList);
$self->ivPoke('comboBox', $comboBox);
}
# Mark the number of connections to be set to at least 1
$self->miniWorldObj->ivPoke('testModeFlag', TRUE);
}
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->drawWidgets', @_);
}
# Standard spacing
$spacing = $axmud::CLIENT->constFreeSpacingPixels;
# Import the current Locator task (if any) and current dictionary
$dictObj = $self->session->currentDict;
# A list of word types in the order they'll appear in their combobox
@typeList = (
'sentient',
'creature',
'portable',
'decoration',
'race',
'guild',
'weapon',
'armour',
'garment',
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
my $comboBox2 = Gtk3::ComboBoxText->new();
$vBox2->pack_start($comboBox2, FALSE, FALSE, 0);
$comboBox2->set_active(0);
# Starts desensitised
$comboBox2->set_sensitive(FALSE);
my $separator = Gtk3::HSeparator->new();
$vBox2->pack_start($separator, FALSE, FALSE, 0);
# Add a fourth widget group, comboboxes to select the types of word
my $label = Gtk3::Label->new('What kind of word is this?');
$vBox2->pack_start($label, FALSE, FALSE, 0);
$label->set_alignment(0, 0.5);
my $hBox2 = Gtk3::HBox->new(FALSE, 0);
$vBox2->pack_start($hBox2, FALSE, FALSE, 5);
my $comboBox3 = Gtk3::ComboBoxText->new();
$hBox2->pack_start($comboBox3, TRUE, TRUE, 0);
foreach my $type (@typeList) {
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
});
my $button4 = Gtk3::Button->new('Close');
$hBox3->pack_end($button4, TRUE, TRUE, 0);
$button4->signal_connect('clicked' => sub {
$self->winDestroy();
});
$button4->set_tooltip_text('Close the window');
# Set the initial contents of the first two comboboxes
$self->refreshCombos($dictObj, $comboBox, $comboBox2);
# ->signal_connects
# Radio buttons. Toggling them sensitises/desensitises the first three widgets
$radioButton->signal_connect('toggled' => sub {
if ($radioButton->get_active()) {
$entry->set_sensitive(TRUE);
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
$button2->set_sensitive(TRUE);
}
});
# Fourth group
$comboBox3->signal_connect('changed' => sub {
my $type = $comboBox3->get_active_text();
if ($type) {
# Empty the 'type of portable/decoration' combobox, in case we need to refill it
if ($comboBoxCount) {
for (my $count = ($comboBoxCount - 1); $count >= 0; $count--) {
$comboBox4->remove_text($count);
}
}
# Refill the lower combobox, if necessary
if ($type eq 'portable') {
foreach my $custom ($dictObj->portableTypeList) {
$comboBox4->append_text($custom);
}
$comboBox4->set_active(0);
$comboBox4->set_sensitive(TRUE);
$comboBoxCount = scalar $dictObj->portableTypeList;
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
$comboBox4->append_text($custom);
}
$comboBox4->set_active(0);
$comboBox4->set_sensitive(TRUE);
$comboBoxCount = scalar $dictObj->decorationTypeList;
} else {
# If it's not a portable or decoration, the lower combobox must be insensitive
$comboBox4->set_sensitive(FALSE);
$comboBoxCount = 0;
}
if (
$type eq 'pseudo-noun'
|| $type eq 'pseudo-adjective'
|| $type eq 'pseudo-object'
) {
# Make the replacement string entry sensitive
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# sub redrawWidgets {} # Inherited from GA::Generic::Win
# ->signal_connects
# Other functions
sub refreshCombos {
# Called by $self->drawWidgets
# Refreshes the contents of the first two comboboxes
#
# Expected arguments
# $dictObj - The current dictionary
# $comboBox, $comboBox2
# - The comboboxes to refresh
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $dictObj, $comboBox, $comboBox2, $check) = @_;
# Local variables
my (
$taskObj,
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
$obj->noun,
$obj->otherNounList,
$obj->adjList,
$obj->pseudoAdjList,
$obj->unknownWordList,
);
foreach my $word (@wordList) {
# If the word isn't in the current dictionary, mark it to be added to the
# combobox. Use a hash to eliminate duplicates
if (
! $dictObj->ivExists('combNounHash', $word)
&& ! $dictObj->ivExists('combAdjHash', $word)
) {
$wordHash{$word} = undef;
}
}
}
# Convert the hash to a sorted list
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
}
# Import the list of Axmud standard colour/style tags (which also includes the dummy tags
# like 'bold', 'reverse_off' and 'attribs_off')
@tagList = $axmud::CLIENT->constColourStyleList;
# (For convenience, add 'attribs_off' to both the beginning and end of the list)
unshift(@tagList, 'attribs_off');
# Also import the hash of pretty names for each standard tag, in which the keys are the
# items in @tagList
%prettyHash = $axmud::CLIENT->constPrettyTagHash;
# Use a reverse hash too, so we can work out which combobox item was selected
%reversePrettyHash = reverse %prettyHash;
# Prepare a hash of ANSI escape sequences which the user can insert at any place in the
# textview, in the form
# $ansiHash{tag} = number_of_ANSI_escape_sequence
%ansiHash = (
(reverse $axmud::CLIENT->constANSIColourHash),
(reverse $axmud::CLIENT->constANSIStyleHash),
);
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
}
# Reset the simple list
$self->resetListData($slWidget, [@dataList], $columns);
return 1;
}
sub workspaces6Tab_resetCombo {
# Called by $self->workspaces6Tab to reset the contents of the first combobox
#
# Expected arguments
# $combo - The combobox whose contents should be reset
# $title - The title used in the combobox
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $combo, $title, $check) = @_;
# Local variables
my @comboList;
# Check for improper arguments
if (! defined $combo || ! defined $title || defined $check) {
return $axmud::CLIENT->writeImproper(
$self->_objClass . '->workspaces6Tab_resetCombo',
@_,
);
}
# Compile a list of combobox items
@comboList = sort {$a <=> $b} ($axmud::CLIENT->desktopObj->ivKeys('workspaceHash'));
unshift (@comboList, $title);
# Reset the combobox
$self->resetComboBox($combo, @comboList);
return 1;
}
sub workspaces6Tab_resetCombo2 {
# Called by $self->workspaces6Tab to reset the contents of the second combobox
#
# Expected arguments
# $combo - The combobox whose contents should be reset
# $title - The title used in the combobox
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $combo, $title, $check) = @_;
# Local variables
my @comboList;
# Check for improper arguments
if (! defined $combo || ! defined $title || defined $check) {
return $axmud::CLIENT->writeImproper(
$self->_objClass . '->workspaces6Tab_resetCombo2',
@_,
);
}
# Compile a list of combobox items
@comboList = sort {lc($a) cmp lc($b)} ($axmud::CLIENT->ivKeys('zonemapHash'));
unshift (@comboList, $title);
# Reset the combobox
$self->resetComboBox($combo, @comboList);
return 1;
}
sub workspaces7Tab {
# Workspaces7 tab
#
# Expected arguments
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
$self->ivPoke('searchRegion', $combo->get_active_text());
}
});
$radioButton3->signal_connect('toggled' => sub {
$self->ivPoke('searchAllFlag', FALSE);
$self->ivPoke('searchRegion', $combo->get_active_text());
});
# This radiobutton and its combobox are insensitive, if there are no regions
if (! $self->session->worldModelObj->regionmapHash) {
$radioButton3->set_state('insensitive');
$combo->set_state('insensitive');
}
# Bottom section
$self->addLabel($grid, '<i>Specify which categories of model object to search</i>',
1, 12, 6, 7);
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
});
$self->ivAdd('searchTypeHash', $iv, $ivType);
return 1;
}
sub propertiesTab_addComboBox {
# Called by several $self->propertiesXXX tabs
# Adds a single line to the tab with a main checkbutton, a label and a combobox
#
# Expected arguments
# $grid - The Gtk3::Grid for this tab
# $iv - The IV to add to the search - matches a key in $self->searchHash
# $ivType - What kind of checking should be done on thiss IV (see the comments in
# ->new)
# $label - The accompanying label text
# $listRef - Reference to a list containing the values to put in the combobox
# $topAttach - The position of the line in the grid
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $grid, $iv, $ivType, $label, $listRef, $topAttach, $check) = @_;
# Check for improper arguments
if (
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
return $axmud::CLIENT->writeImproper(
$self->_objClass . '->propertiesTab_addComboBox',
@_,
);
}
# Add a checkbutton which turns on/off checking this IV completely
my $checkButton = $self->addCheckButton($grid, $label, undef, TRUE,
1, 6, $topAttach, ($topAttach + 1));
# Add a combobox
my $combo = $self->addComboBox($grid, undef, $listRef, '',
TRUE, # No 'undef' value used
6, 12, $topAttach, ($topAttach + 1));
# Signal connects
$checkButton->signal_connect('toggled' => sub {
if ($checkButton->get_active()) {
$self->ivAdd('searchHash', $iv, $combo->get_active_text());
} else {
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
});
$self->ivAdd('searchTypeHash', $iv, $ivType);
return 1;
}
sub propertiesTab_addEntryWithRange {
# Called by several $self->propertiesXXX tabs
# Adds a single line to the tab with a main checkbutton, a label, a combobox specifiying an
# operator (equals, less than, etc) and one or two entry boxes
# Used with IVs that have numeric values
#
# Expected arguments
# $grid - The Gtk3::Grid for this tab
# $iv - The IV to add to the search - matches a key in $self->searchHash
# $ivType - What kind of checking should be done on this IV (see the comments in
# ->new)
# $label - The accompanying label text
# $mode - What kind of value is expected - should be 'int' or 'float'
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
if ($comboBox->get_active() == 1) {
$self->interfaces1Tab_refreshList(
$self->ivShow('editConfigHash', 'interface_list_all'),
scalar (@columnList / 2),
'all',
);
} else {
# Updating the combobox, refreshes the simple list
$comboBox->set_active(1);
}
}
});
my $button3 = $self->addButton($grid,
'Move up', 'Move the selected active interface up the list', undef,
8, 10, 10, 11);
$button3->signal_connect('clicked' => sub {
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
if ($comboBox->get_active() == 1) {
$self->interfaces1Tab_refreshList(
$self->ivShow('editConfigHash', 'interface_list_all'),
scalar (@columnList / 2),
'all',
);
} else {
# Updating the combobox, refreshes the simple list
$comboBox->set_active(1);
}
}
}
});
my $button4 = $self->addButton($grid,
'Move down', 'Move the selected active interface down the list', undef,
10, 12, 10, 11);
$button4->signal_connect('clicked' => sub {
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
if ($comboBox->get_active() == 1) {
$self->interfaces1Tab_refreshList(
$self->ivShow('editConfigHash', 'interface_list_all'),
scalar (@columnList / 2),
'all',
);
} else {
# Updating the combobox, refreshes the simple list
$comboBox->set_active(1);
}
}
}
});
my $button5 = $self->addButton(
$grid,
'Edit ' . $category . ' interface model...',
'Edit the model for this type of interface',
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
if ($comboBox->get_active() == 1) {
$self->interfaces1Tab_refreshList(
$self->ivShow('editConfigHash', 'interface_list_all'),
scalar @dataList,
'all',
);
} else {
# Updating the combobox, refreshes the simple list
$comboBox->set_active(1);
}
return 1;
}
sub tasksTab {
# Tasks tab
#
lib/Games/Axmud/Table.pm view on Meta::CPAN
# parent strip object's Gtk3::Grid for use exclusively by this table
# object. 'temp' for temporary table objects
#
# Optional arguments
# %initHash - A hash containing arbitrary data to use as the table object's
# initialisation settings. The table object should use default
# initialisation settings unless it can succesfully interpret one or more
# of the key-value pairs in the hash, if there are any
# - This type of table object recognises these initialisation settings:
#
# 'func' - Reference to a function to call when an item in the combobox
# is selected. If not specified or 'undef', it's up to the calling
# code to create its own ->signal_connect. To obtain a reference to an
# OOP method, you can use the generic object function
# Games::Axmud->getMethodRef()
# 'id' - A value passed to the function which identifies the button. If
# specified, can be any value except 'undef'. It's up to the
# calling code to keep track of the widgets it has created and their
# corresponding 'id' values
# 'list_ref' - Reference to a list used to fill the combobox. If 'undef'
# or if the referenced list is empty, the combobox is empty
# 'title' - A string to use as the combobox's title, e.g. 'Choose your
# favourite cat'. If 'undef', a title isn't used
# 'tooltips' - The text to display as tooltips for the button. Can be
# plain text or pango markup text. If not specified, 'undef' or an
# empty string, no tooltips are displayed
# 'normal_flag' - If TRUE (or not specified), the button's state is
# 'normal'. If FALSE, the button's state is 'insensitive' (nothing can
# interact with it)
# 'expand_flag' - Deprecated since v1.2.170; ignored if specified
# 'expand_horizontal_flag' - If TRUE or unspecified, the table object
# expands horizontally; if FALSE, it doesn't
lib/Games/Axmud/Table.pm view on Meta::CPAN
# The container widget(s) for this table object
packingBox => undef, # Gtk3::Grid
packingBox2 => undef, # Gtk3::Grid
# Other IVs
# ---------
# Widgets
comboBox => undef, # Gtk3::ComboBox
# Item in the combobox used as a title ('undef' if no title specified). Set by
# $self->objEnable from $self->initHash
title => undef,
};
# Bless the object into existence
bless $self, $class;
return $self;
}
lib/Games/Axmud/Table.pm view on Meta::CPAN
if (defined $title) {
$comboBox->append_text($title);
}
foreach my $item (@$listRef) {
$comboBox->append_text($item);
}
# The first item in the combobox is the first one selected
$comboBox->set_active(0);
if (defined $tooltips && $tooltips ne '') {
$comboBox->set_tooltip_markup($tooltips);
}
if (! $normalFlag) {
$comboBox->set_state('insensitive');
lib/Games/Axmud/Table.pm view on Meta::CPAN
});
return 1;
}
# Other functions
sub resetCombo {
# Can be called by anything
# Resets the appearance of the combobox
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $check) = @_;
lib/Games/Axmud/Table.pm view on Meta::CPAN
sub set_list {
my ($self, $title, @list) = @_;
# Local variables
my ($funcRef, $model);
# (No improper arguments to check)
# Temporarily resetting $self->funcRef prevents the ->signal_connect from calling that
# function while we're resetting the combobox
$funcRef = $self->funcRef;
$self->ivUndef('funcRef');
# Empty the combobox...
$model = $self->comboBox->get_model();
$model->clear();
# ...and refill it (if specified)
if (defined $title) {
$self->comboBox->append_text($title);
$self->ivPoke('title', $title);
} else {
$self->ivUndef($title);
}
foreach my $item (@list) {
$self->comboBox->append_text($item);
}
# The first item in the combobox is the first one selected
$self->comboBox->set_active(0);
$self->comboBox->popdown();
# Restore the combobox to normal operations
$self->ivPoke('funcRef', $funcRef);
return 1;
}
sub set_normal {
my ($self, $flag, $check) = @_;
# Check for improper arguments
lib/Games/Axmud/Table.pm view on Meta::CPAN
return TRUE;
} else {
return FALSE;
}
return 1;
}
sub get_text {
# Returns 'undef' if the combobox's title is selected
my ($self, $check) = @_;
# Local variables
my $text;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->get_text', @_);
lib/Games/Axmud/Table.pm view on Meta::CPAN
# Optional arguments
# %initHash - A hash containing arbitrary data to use as the table object's
# initialisation settings. The table object should use default
# initialisation settings unless it can succesfully interpret one or more
# of the key-value pairs in the hash, if there are any
# - This type of table object recognises these initialisation settings:
#
# 'frame_title' - If specified, the table object is drawn inside a frame
# with the specified title. If 'undef', an empty string or not
# specified, the table object does not use a frame and title
# 'func' - Reference to a function to call when an item in the combobox
# is selected. If not specified or 'undef', it's up to the calling
# code to create its own ->signal_connect. To obtain a reference to an
# OOP method, you can use the generic object function
# Games::Axmud->getMethodRef()
# 'id' - A value passed to the function which identifies the button. If
# specified, can be any value except 'undef'. It's up to the
# calling code to keep track of the widgets it has created and their
# corresponding 'id' values
# 'column_ref' - Reference to a list of column headings and types, in the
# form ('heading', 'column_type', 'heading', 'column_type'...), where
lib/Games/Axmud/Task.pm view on Meta::CPAN
50, 59, 0, 11,
undef,
# Init settings
'func' => $self->getMethodRef('radioButtonCallback'),
'id' => 'button_2',
'text' => 'Enable',
'select_flag' => FALSE,
'group' => $radioTableObj->group,
);
# Create a combobox and an entry so that the user can set new values in $self->keypadCmdHash
$self->winObj->tableStripObj->addTableObj(
'Games::Axmud::Table::Label',
30, 39, 12, 23,
undef,
# Init settings
'text' => 'Keycode',
);
@comboList = (
'kp_0',
lib/Games/Axmud/Task.pm view on Meta::CPAN
$self->enable(TRUE);
}
return 1;
}
sub miniEntryCallback {
# Called by a ->signal_connect in a GA::Table::Entry object when the user types something
# in the entry box and presses ENTER
# Finds the keycode currently displayed in the combobox and updates both the macro and the
# Gtk3::Button for that keycode
#
# Expected arguments
# $entryTableObj - The GA::Table::Entry object for the entry
# $entry - The actual Gtk3::Entry used
# $id - The callback ID; in this case, an empty string
# $text - The text entered by the user (may be an empty string)
#
# Return values
# 'undef' on improper arguments, if no keycode has been selected in the combobox, if
# nothing has been typed in the entry box or for a general error
# 1 otherwise
my ($self, $entryTableObj, $entry, $id, $text, $check) = @_;
# Local variables
my ($cmd, $keycode, $buttonTableObj, $interfaceObj);
# Check for improper arguments
if (
! defined $entryTableObj || ! defined $entry || ! defined $id || ! defined $text
|| defined $check
) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->miniEntryCallback', @_);
}
# Get the text entered in the Gtk3::Entry and trim leading/trailing whitespace
$cmd = $axmud::CLIENT->trimWhitespace($text);
# Retrieve the last value selected in the combobox, which will be a standard keycode
$keycode = $self->comboTableObj->get_text();
if (! defined $keycode || ! $self->ivExists('keypadCmdHash', $keycode) || ! $cmd) {
# No selection made in the combobox. Reset both the entry and the combobox
$entryTableObj->set_text();
$self->comboTableObj->resetCombo();
return undef;
}
# Update the main IV
$self->ivAdd('keypadCmdHash', $keycode, $cmd);
# Find the corresponding button
lib/Games/Axmud/Task.pm view on Meta::CPAN
return $axmud::CLIENT->writeImproper($self->_objClass . '->createWidgets', @_);
}
# Add a textview to display the notes
if ($self->session->currentWorld->notepadList) {
$string = join("\n", $self->session->currentWorld->notepadList);
} else {
$string = '';
}
# I experimented with the table coordinates to stop the combobox/buttons appearing too
# high. For unknown reasons, the best arrangement is to leave a one-row gap between the
# textview and the combobox/buttons beneath it
$textTableObj = $self->winObj->tableStripObj->addTableObj(
'Games::Axmud::Table::TextView',
0, 59, 0, 57,
undef,
# Init settings
'func' => $self->getMethodRef('textViewCallback'),
'text' => $string,
'edit_flag' => TRUE,
'colour_scheme' => 'edit',
'spacing' => 0,
lib/Games/Axmud/Task.pm view on Meta::CPAN
my ($profile, $profObj);
# Check for improper arguments
if (
! defined $tableObj || ! defined $textView || ! defined $buffer || ! defined $id
|| ! defined $text || defined $check
) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->textViewCallback', @_);
}
# Get the combobox's active profile
$profile = $self->comboTableObj->get_text();
$profObj = $self->session->ivShow('profHash', $profile);
# Update the selected profile's IV
if ($profObj) {
if ($text) {
$profObj->ivPoke('notepadList', split("\n", $text));
} else {
$profObj->ivEmpty('notepadList');
}
}
return 1;
}
sub comboCallback {
# Called by a ->signal_connect in a GA::Table::Button object when the user selects a
# profile in the combobox
# Updates the contents of the textview to show notes for that profile
#
# Expected arguments
# $tableObj - The GA::Table::ComboBox object for the combobox
# $comboBox - The actual Gtk3::ComboBox used
# $id - The callback ID; in this case, an empty string
# $profile - The selected world profile
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $tableObj, $comboBox, $id, $profile, $check) = @_;
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
);
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->resetRoomDataCallback', @_);
}
# (No standard callback check)
# Prepare combobox lists
@list = (
'Room titles' => 'title',
'Verbose descriptions' => 'descrip',
'Room tags' => 'room_tag',
'Room guilds' => 'room_guild',
'Room flags' => 'room_flag',
'Room commands' => 'room_cmd',
'Unspecified room patterns' => 'unspecified',
'Exit/depature patterns' => 'exit_depart',
'Checked directions' => 'checked_dir',
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
);
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->resetVisitsCallback', @_);
}
# (No standard callback check)
# Prepare a list of character strings for a combobox
foreach my $profObj ($self->session->ivValues('profHash')) {
if (
$profObj->category eq 'char'
&& (
! $self->session->currentChar
|| $self->session->currentChar ne $profObj
)
) {
push (@charNameList, $profObj->name);
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
if ($self->session->currentChar) {
$currentCharString = 'Current character (' . $self->session->currentChar->name . ')';
push (@charStringList, $currentCharString);
}
$allCharString = 'All character profiles';
$unCharString = 'All characters without profiles';
push (@charStringList, $allCharString, $unCharString, @charNameList);
# Prepare region strings for a second combobox
if ($self->currentRegionmap) {
$thisRegionString = 'Current region (' . $self->currentRegionmap->name . ')';
push (@regionStringList, $thisRegionString);
}
$allRegionString = 'All regions';
push (@regionStringList, $allRegionString);
# Prompt the user to specify which characters/regions to reset
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
if (! @useList) {
return $self->showMsgDialogue(
'Add contents',
'error',
'There are no objects to add',
'ok',
);
}
# Prepare a list of strings to display in a combobox
foreach my $obj (@useList) {
my $line;
if ($obj->category eq 'portable' || $obj->category eq 'decoration') {
$line = $obj->name . ' [' . $obj->category . ' - ' . $obj->type . ']';
} else {
$line = $obj->name . ' [' . $obj->category . ']';
}
push (@comboList, $line);
$comboHash{$line} = $obj;
}
# If there is more than one object that could be added, create something at the top of the
# combobox that lets the user add them all
if (@comboList > 1) {
$allString = '<add all ' . scalar @comboList . ' objects>';
unshift (@comboList, $allString);
}
# Prompt the user to select an object
$choice = $self->showComboDialogue(
'Select object',
'Choose which object(s) to add to the world model',
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
if (! defined $string) {
# User clicked 'cancel' or closed the window
return undef;
} else {
# Try to parse the string into a list of objects. The TRUE argument tells the
# function to treat 'two hairy orcs' as a single object, with its
# ->multiple IV set to 2, so that the same strings don't appear in the combobox
# more than once (hopefully)
@useList = $self->worldModelObj->parseObj($self->session, TRUE, $string);
}
}
# Don't prompt for an object, if there are none available
if (! @useList) {
return $self->showMsgDialogue(
'Add hidden object',
'error',
'There are no objects to add',
'ok',
);
}
# Prepare a list of strings to display in a combobox
foreach my $obj (@useList) {
my $line;
if ($obj->category eq 'portable' || $obj->category eq 'decoration') {
$line = $obj->name . ' [' . $obj->category . ' - ' . $obj->type . ']';
} else {
$line = $obj->name . ' [' . $obj->category . ']';
}
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
# We didn't show 'northnortheast' the first time, but there are not many primary
# directions from which the user can choose; in fact, @comboList probably consists of
# just 'up' and 'down' (which is why we test @comboList <= 2)
# Add 'northnortheast', so the user has more choices
@extraList = $self->getAvailableDirs($roomObj, @longList);
$extraComboItem = shift @extraList;
push (@comboList, @extraList);
}
# The exit's current allocated direction, if available, should be the first item in the
# combobox
if ($firstComboItem) {
unshift(@comboList, $firstComboItem);
} elsif ($extraComboItem) {
unshift(@comboList, $extraComboItem);
}
# Don't prompt for a direction, if there are none available
if (! @comboList) {
return $self->showMsgDialogue(
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
# The specified style is the preferred one
$self->worldModelObj->set_mapLabelStyle($style);
return 1;
}
sub selectLabelCallback {
# Called by $self->enableLabelsColumn
# Prompts the user to select a label, from a combobox listing all the labels in the current
# regionmap
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments or if the standard callback check fails
# 1 otherwise
my ($self, $check) = @_;
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
if (! @sortedList) {
return $self->showMsgDialogue(
'Select label',
'error',
'There are no labels in this region',
'ok',
);
}
# Prepare the contents of a combobox. Those labels which aren't on the currently displayed
# level are marked as being on a different level
foreach my $obj (@sortedList) {
my $string;
if ($obj->level == $self->currentRegionmap->currentLevel) {
$string = $obj->name;
} else {
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
}
return @returnList;
}
sub compileExitList {
# Called by several functions
# Returns a list containing the selected exit, its twin exit (if it has one), and any exits
# for which those two are the shadow exits
# Also returns a hash, ready for display in a combobox, so that the user can select the
# exit(s) on which to perform an operation
#
# Expected arguments
# (none besides $self)
#
# Return values
# An empty list on improper arguments
# Otherwise the list containing two elements, a reference to @stringList and a reference
# to %exitHash
# %exitHash is in the form
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
$twinExitObj
= $self->worldModelObj->ivShow('exitModelHash', $self->selectedExit->twinExit);
if ($twinExitObj) {
push (@exitList, $twinExitObj);
}
}
# Add entries to a hash that we use to populate a combobox
foreach my $exitObj (@exitList) {
my $string = '#' . $exitObj->number . ' ' . $exitObj->dir . ' (room #'
. $exitObj->parent . ')';
push (@stringList, $string);
$exitHash{$string} = $exitObj;
}
# Check the parent room(s) of the exit (and its twin exit, if there is one)
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
# The call to ->addDialogueIcon splits $vBox in two, with an icon on the left, and a new
# Gtk3::VBox on the right, into which we put everything
my $vBox2 = $self->addDialogueIcon($vBox);
# Add widgets
my ($entry, $entry2, $entry3, $entry4, $comboBox, $comboBox2);
# Called by $self->addExitCallback or ->changeDirCallback
if (! $exitObj || ($exitObj && $mode eq 'change_dir')) {
# Work out which map directon should be displayed in the first combobox (corresponds
# to GA::Obj::Exit->mapDir, if defiend)
if ($exitObj && $exitObj->mapDir && $mode eq 'change_dir') {
# Use the existing exit's map direction, ->mapDir (if defined). Does this direction
# already exist in @availableList?
if (@availableList) {
OUTER: for (my $count = 0; $count < @availableList; $count++) {
if ($availableList[$count] eq $exitObj->mapDir) {
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
unshift(@availableList, $exitObj->mapDir);
$match = 0;
}
} else {
# Use the first map direction in the list initially
$match = 0;
}
# Add a combobox to choose the map direction
my $label = Gtk3::Label->new();
$vBox2->pack_start($label, FALSE, FALSE, 5);
$label->set_alignment(0, 0);
$label->set_markup('Standard map direction, e.g. <i>\'north\' </i>');
$comboBox = Gtk3::ComboBoxText->new();
$vBox2->pack_start($comboBox, FALSE, FALSE, 5);
foreach my $dir (@availableList) {
$comboBox->append_text($dir);
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
$entry = Gtk3::Entry->new();
$vBox2->pack_start($entry, FALSE, FALSE, 5);
if ($exitObj && $mode eq 'change_dir') {
# The entry should contain the existing exit object's nominal direction
$entry->set_text($exitObj->dir);
} else {
# The entry should contain the same direction selected in the combobox, unless the
# user manually types a different value
if (@availableList) {
$entry->set_text(
$self->session->currentDict->ivShow(
'primaryDirHash',
$availableList[0],
),
);
}
}
# When the user selects a new direction in the combobox, automatically update the entry
# (unless it's a call from ->changeDirCallback, in which case we only update the entry
# if it originally matched the map direction - this prevents the unfortunate situation
# of an exit whose ->mapDir is 'north' and whose ->dir is 'in' from having both set to
# 'northwest', when the user only meant to change the map direction
if ($exitObj && $mode eq 'change_dir') {
# (This function called by ->changeDirCallback)
$comboBox->signal_connect('changed' => sub {
my ($text, $customDir);
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
$entry4 = Gtk3::Entry->new();
$vBox2->pack_start($entry4, FALSE, FALSE, 5);
$entry4->set_text($exitObj->dir);
$entry4->set_sensitive(FALSE);
}
# Called by $self->addExitCallback or ->setAssistedMoveCallback
if (! $exitObj || ($exitObj && $mode eq 'set_assist')) {
# Add a combobox and an entry to add an optional key-value pair to ->assistedMoveHash
my $label4 = Gtk3::Label->new();
$vBox2->pack_start($label4, FALSE, FALSE, 5);
$label4->set_alignment(0, 0);
if (! $exitObj) {
$label4->set_markup('Optional: Assisted move for the profile');
} else {
$label4->set_markup('Assisted move for the profile');
}
lib/Games/Axmud/WizWin.pm view on Meta::CPAN
$pbObjDir = $axmud::CLIENT->ivShow('constPhrasebookHash', $self->dirPageLang);
}
if ($self->dictPageLang) {
$pbObjDict = $axmud::CLIENT->ivShow('constPhrasebookHash', $self->dirPageLang);
}
if ($pbObjDir && $pbObjDict && $pbObjDir->name ne $pbObjDict->name) {
# Open a 'dialogue' window with a combobox, so the user can choose between the languages
$declineString = 'Don\'t change the language';
# @comboList should only contain languages that aren't the current dictionary's language
push (@comboList, $declineString);
if ($pbObjDir->targetName ne $dictObj->language) {
push (@comboList, $pbObjDir->targetName);
}
lib/Games/Axmud/WizWin.pm view on Meta::CPAN
# ->signal_connects appear further down...
if ($self->analysisType eq 'short') {
$radioButton2->set_active(TRUE);
} elsif ($self->analysisType eq 'brief') {
$radioButton3->set_active(TRUE);
}
# Set the row at which the remaining widgets start to be drawn
$row = 3;
# Add a list of entry and comboboxes, one for each line of recently-received text
$self->capturePage_drawWidgets($row, \@labelList, \@entryList, \@comboList);
# If no capture has yet been performed, set their initial values
if (! $self->bufferObjList) {
# No capture has yet been performed, so set their initial values
$self->capturePage_resetWidgets(\@entryList, \@comboList);
} else {
# Show data in the entries and comboboxes from the previous capture
$self->capturePage_updateWidgets(\@entryList, \@comboList);
}
# Give the comboboxes their own ->signal_connect methods
$self->capturePage_connectCombos(\@comboList);
# Here's the ->signal_connect methods from earlier
$button->signal_connect('clicked' => sub {
# 'Update list' button. Reset the list of lines recently received from the world
$self->capturePage_resetWidgets(\@entryList, \@comboList);
$self->capturePage_connectCombos(\@comboList);
});
$button2->signal_connect('clicked' => sub {
# 'More lines' button. Add more lines to the number displayed, then re-draw the entries
# and comboboxes.
$self->ivPoke('analysisLength', $self->analysisLength + $self->analysisInc);
# Prevent the user from setting more lines than the maximum by desensitising the button
if (
$self->analysisLength >= $self->analysisMaxLength
|| (
$self->analysisLength > $self->analysisMinLength
&& $self->analysisLength >= $self->session->displayBufferCount
)
) {
$button2->set_sensitive(FALSE);
} else {
$button2->set_sensitive(TRUE);
}
# (The opposite button must be sensitised)
$button3->set_sensitive(TRUE);
# Redraw the entries and comboboxes
$self->capturePage_drawWidgets($row, \@labelList, \@entryList, \@comboList);
$self->capturePage_resetWidgets(\@entryList, \@comboList);
$self->capturePage_connectCombos(\@comboList);
# Make the changes visible
$self->winShowAll($self->_objClass . '->capturePage');
});
$button3->signal_connect('clicked' => sub {
# 'Fewer lines' button. Remove more lines to the number displayed, then re-draw the
# entries and comboboxes.
$self->ivPoke('analysisLength', $self->analysisLength - $self->analysisInc);
# Prevent the user setting fewer lines than the minimum by desensitising the button
if ($self->analysisLength <= $self->analysisMinLength) {
$button3->set_sensitive(FALSE);
} else {
$button3->set_sensitive(TRUE);
}
# (The opposite button must be sensitised)
$button2->set_sensitive(TRUE);
# Redraw the entries and comboboxes
$self->capturePage_drawWidgets($row, \@labelList, \@entryList, \@comboList);
$self->capturePage_resetWidgets(\@entryList, \@comboList);
$self->capturePage_connectCombos(\@comboList);
# Make the changes visible
$self->winShowAll($self->_objClass . '->capturePage');
});
$radioButton->signal_connect('toggled' => sub {
if ($radioButton->get_active()) {
$self->ivPoke('analysisType', 'verbose');
}
# Redraw the entries and comboboxes
$self->capturePage_drawWidgets($row, \@labelList, \@entryList, \@comboList);
$self->capturePage_resetWidgets(\@entryList, \@comboList);
$self->capturePage_connectCombos(\@comboList);
# Make the changes visible
$self->winShowAll($self->_objClass . '->capturePage');
});
$radioButton2->signal_connect('toggled' => sub {
if ($radioButton2->get_active()) {
$self->ivPoke('analysisType', 'short');
}
# Redraw the entries and comboboxes
$self->capturePage_drawWidgets($row, \@labelList, \@entryList, \@comboList);
$self->capturePage_resetWidgets(\@entryList, \@comboList);
$self->capturePage_connectCombos(\@comboList);
# Make the changes visible
$self->winShowAll($self->_objClass . '->capturePage');
});
$radioButton3->signal_connect('toggled' => sub {
if ($radioButton3->get_active()) {
$self->ivPoke('analysisType', 'brief');
}
# Redraw the entries and comboboxes
$self->capturePage_drawWidgets($row, \@labelList, \@entryList, \@comboList);
$self->capturePage_resetWidgets(\@entryList, \@comboList);
$self->capturePage_connectCombos(\@comboList);
# Make the changes visible
$self->winShowAll($self->_objClass . '->capturePage');
});
return 1;
}
sub capturePage_drawWidgets {
# Called by $self->capturePage
# Draws a Gtk3::Entry and a Gtk3::Combobox, one for each line in the display buffer
# displayed on this page
#
# Expected arguments
# $startRow - The row on which the first entry/combobox is drawn
# $labelListRef - Reference to a list of Gtk3::Labels at the beginning of each line
# (an empty list if none have been drawn yet)
# $entryListRef - Reference to a list of Gtk3::Entry boxes in which to display received
# lines (an empty list if none have been drawn yet)
# $comboListRef - Reference to a list of Gtk3::ComboBoxes in which to display components
# (an empty list if none have been drawn yet)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
lib/Games/Axmud/WizWin.pm view on Meta::CPAN
}
# Add combo boxes, one for each entry box
$row = $startRow;
for (my $line = 0; $line < $self->analysisLength; $line++) {
my (@componentList, @comboList);
$row++;
# The comboboxes show the default list of components (for verbose, short verbose or
# brief statements)
if ($self->analysisType eq 'verbose') {
@componentList = $self->verboseComponentList;
} elsif ($self->analysisType eq 'short') {
@componentList = $self->shortComponentList;
} elsif ($self->analysisType eq 'brief') {
@componentList = $self->briefComponentList;
}
foreach my $component (@componentList) {
lib/Games/Axmud/WizWin.pm view on Meta::CPAN
# Set the value displayed in the entry box numbered $count
$entry = $$entryListRef[$count];
$entry->set_text($text);
push (@lineList, $text);
# Update the record stored in the IV
$self->ivPush('bufferObjList', $bufferObj);
}
}
# Reset the comboboxes to contain the first component in the component list (which is
# 'outside_statement' for verbose, short verbose and brief statements)
foreach my $comboBox (@$comboListRef) {
$comboBox->set_active(0);
if ($self->analysisType eq 'verbose') {
$self->ivPush('bufferTypeList', $self->ivFirst('verboseComponentList'));
} elsif ($self->analysisType eq ' short') {
$self->ivPush('bufferTypeList', $self->ivFirst('shortComponentList'));
} else {
lib/Games/Axmud/WizWin.pm view on Meta::CPAN
# Find the position of the component in the ordered list
if ($self->analysisType eq 'verbose') {
$posn = $self->ivFind('verboseComponentList', $component);
} elsif ($self->analysisType eq 'short') {
$posn = $self->ivFind('shortComponentList', $component);
} else {
$posn = $self->ivFind('briefComponentList', $component);
}
# Set the combobox to that position (if it was found)
if (defined $posn) {
$combo->set_active($posn);
}
}
}
return 1;
}
sub capturePage_connectCombos {
# Called by $self->capturePage, usually after a call to ->capturePage_drawWidgets
# Gives each combobox a ->signal_connect method
#
# Expected arguments
# $comboListRef - Reference to a list of Gtk3::ComboBoxes in which to display components
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $comboListRef, $check) = @_;
lib/Games/Axmud/WizWin.pm view on Meta::CPAN
}
OUTER: foreach my $comboBox (@$comboListRef) {
$comboBox->signal_connect('changed' => sub {
my ($textIndex, $match, $updateFlag);
$textIndex = $comboBox->get_active();
# Find the index of this combobox, as stored in $comboListRef
INNER: for (my $count = 0; $count < $self->analysisLength; $count++) {
if ($$comboListRef[$count] eq $comboBox) {
$match = $count;
last INNER;
}
}
# Update the record stored in the IV
lib/Games/Axmud/WizWin.pm view on Meta::CPAN
} else {
$self->ivReplace(
'bufferTypeList',
$match,
$self->ivIndex('briefComponentList', $textIndex),
);
}
# Change the contents of every combobox beneath this one to match
if ($match < ($self->analysisLength - 1)) {
$$comboListRef[$match + 1]->set_active($textIndex);
}
});
}
return 1;
}