Games-Axmud
view release on metacpan or search on metacpan
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# sub expandNotebook {} # Inherited from GA::Generic::ConfigWin
# sub saveChanges {} # Inherited from GA::Generic::ConfigWin
# Notebook tabs
sub interfacesTab {
# Interfaces tab
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $check) = @_;
# Local variables
my $interfaceModelObj;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->interfacesTab', @_);
}
# Unusual step - we need to remember both simple lists displayed in these tabs, so create a
# few extra IVs
$self->ivPoke('slWidget1', undef);
$self->ivPoke('slWidget2', undef);
# We also need to store a few strings for this kind of interface (aliases, in this case)
$self->ivPoke('singular', 'alias');
$self->ivPoke('plural', 'aliases');
$interfaceModelObj = $axmud::CLIENT->ivShow('interfaceModelHash', 'alias');
$self->ivPoke('interfaceModelObj', $interfaceModelObj);
$self->ivPoke('stimulus', $interfaceModelObj->stimulusName); # i.e. 'pattern'
$self->ivPoke('response', $interfaceModelObj->responseName); # i.e. 'substitution'
# Tab setup
# Create a notebook within the main one, so that we have two rows of tabs
my $innerNotebook = $self->addInnerNotebookTabs($self->notebook, '_Aliases');
# Add tabs to the inner notebook
$self->interfaces1Tab($innerNotebook);
$self->interfaces2Tab($innerNotebook);
return 1;
}
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::EditWin::Cage::Macro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(
Games::Axmud::EditWin::Generic::InterfaceCage Games::Axmud::EditWin::Generic::Cage
Games::Axmud::Generic::EditWin Games::Axmud::Generic::ConfigWin
Games::Axmud::Generic::FreeWin Games::Axmud::Generic::Win Games::Axmud
);
##################
# Constructors
# sub new {} # Inherited from GA::Generic::ConfigWin
##################
# Methods
# Standard window object functions
# sub winSetup {} # Inherited from GA::Generic::ConfigWin
# sub winEnable {} # Inherited from GA::Generic::ConfigWin
# sub winDesengage {} # Inherited from GA::Generic::FreeWin
# sub winDestroy {} # Inherited from GA::Generic::FreeWin
# sub winShowAll {} # Inherited from GA::Generic::Win
# sub drawWidgets {} # Inherited from GA::Generic::ConfigWin
# sub redrawWidgets {} # Inherited from GA::Generic::Win
# ->signal_connects
# Other functions
sub checkEditObj {
# Called by $self->winEnable
# Checks that the object stored in $self->editObj is the correct class of object
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments or if the check fails
# 1 if the check succeeds
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->checkEditObj', @_);
}
if ($self->editObj && ! $self->editObj->isa('Games::Axmud::Cage::Macro')) {
return undef;
} else {
return 1;
}
}
# sub enableButtons {} # Inherited from GA::Generic::ConfigWin
# sub enableSingleButton {} # Inherited from GA::Generic::ConfigWin
# sub setupNotebook {} # Inherited from GA::Generic::ConfigWin
# sub expandNotebook {} # Inherited from GA::Generic::ConfigWin
# sub saveChanges {} # Inherited from GA::Generic::ConfigWin
# Notebook tabs
sub interfacesTab {
# Interfaces tab
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $check) = @_;
# Local variables
my $interfaceModelObj;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->interfacesTab', @_);
}
# Unusual step - we need to remember both simple lists displayed in these tabs, so create a
# few extra IVs
$self->ivPoke('slWidget1', undef);
$self->ivPoke('slWidget2', undef);
# We also need to store a few strings for this kind of interface (macros, in this case)
$self->ivPoke('singular', 'macro');
$self->ivPoke('plural', 'macros');
$interfaceModelObj = $axmud::CLIENT->ivShow('interfaceModelHash', 'macro');
$self->ivPoke('interfaceModelObj', $interfaceModelObj);
$self->ivPoke('stimulus', $interfaceModelObj->stimulusName); # i.e. 'keycode'
$self->ivPoke('response', $interfaceModelObj->responseName); # i.e. 'instruction'
# Tab setup
# Create a notebook within the main one, so that we have two rows of tabs
my $innerNotebook = $self->addInnerNotebookTabs($self->notebook, '_Macros');
# Add tabs to the inner notebook
$self->interfaces1Tab($innerNotebook);
$self->interfaces2Tab($innerNotebook);
return 1;
}
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::EditWin::Cage::Timer;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(
Games::Axmud::EditWin::Generic::InterfaceCage Games::Axmud::EditWin::Generic::Cage
Games::Axmud::Generic::EditWin Games::Axmud::Generic::ConfigWin
Games::Axmud::Generic::FreeWin Games::Axmud::Generic::Win Games::Axmud
);
##################
# Constructors
# sub new {} # Inherited from GA::Generic::ConfigWin
##################
# Methods
# Standard window object functions
# sub winSetup {} # Inherited from GA::Generic::ConfigWin
# sub winEnable {} # Inherited from GA::Generic::ConfigWin
# sub winDesengage {} # Inherited from GA::Generic::FreeWin
# sub winDestroy {} # Inherited from GA::Generic::FreeWin
# sub winShowAll {} # Inherited from GA::Generic::Win
# sub drawWidgets {} # Inherited from GA::Generic::ConfigWin
# sub redrawWidgets {} # Inherited from GA::Generic::Win
# ->signal_connects
# Other functions
sub checkEditObj {
# Called by $self->winEnable
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# Return values
# 'undef' on improper arguments or if the check fails
# 1 if the check succeeds
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->checkEditObj', @_);
}
if ($self->editObj && ! $self->editObj->isa('Games::Axmud::Interface::Alias')) {
return undef;
} else {
return 1;
}
}
# sub enableButtons {} # Inherited from GA::Generic::ConfigWin
# sub enableSingleButton {} # Inherited from GA::Generic::ConfigWin
# sub setupNotebook {} # Inherited from GA::Generic::ConfigWin
sub expandNotebook {
# Called by $self->setupNotebook
# Set up additional tabs for the notebook
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->expandNotebook', @_);
}
$self->aliasAttributesTab();
$self->beforeAfterTab();
return 1;
}
# sub saveChanges {} # Inherited from GA::Generic::ConfigWin
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::EditWin::Interface::Macro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(
Games::Axmud::EditWin::Generic::Interface Games::Axmud::Generic::EditWin
Games::Axmud::Generic::ConfigWin Games::Axmud::Generic::FreeWin Games::Axmud::Generic::Win
Games::Axmud
);
##################
# Constructors
# sub new {} # Inherited from GA::Generic::ConfigWin
##################
# Methods
# Standard window object functions
# sub winSetup {} # Inherited from GA::Generic::ConfigWin
# sub winEnable {} # Inherited from GA::Generic::ConfigWin
# sub winDesengage {} # Inherited from GA::Generic::FreeWin
# sub winDestroy {} # Inherited from GA::Generic::FreeWin
# sub winShowAll {} # Inherited from GA::Generic::Win
# sub drawWidgets {} # Inherited from GA::Generic::ConfigWin
# sub redrawWidgets {} # Inherited from GA::Generic::Win
# ->signal_connects
# Other functions
sub checkEditObj {
# Called by $self->winEnable
# Checks that the object stored in $self->editObj is the correct class of object
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments or if the check fails
# 1 if the check succeeds
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->checkEditObj', @_);
}
if ($self->editObj && ! $self->editObj->isa('Games::Axmud::Interface::Macro')) {
return undef;
} else {
return 1;
}
}
# sub enableButtons {} # Inherited from GA::Generic::ConfigWin
# sub enableSingleButton {} # Inherited from GA::Generic::ConfigWin
# sub setupNotebook {} # Inherited from GA::Generic::ConfigWin
sub expandNotebook {
# Called by $self->setupNotebook
# Set up additional tabs for the notebook
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->expandNotebook', @_);
}
$self->macroAttributesTab();
$self->beforeAfterTab();
return 1;
}
# sub saveChanges {} # Inherited from GA::Generic::ConfigWin
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::EditWin::Interface::Timer;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(
Games::Axmud::EditWin::Generic::Interface Games::Axmud::Generic::EditWin
Games::Axmud::Generic::ConfigWin Games::Axmud::Generic::FreeWin Games::Axmud::Generic::Win
Games::Axmud
);
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
if ($checkButton->get_active()) {
$self->sensitiseWidgets($entry, $entry2, $entry3);
} else {
$self->desensitiseWidgets($entry, $entry2, $entry3);
}
});
$checkButton->set_active($self->editObj->checkOnceFlag);
# Tab complete
return 1;
}
sub parametersConnections1Tab {
# Parameters Connections1 tab
#
# Expected arguments
# $innerNotebook - The Gtk3::Notebook object inside $self->notebook
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $innerNotebook, $check) = @_;
# Local variables
my (
@list, @comboList,
%descripHash,
);
# Check for improper arguments
if (! defined $innerNotebook || defined $check) {
return $axmud::CLIENT->writeImproper(
$self->_objClass . '->parametersConnections1Tab',
@_,
);
}
# Tab setup
my $grid = $self->addTab(
$innerNotebook,
'Page _1',
['Task parameters'],
);
# Task parameters
$self->addLabel($grid, '<b>Task parameters</b>',
0, 12, 0, 1);
$self->addCheckButton(
$grid,
'Show additional connection information (requires a larger task window)',
'showInfoFlag',
TRUE,
1, 12, 1, 2);
$self->addCheckButton(
$grid,
'This task create its own macros to switch between sessions',
'useMacrosFlag',
TRUE,
1, 12, 2, 3);
$self->addLabel($grid,'If macros are created, which keycodes to use',
1, 6, 3, 4);
@list = (
'CTRL+1, CTRL+2 ... CTRL+9' => 'default',
'F1, F2 ... F9' => 'simple',
);
do {
my ($descrip, $mode);
$descrip = shift @list;
$mode = shift @list;
$descripHash{$descrip} = $mode;
if ($self->editObj->macroMode eq $mode) {
unshift(@comboList, $descrip);
} else {
push (@comboList, $descrip);
}
} until (! @list);
my $comboBox = $self->addComboBox($grid, undef, \@comboList, '',
TRUE, # 'undef' value not allowed
6, 12, 3, 4);
$comboBox->signal_connect('changed' => sub {
$self->ivAdd('editHash', 'macroMode', $descripHash{$comboBox->get_active_text()});
});
# Tab complete
return 1;
}
sub parametersDivert1Tab {
# Parameters Divert1 tab
#
# Expected arguments
# $innerNotebook - The Gtk3::Notebook object inside $self->notebook
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $innerNotebook, $check) = @_;
# Local variables
my (@comboList, @comboList2);
# Check for improper arguments
if (! defined $innerNotebook || defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->parametersDivert1Tab', @_);
( run in 1.862 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )