Games-Axmud

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

- Added a new exit ornament, 'mystery' (drawn as a dark red square). If you
    don't know how to pass through an exit, but think it's probably possible to
    pass through it, you can mark it as a mystery exit
- You can now select all rooms, exits, labels (etc) in the whole map. You can
    also now select all impassable or mystery exits
- The 'Find room...' operation can now look for room tags, as well as room
    numbers
- When using crafty moves, 2-way exits (rather than a 1-way exit) are now
    created, when appropriate
- You can now add multiple exits to multiple rooms at the same time
- A map label's style can now be set directly from the popup menu after right-
    clicking the label
- The ';setroom' command has been updated with a new switch, ';setroom -l',
    which sets the last known location (drawn in green) as the new current
    location. This switch can be combined with others, e.g. use ';setroom -f -l'
    to set the location and switch to 'follow' mode

Automapper fixes
- At a few worlds, the automapper was unreliable, in that it frequently got
    confused about the current location for no obvious reason. The reason, in
    fact, was incorrect handling of prompts, an issue that only affected those

CHANGES  view on Meta::CPAN

    running the installer a second time will work. In most cases, if Axmud
    crashes shortly after it starts for the first time, it won't crash on the
    second or subsequent occasions

Minor fixes
- The Locator task displays the number of room statements (descriptions) it's
    expecting in its title bar, but this number was not updated frequently
    enough. The visible number is now updated instantly. The same number is no
    longer displayed in the automapper's title bar (as there is no longer enough
    room there)
- Fixed some issues with MXP room tags and popup menus, which prevented (for
    example) the automapper from working at DragonStone
- Improved handling of arkward exit states (extra information about an exit in
    the room's exit list), which made correct handling of exit states at
    DragonStone impossible
- Trying to connect to a world from the basic mudlist, while specifiying a
    character and password, produced error messages. Fixed
- ';importfiles' failed to import a world profile exported with an
    ';exportfiles -w' command. Fixed
- Fixed incorrect handling of text in bold white at some worlds
- Various issues with handling and checking Axmud colour tags have been fixed

MANIFEST  view on Meta::CPAN

share/help/axbasic/func/match
share/help/axbasic/func/matchi
share/help/axbasic/func/max
share/help/axbasic/func/mid_
share/help/axbasic/func/min
share/help/axbasic/func/mod
share/help/axbasic/func/ncpos
share/help/axbasic/func/ncposr
share/help/axbasic/func/openmap
share/help/axbasic/func/pi
share/help/axbasic/func/popup_
share/help/axbasic/func/pos
share/help/axbasic/func/posr
share/help/axbasic/func/rad
share/help/axbasic/func/remainder
share/help/axbasic/func/repeat_
share/help/axbasic/func/right_
share/help/axbasic/func/rnd
share/help/axbasic/func/round
share/help/axbasic/func/rtrim_
share/help/axbasic/func/scriptname_

MANIFEST  view on Meta::CPAN

share/help/cmd/testplugin
share/help/cmd/testwindowcontrols
share/help/cmd/testxterm
share/help/cmd/toggleautomapper
share/help/cmd/togglehistory
share/help/cmd/toggleinstruction
share/help/cmd/toggleirreversible
share/help/cmd/togglelabel
share/help/cmd/togglemainwindow
share/help/cmd/togglepalette
share/help/cmd/togglepopup
share/help/cmd/toggleshare
share/help/cmd/toggleshortlink
share/help/cmd/togglesigil
share/help/cmd/togglewindowkey
share/help/cmd/togglewindowstorage
share/help/cmd/unflashwindow
share/help/cmd/unmonitorobject
share/help/cmd/unprotectobject
share/help/cmd/unsetchar
share/help/cmd/unsetcustomprofile

lib/Games/Axmud/Client.pm  view on Meta::CPAN

            fileObjHash                 => {},
            # A shortcut to the blessed reference of the 'config' file object (very useful for all
            #   the parts of the code that need to set the file object's ->modifyFlag)
            configFileObj               => undef,
            # Every time the 'config' file is loaded, the list of world profiles it contains is
            #   copied into this list (empty if the 'config' file doesn't list any world
            #   profile). This list will become obsolete as soon as profiles are created/destroyed/
            #   loaded, so it shouldn't be used for any other purpose
            configWorldProfList         => [],

            # GA::Session->setupProfiles can optionally create a 'Loading...' popup window by
            #   calling GA::Generic::Win->showBusyWin, if the file(s) it's loading are above a
            #   certain size. It's up to the calling function to close the popup window when all
            #   load operations are complete
            # The standard file size above which a 'Loading...' popup can be shown, if some part of
            #   the Axmud code wants it
            constLargeFileSize          => 5_000_000,   # (roughly 5MB)

            # Large world models can cause 'out of memory' errors on low-spec machines. The
            #   problem is not that the world model takes up too much memory, but that the Perl
            #   Storable module struggles to load very large files into memory
            # Since v1.1.529, the world model is saved either as a monolithic file (as previously),
            #   or as multiple files, all of which are handled by a single file object
            # Flag set to TRUE if we should allow large world models to be saved as multiple files,
            #   FALSE if world models should always be saved as a single monolithic file

lib/Games/Axmud/Client.pm  view on Meta::CPAN

            #   labels are displayed beneath the buttons (which we don't want). Users can toggle
            #   this flag to suit their own system
            # Flag set to TRUE if toolbar buttons should have labels, FALSE otherwise
            toolbarLabelFlag            => undef,       # [config] Set below
            # Some 'edit'/'pref' windows use the irreversible icon (stored as the file
            #   /icons/system/irreversible.png) on buttons to show that stored data will be
            #   modified immediately. However, on some (Linux) systems the icon isn't currently
            #   visible. Flag set to TRUE if an icon should be drawn, FALSE if an asterisk should be
            #   drawn instead
            irreversibleIconFlag        => FALSE,       # [config]
            # Flag set to TRUE if the popup window created by GA::Generic::Win->showBusyWin should
            #   not be shown at all; FALSE if it can be shown (when required)
            allowBusyWinFlag            => TRUE,        # [config]
            # Flag set to FALSE if system messages should never be displayed in a session's 'main'
            #   window, but redirected to the Session Console window; TRUE if the session should
            #   decide for itself which of those to do
            mainWinSystemMsgFlag        => TRUE,       # [config]
            # Flag set to TRUE if a session's 'main' window urgency hint should be set, when text
            #   is received from the world
            mainWinUrgencyFlag          => FALSE,       # [config]
            # Flag set to TRUE if tooltips should be shown in session's default tab

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        # Expected arguments
        #   (none besides $class)
        #
        # Return values
        #   'undef' if GA::Generic::Cmd->new reports an error
        #   Blessed reference to the new object on success

        my ($class, $check) = @_;

        # Setup
        my $self = Games::Axmud::Generic::Cmd->new('togglepopup', TRUE, FALSE);
        if (! $self) {return undef}

        $self->{defaultUserCmdList} = ['tpp', 'togglepop', 'togglepopup'];
        $self->{userCmdList} = \@{$self->{defaultUserCmdList}};
        $self->{descrip} = 'Toggles popup windows';

        # Bless the object into existence
        bless $self, $class;
        return $self;
    }

    ##################
    # Methods

    sub do {

lib/Games/Axmud/Generic.pm  view on Meta::CPAN


            # Create a packing box
            my $packingBox = Gtk3::VBox->new(FALSE, 0);
            $self->winBox->add($packingBox);
            $packingBox->set_border_width(0);

            # Add a notebook at the top
            my $notebook = Gtk3::Notebook->new();
            $packingBox->pack_start($notebook, TRUE, TRUE, 0);
            $notebook->set_scrollable(TRUE);
            $notebook->popup_enable();

            # Add a button strip at the bottom, in a horizontal packing box
            my $hBox = Gtk3::HBox->new(FALSE, 0);
            $packingBox->pack_end($hBox, FALSE, FALSE, $self->spacingPixels);

            # Create Reset/Save/Cancel/OK buttons
            my ($okButton, $cancelButton, $resetButton, $saveButton) = $self->enableButtons($hBox);

            # Update IVs
            $self->ivPoke('packingBox', $packingBox);

lib/Games/Axmud/Generic.pm  view on Meta::CPAN


            # Create the vbox on the right, with a notebook at the top, and a button strip at the
            #   bottom
            my $vBox = Gtk3::VBox->new(FALSE, 0);
            $hPaned->add2($vBox);

            # Add the notebook
            my $notebook = Gtk3::Notebook->new();
            $vBox->pack_start($notebook, TRUE, TRUE, 0);
            $notebook->set_scrollable(TRUE);
            $notebook->popup_enable();

            # Add a button strip at the bottom, in a horizontal packing box
            my $hBox = Gtk3::HBox->new(FALSE, 0);
            $vBox->pack_end($hBox, FALSE, FALSE, $self->spacingPixels);

            # Create Reset/Save/Cancel/OK buttons
            my ($okButton, $cancelButton, $resetButton, $saveButton) = $self->enableButtons($hBox);

            # Update IVs
            $self->ivPoke('packingBox', $packingBox);

lib/Games/Axmud/Generic.pm  view on Meta::CPAN


        # Check for improper arguments
        if (! defined $notebook || ! defined $mnemonic ||  defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->addInnerNotebookTabs', @_);
        }

        # Tab setup
        my $innerNotebook = Gtk3::Notebook->new();
        $innerNotebook->set_scrollable(TRUE);
        $innerNotebook->popup_enable();

        my $tab = Gtk3::Label->new_with_mnemonic($mnemonic);
        my $page = $notebook->append_page($innerNotebook, $tab);

        # Update the index, if present
        $self->addRowToIndex($notebook, $tab, $mnemonic, $headingListRef);

        # Update IVs
        $self->ivAdd('innerNotebookHash', $page, $innerNotebook);

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

        );

        # Check for improper arguments
        if (
            ! defined $title || ! defined $icon || ! defined $text || ! defined $buttonType
            || defined $check
        ) {
            return $axmud::CLIENT->writeImproper($self->_objClass . '->showMsgDialogue', @_);
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the correct spacing size for 'dialogue' windows
        $spacing = $axmud::CLIENT->constFreeSpacingPixels;

        # Check that $icon and $buttonType are valid values

lib/Games/Axmud/Generic.pm  view on Meta::CPAN


        # Local variables
        my $fileName;

        # Check for improper arguments
        if (! defined $title || ! defined $type || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->showFileChooser', @_);
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Check that $type is a valid type
        if (
            $type ne 'open' && $type ne 'save' && $type ne 'select-folder'
            && $type ne 'create-folder'

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

            $spacing, $starText, $lastThing, $response, $responseText, $confirmMsg,
            %buttonHash,
        );

        # Check for improper arguments
        if (! defined $title || ! defined $text || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->showEntryDialogue', @_);
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the correct spacing size for 'dialogue' windows
        $spacing = $axmud::CLIENT->constFreeSpacingPixels;

        # Show the dialogue window

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

        my (
            $self, $title, $labelText, $labelText2, $maxChars, $obscureMode, $noSplitFlag, $check
        ) = @_;

        # Local variables
        my (
            $spacing, $response, $responseText, $responseText2,
            @emptyList,
        );

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the correct spacing size for 'dialogue' windows
        $spacing = $axmud::CLIENT->constFreeSpacingPixels;

        # Check for improper arguments

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

            @emptyList,
        );

        # Check for improper arguments
        if (! defined $title || ! defined $labelText || defined $check) {

            $axmud::CLIENT->writeImproper($self->_objClass . '->showTripleEntryDialogue', @_);
            return @emptyList;
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the correct spacing size for 'dialogue' windows
        $spacing = $axmud::CLIENT->constFreeSpacingPixels;

        # Show the 'dialogue' window

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

            $spacing, $lastThing, $response, $responseText,
            %buttonHash,
        );

        # Check for improper arguments
        if (! defined $title || ! defined $text || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->showComboDialogue', @_);
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the correct spacing size for 'dialogue' windows
        $spacing = $axmud::CLIENT->constFreeSpacingPixels;

        # If $listRef was not specified, use an empty list

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

            @emptyList,
        );

        # Check for improper arguments
        if (! defined $title || defined $check) {

            $axmud::CLIENT->writeImproper($self->_objClass . '->showDoubleComboDialogue', @_);
            return @emptyList;
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the correct spacing size for 'dialogue' windows
        $spacing = $axmud::CLIENT->constFreeSpacingPixels;

        # If $listRef/$listRef2 were not specified, use empty lists

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

            @emptyList,
        );

        # Check for improper arguments
        if (! defined $title || defined $check) {

            $axmud::CLIENT->writeImproper($self->_objClass . '->showEntryComboDialogue', @_);
            return @emptyList;
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the correct spacing size for 'dialogue' windows
        $spacing = $axmud::CLIENT->constFreeSpacingPixels;

        # If $listRef was not specified, use an empty list

lib/Games/Axmud/Generic.pm  view on Meta::CPAN


        # Check for improper arguments
        if (! defined $title || defined $check) {

            return $axmud::CLIENT->writeImproper(
                $self->_objClass . '->showColourSelectionDialogue',
                @_,
            );
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Show the 'dialogue' window
        my $dialogueWin = Gtk3::ColorSelectionDialog->new($title);
        $dialogueWin->set_transient_for($self->winWidget);

lib/Games/Axmud/Generic.pm  view on Meta::CPAN


        # Check for improper arguments
        if (! defined $title || defined $check) {

            return $axmud::CLIENT->writeImproper(
                $self->_objClass . '->showFontSelectionDialogue',
                @_,
            );
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Show the 'dialogue' window
        my $dialogueWin = Gtk3::FontChooserDialog->new($title, $self->winWidget);
        $dialogueWin->set_position('center-always');
        $dialogueWin->set_icon_list($axmud::CLIENT->desktopObj->{dialogueWinIconList});

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

        #   1 otherwise

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->showIrreversibleTest', @_);
        }

        # If an earlier call to $self->showBusyWin created a popup window, close it (otherwise it'll
        #   be visible above the new dialogue window)
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Show the 'dialogue' window
        my $dialogueWin = Gtk3::Dialog->new(
            'Irreversible icon test',
            $self->winWidget,

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

        # Otherwise, user clicked 'ok', and we might need to add initial tasks
        $dialogueWin->run();
        $dialogueWin->destroy();
        $self->restoreFocus();

        return 1;
    }

    sub showBusyWin {

        # Displays a temporary popup window (still an Axmud 'dialogue' window)
        # By default, displays the Axmud icon and the caption 'Loading...', but the calling function
        #   can specify a different logo and caption, if required
        # The popup window must be closed by the calling function, when no longer required (via a
        #   call to $self->closeDialogueWin)
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Optional arguments
        #   $path       - Path of the file containing the image to show as an icon. If not
        #                   specified, the standard Axmud icon
        #   $caption    - A short piece of text to show next to the image. If not specified, the
        #                   caption 'Loading...' is used

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

        #   1 otherwise

        my ($self, $path, $caption, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->showBusyWin', @_);
        }

        # Don't show the popup window at all, if not allowed
        if (! $axmud::CLIENT->allowBusyWinFlag) {

            return undef;
        }

        # Only one of these temporary popup windows can exist at a time. If one already exists,
        #   close it
        if ($axmud::CLIENT->busyWin) {

            $self->closeDialogueWin($axmud::CLIENT->busyWin);
        }

        # Set the file path and caption text, if not specified
        if (! defined $path || ! (-e $path)) {

            $path = $axmud::CLIENT->getDialogueIcon('medium');
        }

        if (! $caption) {

            $caption = 'Loading...';
        }

        # Show the window widget
        my $dialogueWin = Gtk3::Window->new('popup');
        $dialogueWin->set_position('center-always');
        $dialogueWin->set_icon_list($axmud::CLIENT->desktopObj->{dialogueWinIconList});
        $dialogueWin->set_title($axmud::SCRIPT);
        $dialogueWin->set_border_width(0);
        $dialogueWin->set_transient_for($self->winWidget);

        $dialogueWin->signal_connect('delete-event' => sub {

            $dialogueWin->destroy();
            $axmud::CLIENT->desktopObj->updateWidgets($self->_objClass . '->showBusyWin');

lib/Games/Axmud/Obj/File.pm  view on Meta::CPAN

            '# Show non-existent IV debug messages',
                $self->convert($client->debugCheckIVFlag),
            '# Show errors when table objects can\'t be added/resized',
                $self->convert($client->debugTableFitFlag),
            '# Show Perl errors/warnings in \'main\' window',
                $self->convert($client->debugTrapErrorFlag),
            '# Show toolbar button labels',
                $self->convert($client->toolbarLabelFlag),
            '# Show irreversible icon in \'edit\' windows',
                $self->convert($client->irreversibleIconFlag),
            '# Allow popup windows showing the ' . $axmud::SCRIPT . ' logo',
                $self->convert($client->allowBusyWinFlag),
            '# Allow system messages to be displayed in the \'main\' window',
                $self->convert($client->mainWinSystemMsgFlag),
            '# Set \'main\' window\'s urgency hint when text received',
                $self->convert($client->mainWinUrgencyFlag),
            '# Show tooltips in a session\'s default tab',
                $self->convert($client->mainWinTooltipFlag),
            '# Session tab mode',
                $client->sessionTabMode,
            '# Use xterm titles',

lib/Games/Axmud/Obj/Link.pm  view on Meta::CPAN

            # Flag set to TRUE if an MXP link's corresponding command should be sent to the world
            #   invisibly, FALSE if it should be visible (or not) as any other world command is
            mxpInvisFlag                => FALSE,

            # Mode for Pueblo links, which are implemented in the same way as MXP <A> or <SEND>
            #   links, depending on arguments
            # 'not_link' - not a Pueblo link, 'href_link' - <A HREF=...>, 'cmd_link'
            #   - <A XCH_CMD...>
            puebloMode                  => 'not_link',

            # Flag set to TRUE if a popup menu should be created when the user clicks on this link
            popupFlag                   => FALSE,
            # When ->popupFlag is TRUE, $self->href is split into a list of world commands, and
            #   stored in this IV (but the value of $self->href remains unchanged)
            popupCmdList                => [],
            # When ->popupFlag is TRUE, $self->hint is split into a list of menu items, and stored
            #   in this IV. If there is one more menu item than there are world commands, the
            #   first menu item (which is actually a hint) is removed and stored in $self->hint;
            #   otherwise $self->hint is set back to 'undef'
            popupItemList               => [],
        };

        # Bless the object into existence
        bless $self, $class;

        return $self;
    }

    ##################
    # Methods

lib/Games/Axmud/Obj/Link.pm  view on Meta::CPAN

    sub mxpFlag
        { $_[0]->{mxpFlag} }
    sub mxpPromptFlag
        { $_[0]->{mxpPromptFlag} }
    sub mxpInvisFlag
        { $_[0]->{mxpInvisFlag} }

    sub puebloMode
        { $_[0]->{puebloMode} }

    sub popupFlag
        { $_[0]->{popupFlag} }
    sub popupCmdList
        { my $self = shift; return @{$self->{popupCmdList}}; }
    sub popupItemList
        { my $self = shift; return @{$self->{popupItemList}}; }
}

# Package must return a true value
1

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN

            # Widgets
            textView                    => undef,           # Gtk3::TextView
            textView2                   => undef,           # Gtk3::TextView
            buffer                      => undef,           # Gtk3::TextBuffer
            vPaned                      => undef,           # Gtk3::VPaned
            scroll                      => undef,           # Gtk3::ScrolledWindow
            scroll2                     => undef,           # Gtk3::ScrolledWindow
            startMark                   => undef,           # Gtk3::TextMark
            endMark                     => undef,           # Gtk3::TextMark
            searchMark                  => undef,           # Gtk3::TextMark
            popupMenu                   => undef,           # Gtk3::Menu

            # Other IVs

            # Flag set to TRUE when the scroll lock is enabled, FALSE when it is disabled (only
            #   applies to the original Gtk3::TextView)
            scrollLockFlag              => TRUE,
            # What type of scroll lock to apply - 'top' if the original textview should remain
            #   scrolled to the top, 'bottom' if it should remain scrolled to the bottom
            scrollLockType              => 'bottom',
            # Split screen mode. Because of performance issues with very large Gtk3::TextBuffers,

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN

                            #   'main' window's entry box
                            $stripObj = $self->paneObj->winObj->getStrip('entry');
                            if ($stripObj) {

                                $result = $stripObj->commandeerEntry(
                                    $self->session,
                                    $self->currentLinkObj->href,
                                );
                            }

                        } elsif ($self->currentLinkObj->popupCmdList) {

                            $result = $self->session->worldCmd(
                                $self->currentLinkObj->ivFirst('popupCmdList'),
                            );

                        } elsif ($self->currentLinkObj->href) {

                            $result = $self->session->worldCmd($self->currentLinkObj->href);

                        } else {

                            $result = $self->session->worldCmd($self->currentLinkObj->text);
                        }
                    }

                # Right button
                } elsif ($event->button == 3) {

                    if ($self->currentLinkObj->type eq 'cmd' && $self->currentLinkObj->popupFlag) {

                        # Create a popup menu, and send a world command if the user clicks on a menu
                        #   item
                        $result = $self->createPopupMenu($event);
                    }
                }

                # Clicking on a link resets the cursor
                $self->ivUndef('currentLinkObj');
                $textView->get_window('text')->set_cursor($axmud::CLIENT->constNormalCursor);
                return $result;
            }

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN

                'Line ' . $sessionLineNum . ', ' . $axmud::CLIENT->localTime,
            );
        }

        return 1;
    }

    sub createPopupMenu {

        # Called by ->signal_connect in $self->setButtonPressEvent
        # After the user has clicked on $self->currentLinkObj, creates a popup menu from which the
        #   user can select one of several menu items. If the user clicks on a menu item, the
        #   corresponding world command is sent
        # The menu options and corresponding world commands are (usually) set by an MXP
        #   <SEND>..</SEND> construction
        #
        # Expected arguments
        #   $event          - The 'button_press_event' signal emitted when the user clicks on a
        #                       clickable link in the tab
        #
        # Return values
        #   'undef' on improper arguments or if the popup menu can't be created
        #   1 otherwise

        my ($self, $event, $check) = @_;

        # Local variables
        my (
            $linkObj, $count,
            @optionList,
        );

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN

             return $axmud::CLIENT->writeImproper($self->_objClass . '->createPopupMenu', @_);
        }

        # Check there is a current link object set (no reason why there shouldn't be)
        if (! $self->currentLinkObj) {

            return undef;

        } else {

            # $self->currentLinkObj will be set to 'undef' as soon as the popup menu is clicked,
            #   and before this function returns, so store the object as a local variable)
            $linkObj = $self->currentLinkObj;
        }

        # Create the popup menu
        my $menu = Gtk3::Menu->new();

        # The GA::Obj::Link stores menu items and corresponding world commands each as a single
        #   string, with items/commands separated by a | character
        # (If there was an extra item in @optionList, representing an extra tooltip hint to show
        #   e.g. "Click to see the menu", it has already been removed)
        @optionList = $linkObj->popupItemList;

        $count = -1;
        foreach my $cmd ($linkObj->popupCmdList) {

            my ($hint, $menuItem);

            $count++;

            # Prefer to use a hint over a raw command, if a hint was supplied
            $hint = shift (@optionList);
            $menuItem = Gtk3::MenuItem->new_with_label('');

            my $label = $menuItem->get_child();

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN

                my $stripObj = $self->paneObj->winObj->getStrip('entry');

                if ($linkObj->mxpPromptFlag && $stripObj) {
                    $stripObj->commandeerEntry($self->session, $cmd);
                } else {
                    $self->session->worldCmd($cmd);
                }
            });
        }

        $menu->popup(
            undef, undef, undef, undef,
            $event->button,
            $event->time,
        );

        $menu->show_all();

        # Store as an IV, so that $self->resetCurrentLink can destroy it, if the link expires
        $self->ivPoke('popupMenu', $menu);
        $menu->signal_connect('delete-event' => sub {

            $self->ivUndef('popupMenu');

            return undef;
        });

        return 1;
    }

    sub resetCurrentLink {

        # Called by GA::Session->processMxpOfficialElement when the GA::Obj::Link object stored in
        #   $self->currentLinkObj expires
        # Hides tooltips, resets the cursor, closes the popup menu
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if this isn't the 'main' window
        #   1 otherwise

        my ($self, $check) = @_;

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN


        # Hide tooltips, if visible
        $self->hideTooltips();

        # Reset the cursor
        if ($self->textView) {

            $self->textView->get_window('text')->set_cursor($axmud::CLIENT->constNormalCursor);
        }

        # Close the popup menu
        if ($self->popupMenu) {

            $self->popupMenu->destroy();

            $self->ivUndef('popupMenu');
        }

        return 1;
    }

    sub toggleScrollLock {

        # Called by GA::Table::Pane->toggleScrollLock
        # Enables or disables this textview object's scroll lock mode, in which the textview scrolls
        #   to the bottom every time text is received from the world. (If split screen mode is

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN


                    # Not an expired link
                    $self->ivPoke('currentLinkObj', $linkObj);

                    if ($linkObj->type eq 'www') {

                        $window->set_cursor($axmud::CLIENT->constWWWCursor);

                    } elsif ($linkObj->type eq 'cmd') {

                        # (Check ->popupFlag first, because a popup menu can also redirect to a
                        #   prompt)
                        if ($linkObj->popupFlag) {
                            $window->set_cursor($axmud::CLIENT->constPopupCursor);
                        } elsif ($linkObj->mxpPromptFlag) {
                            $window->set_cursor($axmud::CLIENT->constPromptCursor);
                        } else {
                            $window->set_cursor($axmud::CLIENT->constCmdCursor);
                        }

                    } elsif ($linkObj->type eq 'mail') {

                        $window->set_cursor($axmud::CLIENT->constMailCursor);

lib/Games/Axmud/Obj/TextView.pm  view on Meta::CPAN

    sub scroll
        { $_[0]->{scroll} }
    sub scroll2
        { $_[0]->{scroll2} }
    sub startMark
        { $_[0]->{startMark} }
    sub endMark
        { $_[0]->{endMark} }
    sub searchMark
        { $_[0]->{searchMark} }
    sub popupMenu
        { $_[0]->{popupMenu} }

    sub scrollLockFlag
        { $_[0]->{scrollLockFlag} }
    sub scrollLockType
        { $_[0]->{scrollLockType} }
    sub splitScreenMode
        { $_[0]->{splitScreenMode} }

    sub colourScheme
        { $_[0]->{colourScheme} }

lib/Games/Axmud/Obj/WorldModel.pm  view on Meta::CPAN

            # When the user double-clicks on a room to go there (using the shortest path), give them
            #   an opportunity to change their minds for very long paths. IV set to the number of
            #   steps (separate world commands) used to move from the current room to the specified
            #   one; if the actual number of steps exceeds this value,
            #   GA::Win::Map->processPathCallback shows a yes-no 'dialogue' window, first. If the
            #   IV is set to 0, there is no limit
            pathFindStepLimit           => 200,

            # When GA::Win::Map->doDraw is called, the drawing process can take a long time, if
            #   there are thousands of objects to draw. The value of this IV is the number of
            #   objects (not including exits) above which ->doDraw will create a popup window, so
            #   that the user knows why Axmud has frozen (minimum value 100)
            drawPauseNum                => 500,
            # When GA::Win::Map->recalculatePathsCallback is called, the recalculation process
            #   can tak a long time, if there are hundreds of region paths to recalculate. The
            #   value of this IV is the number of paths above which ->recalculatePathsCallback
            #   will create a popup window, so that the user knows why Axmud has frozen (minimum
            #   value 10)
            recalculatePauseNum         => 50,

            # The font and font size to use for text drawn in the Automapper window (expressed as a
            #   ratio, with 1 being the font size used for room tags at the map's current
            #   magnification)
            mapFont                     => 'Sans',
            roomTagRatio                => 1,
            roomGuildRatio              => 0.7,
            exitTagRatio                => 0.7,

lib/Games/Axmud/OtherWin.pm  view on Meta::CPAN

        $frame->set_size_request(64, 64);
        $frame->set_shadow_type($axmud::CLIENT->constShadowType);

        my $image = Gtk3::Image->new_from_file($axmud::CLIENT->getDialogueIcon());
        $frame->add($image);

        # Create a notebook on the right
        my $notebook = Gtk3::Notebook->new();
        $hBox->pack_start($notebook, TRUE, TRUE, $self->spacingPixels);
        $notebook->set_scrollable(TRUE);
        $notebook->popup_enable();

        # Create a button at the bottom
        my $hBox2 = Gtk3::HBox->new(FALSE, 0);
        $packingBox->pack_end($hBox2, FALSE, FALSE, $self->spacingPixels);

        # The button's label includes some extra space characters to make it a little easier to
        #   click on
        my $button = Gtk3::Button->new('  OK  ');
        $hBox2->pack_end($button, FALSE, FALSE, 0);
        $button->get_child->set_width_chars(10);

lib/Games/Axmud/OtherWin.pm  view on Meta::CPAN

        $treeView->get_selection->set_mode('browse');
        $treeView->get_selection->signal_connect('changed' => \&treeViewChanged, $self);

        # Fill the tree
        $self->setupTreeView($treeView);

        # Add a notebook on the right. Later, this might be replaced by a second Gtk3::HPaned
        my $notebook = Gtk3::Notebook->new();
        $hPaned->pack2($notebook, TRUE, FALSE);
        $notebook->set_scrollable(TRUE);
        $notebook->popup_enable();

        $hPaned->set_position($self->leftWidth);

        # Set up the window's background photo using a CSS style
        my $provider = Gtk3::CssProvider->new();
        my $display = Gtk3::Gdk::Display::get_default();
        my $screen = Gtk3::Gdk::Display::get_default_screen($display);
        # (Don't call ->add_provider_for_screen so that the style is only applied to this window)
#        Gtk3::StyleContext::add_provider_for_screen($screen, $provider, 600);

lib/Games/Axmud/PrefWin.pm  view on Meta::CPAN

        my $button = $self->addButton($grid,
            'Test icons', 'Test irreversible icons', undef,
            10, 12, 10, 11);
        $button->signal_connect('clicked' => sub {

            $self->session->pseudoCmd('toggleirreversible -t', $self->pseudoCmdMode);
        });

        my $checkButton11 = $self->addCheckButton(
            $grid,
            'Show popup windows during long operations (loading large files, drawing large maps'
            . ' etc)',
            undef,
            TRUE,
            1, 12, 11, 12);
        $checkButton11->set_active($axmud::CLIENT->allowBusyWinFlag);
        $checkButton11->signal_connect('toggled' => sub {

            if (
                ($checkButton11->get_active && ! $axmud::CLIENT->allowBusyWinFlag)
                || (! $checkButton11->get_active && $axmud::CLIENT->allowBusyWinFlag)
            ) {
                $self->session->pseudoCmd('togglepopup',  $self->pseudoCmdMode);
            }
        });

        my $checkButton12 = $self->addCheckButton(
            $grid, 'Collect connection histories for each world', undef, TRUE,
            1, 12, 12, 13);
        $checkButton12->set_active($axmud::CLIENT->connectHistoryFlag);
        $checkButton12->signal_connect('toggled' => sub {

            if (

lib/Games/Axmud/Session.pm  view on Meta::CPAN

                    $self->ivAdd('sessionFileObjHash', 'worldmodel', $worldModelFileObj);
                    # The world profile's file object must appear in the GA::Client's registry and
                    #   the GA::Session's registry too
                    $self->ivAdd(
                        'sessionFileObjHash',
                        $worldName,
                        $axmud::CLIENT->ivShow('fileObjHash', $worldName),
                    );

                    # Load the 'otherprof' and 'worldmodel' data files (which sets IVs such as the
                    #   cage registries). If the files are big, show a 'loading...' popup
                    $otherProfPath = $axmud::DATA_DIR . $otherProfFileObj->standardPath;
                    if (
                        (-e $otherProfPath)
                        && (-s $otherProfPath) > $axmud::CLIENT->constLargeFileSize
                    ) {
                        $self->mainWin->showBusyWin();
                    }

                    if (! $otherProfFileObj->loadDataFile()) {

lib/Games/Axmud/Session.pm  view on Meta::CPAN

            $linkObj->ivPoke('mxpPromptFlag', $ivHash{'prompt'});   # Never 'undef'
            $linkObj->ivPoke('expireName', $ivHash{'expire'});      # May be 'undef'
            $linkObj->ivPoke('mxpFlag', TRUE);

            $href = $linkObj->href;
            $hint = $linkObj->hint;
            if (
                $href
                && (! $hint || $href =~ m/.\|./ || $hint =~ m/.\|./)
            ) {
                # When the link is clicked, a popup menu should be displayed. Set IVs to prepare
                #   for that
                $linkObj->ivPoke('popupFlag', TRUE);

                @cmdList = split('\|', $href);
                if ($hint) {

                    @optionList = split('\|', $hint);

                    if (((scalar @cmdList) + 1) == (scalar @optionList)) {

                        # The first item in @optionList is the hint; the rest are menu items
                        $linkObj->ivPoke('hint', shift @optionList);

lib/Games/Axmud/Session.pm  view on Meta::CPAN

                    } else {

                        $linkObj->ivPoke('hint', undef);
                    }

                } else {

                    $linkObj->ivPoke('hint', undef);
                }

                $linkObj->ivPoke('popupCmdList', @cmdList);
                $linkObj->ivPoke('popupItemList', @optionList);
            }

            # Store the current link object (the link isn't applied to the textview until the
            #   corresponding </SEND> tag is processed, although any text inside the
            #   <SEND>...</SEND> is displayed immediately, as normal)
            $self->ivPoke('mxpCurrentSend', $linkObj);

            # Also need to create a new MXP stack object and store it in the current textview
            #   object, updating the latter's IVs
            if (! $textViewObj->createMxpStackObj($self, 'SEND')) {

lib/Games/Axmud/Session.pm  view on Meta::CPAN

                $href = $linkObj->href;
                $text = $linkObj->text;
                if ($href && $text && $linkObj->type ne 'image') {

                    $href =~ s/\&text\;/$text/g;
                    $href = $self->replaceMxpEntities($href);

                    $linkObj->ivPoke('href', $href);
                }

                # Do the same, if a popup menu is to be created
                foreach my $item ($linkObj->popupCmdList) {

                    $item =~ s/\&text\;/$text/g;
                    $item = $self->replaceMxpEntities($item);

                    push (@cmdList, $item);
                }

                foreach my $item ($linkObj->popupItemList) {

                    $item =~ s/\&text\;/$text/g;
                    $item = $self->replaceMxpEntities($item);

                    push (@optionList, $item);
                }

                $linkObj->ivPoke('popupCmdList', @cmdList);
                $linkObj->ivPoke('popupItemList', @optionList);
            }

            # Close the <SEND>...</SEND> construction, if the calling function isn't doing that (the
            #   TRUE function means don't call this function back, as you normally would)
            if (! $noPopFlag) {

                return $self->popMxpStack($keyword, TRUE);

            } else {

lib/Games/Axmud/Table.pm  view on Meta::CPAN


        # Check for improper arguments
        if (defined $check) {

             return $axmud::CLIENT->writeImproper($self->_objClass . '->drawNotebook', @_);
        }

        # Create the notebook, stored in $self->notebook
        my $notebook = Gtk3::Notebook->new();
        $notebook->set_scrollable(TRUE);
        $notebook->popup_enable();
        $notebook->set_can_focus(FALSE);

        # Gtk3::Notebook created
        $self->packingBox2->pack_start($notebook, TRUE, TRUE, 0);
        # Set up ->signal_connects
        $self->setSwitchPageEvent($notebook);

        # Update IVs
        $self->ivPoke('notebook', $notebook);

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


        # Setup complete
        return $column_labels;
    }

    # Popup menu widget methods

    sub enableCanvasPopupMenu {

        # Called by $self->canvasEventHandler
        # Creates a popup-menu for the Gtk3::Canvas when no rooms, exits, room tags or labels are
        #   selected
        #
        # Expected arguments
        #   $clickXPosPixels, $clickYPosPixels
        #       - Coordinates of the pixel that was right-clicked on the map
        #   $clickXPosBlocks, $clickYPosBlocks
        #       - Coordinates of the gridblock that was right-clicked on the map
        #
        # Return values
        #   'undef' on improper arguments or if the widget can't be created

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        ) = @_;

        # Check for improper arguments
        if (
            ! defined $clickXPosPixels || ! defined $clickYPosPixels
            || ! defined $clickXPosBlocks || ! defined $clickYPosBlocks || defined $check
        ) {
            return $axmud::CLIENT->writeImproper($self->_objClass . '->enableCanvasPopupMenu', @_);
        }

        # Set up the popup menu
        my $menu_canvas = Gtk3::Menu->new();
        if (! $menu_canvas) {

            return undef;
        }

        # (Everything here assumes $self->currentRegionmap)

        my $item_addFirstRoom = Gtk3::ImageMenuItem->new('Add _first room');
        my $img_addFirstRoom = Gtk3::Image->new_from_stock('gtk-add', 'menu');

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


        # Setup complete
        $menu_canvas->show_all();

        return $menu_canvas;
    }

    sub enableRoomsPopupMenu {

        # Called by $self->canvasObjEventHandler
        # Creates a popup-menu for the selected room
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if the widget can't be created
        #   Otherwise returns the Gtk3::Menu created

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->enableRoomsPopupMenu', @_);
        }

        # Set up the popup menu
        my $menu_rooms = Gtk3::Menu->new();
        if (! $menu_rooms) {

            return undef;
        }

        # (Everything here assumes $self->currentRegionmap and $self->selectedRoom)

        my $item_setCurrentRoom = Gtk3::MenuItem->new('_Set current room');
        $item_setCurrentRoom->signal_connect('activate' => sub {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


        # Setup complete
        $menu_rooms->show_all();

        return $menu_rooms;
    }

    sub enableRoomTagsPopupMenu {

        # Called by $self->canvasObjEventHandler
        # Creates a popup-menu for the selected room tag
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if the widget can't be created
        #   Otherwise returns the Gtk3::Menu created

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper(
                $self->_objClass . '->enableRoomTagsPopupMenu',
                @_,
            );
        }

        # Set up the popup menu
        my $menu_tags = Gtk3::Menu->new();
        if (! $menu_tags) {

            return undef;
        }

        # (Everything here assumes $self->currentRegionmap and $self->selectedRoomTag)

        my $item_editTag = Gtk3::MenuItem->new('_Set room tag...');
        $item_editTag->signal_connect('activate' => sub {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


        # Setup complete
        $menu_tags->show_all();

        return $menu_tags;
    }

    sub enableRoomGuildsPopupMenu {

        # Called by $self->canvasObjEventHandler
        # Creates a popup-menu for the selected room guild
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if the widget can't be created
        #   Otherwise returns the Gtk3::Menu created

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper(
                $self->_objClass . '->enableRoomGuildsPopupMenu',
                @_,
            );
        }

        # Set up the popup menu
        my $menu_guilds = Gtk3::Menu->new();
        if (! $menu_guilds) {

            return undef;
        }

        # (Everything here assumes $self->currentRegionmap and $self->selectedRoomGuild)

        my $item_editGuild = Gtk3::MenuItem->new('_Set room guild...');
        $item_editGuild->signal_connect('activate' => sub {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


        # Setup complete
        $menu_guilds->show_all();

        return $menu_guilds;
    }

    sub enableExitsPopupMenu {

        # Called by $self->canvasObjEventHandler
        # Creates a popup-menu for the selected exit
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if the widget can't be created
        #   Otherwise returns the Gtk3::Menu created

        my ($self, $check) = @_;

        # Local variables
        my @titleList;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->enableExitsPopupMenu', @_);
        }

        # Set up the popup menu
        my $menu_exits = Gtk3::Menu->new();
        if (! $menu_exits) {

            return undef;
        }

        # (Everything here assumes $self->currentRegionmap and $self->selectedExit)

            # 'Allocate map direction' submenu
            my $subMenu_setDir = Gtk3::Menu->new();

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


        # Setup complete
        $menu_exits->show_all();

        return $menu_exits;
    }

    sub enableExitTagsPopupMenu {

        # Called by $self->canvasObjEventHandler
        # Creates a popup-menu for the selected exit tag
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if the widget can't be created
        #   Otherwise returns the Gtk3::Menu created

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper(
                $self->_objClass . '->enableExitTagsPopupMenu',
                @_,
            );
        }

        # Set up the popup menu
        my $menu_tags = Gtk3::Menu->new();
        if (! $menu_tags) {

            return undef;
        }

        # (Everything here assumes $self->currentRegionmap and $self->selectedExitTag)

        my $item_editTag = Gtk3::MenuItem->new('_Edit exit tag');
        $item_editTag->signal_connect('activate' => sub {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


        # Setup complete
        $menu_tags->show_all();

        return $menu_tags;
    }

    sub enableLabelsPopupMenu {

        # Called by $self->canvasObjEventHandler
        # Creates a popup-menu for the selected label
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if the widget can't be created
        #   Otherwise returns the Gtk3::Menu created

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->enableLabelsPopupMenu', @_);
        }

        # Set up the popup menu
        my $menu_labels = Gtk3::Menu->new();
        if (! $menu_labels) {

            return undef;
        }

        # (Everything here assumes $self->currentRegionmap and $self->selectedLabel)

        my $item_setLabel = Gtk3::ImageMenuItem->new('_Set label...');
        my $img_setLabel = Gtk3::Image->new_from_stock('gtk-edit', 'menu');

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        # Not worth calling $self->redrawWidgets, so must do a ->show_all()
        $toolbar->show_all();

        return 1;
    }

    sub addToolbar {

        # Called by a ->signal_connect in $self->drawToolbar whenever the user clicks the original
        #   toolbar's add button
        # Creates a popup menu containing all of the button sets that aren't currently visible, then
        #   imlements the user's choice
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if there's an error
        #   1 otherwise

        my ($self, $check) = @_;

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

                $hash{$descrip} = $set;
            }
        }

        if (! @list) {

            # All button sets are visible (this shouldn't happen)
            return undef;
        }

        # Set up the popup menu
        my $popupMenu = Gtk3::Menu->new();
        if (! $popupMenu) {

            return undef;
        }

        # Add a title menu item, which does nothing
        my $title_item = Gtk3::MenuItem->new('Add button set:');
        $title_item->signal_connect('activate' => sub {

            return undef;
        });
        $title_item->set_sensitive(FALSE);
        $popupMenu->append($title_item);

        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        # Fill the popup menu with button sets
        foreach my $descrip (@list) {

            my $menu_item = Gtk3::MenuItem->new($descrip);
            $menu_item->signal_connect('activate' => sub {

                # Add the set to the world model's list of button sets...
                $self->worldModelObj->add_buttonSet($hash{$descrip});
                # ...then redraw the window component containing the toolbar(s)
                $self->redrawWidgets('toolbar');
            });
            $popupMenu->append($menu_item);
        }

        # Also add a 'Cancel' menu item, which does nothing
        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        my $cancel_item = Gtk3::MenuItem->new('Cancel');
        $cancel_item->signal_connect('activate' => sub {

            return undef;
        });
        $popupMenu->append($cancel_item);

        # Display the popup menu
        $popupMenu->popup(
            undef, undef, undef, undef,
            1,                              # Left mouse button
            Gtk3::get_current_event_time(),
        );

        $popupMenu->show_all();

        # Operation complete. Now wait for the user's response
        return 1;
    }

    sub removeToolbar {

        # Called by a ->signal_connect in $self->drawToolbar whenever the user clicks on the remove
        #   button in any toolbar except the original one
        # Removes the specified toolbar and updates IVs

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

            }
        }

        return @buttonList;
    }

    sub addRoomFlagButton {

        # Called by a ->signal_connect in $self->drawPaintingButtonSet whenever the user clicks the
        #   'add room flag' button in the 'painting' button set
        # Creates a popup menu containing all room flags, then implements the user's choice
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments or if there's an error
        #   1 otherwise

        my ($self, $check) = @_;

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

            return $axmud::CLIENT->writeImproper($self->_objClass . '->addRoomFlagButton', @_);
        }

        # Compile a hash of existing preferred room flags (we don't want the user to add the same
        #   room flag twice)
        foreach my $roomFlag ($self->worldModelObj->preferRoomFlagList) {

            $checkHash{$roomFlag} = undef;
        }

        # Set up the popup menu
        my $popupMenu = Gtk3::Menu->new();
        if (! $popupMenu) {

            return undef;
        }

        # Add a title menu item, which does nothing
        my $title_item = Gtk3::MenuItem->new('Add preferred room flag:');
        $title_item->signal_connect('activate' => sub {

            return undef;
        });
        $title_item->set_sensitive(FALSE);
        $popupMenu->append($title_item);

        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        # Fill the popup menu with room flags
        foreach my $filter ($axmud::CLIENT->constRoomFilterList) {

            # A sub-sub menu for $filter
            my $subSubMenu_filter = Gtk3::Menu->new();

            my @nameList = $self->worldModelObj->getRoomFlagsInFilter($filter);
            foreach my $name (@nameList) {

                my $obj = $self->worldModelObj->ivShow('roomFlagHash', $name);
                if ($obj) {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


            if (! @nameList) {

                my $menuItem = Gtk3::MenuItem->new('(No flags in this filter)');
                $menuItem->set_sensitive(FALSE);
                $subSubMenu_filter->append($menuItem);
            }

            my $menuItem = Gtk3::MenuItem->new(ucfirst($filter));
            $menuItem->set_submenu($subSubMenu_filter);
            $popupMenu->append($menuItem);
        }

        # Also add a 'Cancel' menu item, which does nothing
        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        my $cancel_item = Gtk3::MenuItem->new('Cancel');
        $cancel_item->signal_connect('activate' => sub {

            return undef;
        });
        $popupMenu->append($cancel_item);

        # Display the popup menu
        $popupMenu->popup(
            undef, undef, undef, undef,
            1,                              # Left mouse button
            Gtk3::get_current_event_time(),
        );

        $popupMenu->show_all();

        # Operation complete. Now wait for the user's response
        return 1;
    }

    sub removeRoomFlagButton {

        # Called by a ->signal_connect in $self->drawPaintingButtonSet whenever the user clicks the
        #   'remove room flag' button in the 'painting' button set
        # Removes the specified room flag from the toolbar and updates IVs

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        #   1 otherwise

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->removeRoomFlagButton', @_);
        }

        # Set up the popup menu
        my $popupMenu = Gtk3::Menu->new();
        if (! $popupMenu) {

            return undef;
        }

        # Add a title menu item, which does nothing
        my $title_item = Gtk3::MenuItem->new('Remove preferred room flag:');
        $title_item->signal_connect('activate' => sub {

            return undef;
        });
        $title_item->set_sensitive(FALSE);
        $popupMenu->append($title_item);

        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        # Fill the popup menu with room flags
        foreach my $roomFlag ($self->worldModelObj->preferRoomFlagList) {

            my $menu_item = Gtk3::MenuItem->new($roomFlag);
            $menu_item->signal_connect('activate' => sub {

                # Remove the room flag from the world model's list of preferred room flags...
                $self->worldModelObj->del_preferRoomFlag($roomFlag);
                # ...and from the painter object iself...
                $self->worldModelObj->painterObj->ivDelete('roomFlagHash', $roomFlag);
                # ...then redraw the window component containing the toolbar(s)
                $self->redrawWidgets('toolbar');
            });
            $popupMenu->append($menu_item);
        }

        # Add a 'remove all' menu item
        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        my $remove_all_item = Gtk3::MenuItem->new('Remove all');
        $remove_all_item->signal_connect('activate' => sub {

            my ($total, $choice);

            $total = scalar $self->worldModelObj->preferRoomFlagList;

            # If there's more than one colour, prompt the user for confirmation
            if ($total > 1) {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

                #   tools)
                foreach my $roomFlag ($self->worldModelObj->preferRoomFlagList) {

                    $self->worldModelObj->ivDelete('roomFlagHash', $roomFlag);
                }

                # Then redraw the window component containing the toolbar(s)
                $self->redrawWidgets('toolbar');
            }
        });
        $popupMenu->append($remove_all_item);

        # Also add a 'Cancel' menu item, which does nothing
        my $cancel_item = Gtk3::MenuItem->new('Cancel');
        $cancel_item->signal_connect('activate' => sub {

            return undef;
        });
        $popupMenu->append($cancel_item);

        # Display the popup menu
        $popupMenu->popup(
            undef, undef, undef, undef,
            1,                              # Left mouse button
            Gtk3::get_current_event_time(),
        );

        $popupMenu->show_all();

        # Operation complete. Now wait for the user's response
        return 1;
    }

    sub addBGColourButton {

        # Called by a ->signal_connect in $self->drawBackgroundButtonSet whenever the user clicks
        #   the 'add background colour' button in the 'background' button set
        # Prompts the user for a new RGB colour tag, then implements the user's choice

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        #   1 otherwise

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->removeBGColourButton', @_);
        }

        # Set up the popup menu
        my $popupMenu = Gtk3::Menu->new();
        if (! $popupMenu) {

            return undef;
        }

        # Add a title menu item, which does nothing
        my $title_item = Gtk3::MenuItem->new('Remove preferred background colour:');
        $title_item->signal_connect('activate' => sub {

            return undef;
        });
        $title_item->set_sensitive(FALSE);
        $popupMenu->append($title_item);

        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        # Fill the popup menu with colours
        foreach my $colour ($self->worldModelObj->preferBGColourList) {

            my $menu_item = Gtk3::MenuItem->new($colour);
            $menu_item->signal_connect('activate' => sub {

                # Remove the colour from the world model's list of preferred background colours...
                $self->worldModelObj->del_preferBGColour($colour);
                # ...then redraw the window component containing the toolbar(s)
                $self->redrawWidgets('toolbar');
            });
            $popupMenu->append($menu_item);
        }

        # Add a 'remove all' menu item
        $popupMenu->append(Gtk3::SeparatorMenuItem->new());     # Separator

        my $remove_all_item = Gtk3::MenuItem->new('Remove all');
        $remove_all_item->signal_connect('activate' => sub {

            my ($total, $choice);

            $total = scalar $self->worldModelObj->preferBGColourList;

            # If there's more than one colour, prompt the user for confirmation
            if ($total > 1) {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

            }

            if (defined $choice && $choice eq 'yes') {

                # Reset the world model's list of preferred background colour...
                $self->worldModelObj->reset_preferBGColourList();
                # ...then redraw the window component containing the toolbar(s)
                $self->redrawWidgets('toolbar');
            }
        });
        $popupMenu->append($remove_all_item);

        # Also add a 'Cancel' menu item, which does nothing
        my $cancel_item = Gtk3::MenuItem->new('Cancel');
        $cancel_item->signal_connect('activate' => sub {

            return undef;
        });
        $popupMenu->append($cancel_item);

        # Display the popup menu
        $popupMenu->popup(
            undef, undef, undef, undef,
            1,                              # Left mouse button
            Gtk3::get_current_event_time(),
        );

        $popupMenu->show_all();

        # Operation complete. Now wait for the user's response
        return 1;
    }

    # Treeview widget methods

    sub enableTreeView {

        # Called by $self->drawWidgets

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        my ($self, $check) = @_;

        # Check for improper arguments
        if (defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->enableTooltips', @_);
        }

        # Create a Gtk3::Window to act as a tooltip, being visible (or not) as appropriate
        my $tooltipLabel = Gtk3::Label->new();
        my $tooltipWin = Gtk3::Window->new('popup');
        $tooltipWin->set_decorated(FALSE);
        $tooltipWin->set_position('mouse');
        $tooltipWin->set_border_width(2);
        $tooltipWin->modify_fg('normal', [Gtk3::Gdk::Color::parse('black')]->[1]);
        $tooltipWin->modify_bg('normal', [Gtk3::Gdk::Color::parse('yellow')]->[1]);
        $tooltipWin->add($tooltipLabel);

        # Update IVs
        $self->ivPoke('canvasTooltipObj', undef);
        $self->ivPoke('canvasTooltipObjType', undef);

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        #   'undef' on improper arguments, if there is no region map or if the signal $event is one
        #       that this function doesn't handle
        #   1 otherwise

        my ($self, $canvasObj, $event, $check) = @_;

        # Local variables
        my (
            $clickXPosPixels, $clickYPosPixels, $clickType, $button, $shiftFlag, $ctrlFlag,
            $clickXPosBlocks, $clickYPosBlocks, $newRoomObj, $roomNum, $roomObj, $exitObj, $listRef,
            $result, $twinExitObj, $result2, $popupMenu,
        );

        # Check for improper arguments
        if (! defined $canvasObj || ! defined $event || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->canvasEventHandler', @_);
        }

        # Don't do anything if there is no current regionmap
        if (! $self->currentRegionmap) {

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        }

        if ($roomObj && $clickType eq 'single' && $self->currentRegionmap->gridExitHash) {

            # Usually, when we click on the map on an empty pixel, all selected objects are
            #   unselected
            # However, because exits are often drawn only 1 pixel wide, they're quite difficult to
            #   click on. This section checks whether the mouse click occured close enough to an
            #   exit
            # A left-click near an exit causes the exit to be selected/unselected. A right-click
            #   selects the exit (unselecting everything else) and opens a popup menu for that exit.
            #   If the click isn't close enough to an exit, the user is deemed to have clicked in
            #   open space
            # (NB If no exits have been drawn, don't bother checking)

            # Now we check if they clicked near an exit, or in open space
            $exitObj = $self->findClickedExit(
                $clickXPosPixels,
                $clickYPosPixels,
                $roomObj,
                $self->currentRegionmap,

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

                    }

                } elsif ($button eq 'right') {

                    # Select the exit, unselecting all other selected objects
                   $self->setSelectedObj(
                        [$exitObj, 'exit'],
                        FALSE,          # Select this object; unselect all other objects
                    );

                    # Create the popup menu
                    if ($self->selectedExit) {

                        $popupMenu = $self->enableExitsPopupMenu();
                        if ($popupMenu) {

                            $popupMenu->popup(
                                undef, undef, undef, undef,
                                $event->button,
                                $event->time,
                            );
                        }
                    }
                }

                return 1;
            }
        }

        # Otherwise, the user clicked in open space

        # If it was a right-click, open a popup menu
        if ($clickType eq 'single' && $button eq 'right') {

            $popupMenu = $self->enableCanvasPopupMenu(
                $clickXPosPixels,
                $clickYPosPixels,
                $clickXPosBlocks,
                $clickYPosBlocks,
            );

            if ($popupMenu) {

                $popupMenu->popup(
                    undef, undef, undef, undef,
                    $event->button,
                    $event->time,
                );
            }

        # If it was a left-click, it's potentially a selection box operation
        } elsif ($clickType eq 'single' && $button eq 'left') {

            # The selection box isn't actually drawn until the user moves their mouse. If they

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        # Return values
        #   'undef' on improper arguments or if the signal $event is one that this function doesn't
        #       handle
        #   1 otherwise

        my ($self, $objType, $canvasObj, $modelObj, $event, $check) = @_;

        # Local variables
        my (
            $clickType, $button, $shiftFlag, $ctrlFlag, $selectFlag, $clickTime, $otherRoomObj,
            $startX, $stopX, $startY, $stopY, $result, $twinExitObj, $result2, $popupMenu,
        );

        # Check for improper arguments
        if (
            ! defined $objType || ! defined $canvasObj || ! defined $modelObj || ! defined $event
            || defined $check
        ) {
            return $axmud::CLIENT->writeImproper($self->_objClass . '->canvasObjEventHandler', @_);
        }

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN


                } else {

                    $self->setSelectedObj(
                        [$modelObj, $objType],
                        FALSE,          # Select this object; unselect all other objects
                    );
                }
            }

            # Create the popup menu
            if ($objType eq 'room' && $self->selectedRoom) {
                $popupMenu = $self->enableRoomsPopupMenu();
            } elsif ($objType eq 'room_tag' && $self->selectedRoomTag) {
                $popupMenu = $self->enableRoomTagsPopupMenu();
            } elsif ($objType eq 'room_guild' && $self->selectedRoomGuild) {
                $popupMenu = $self->enableRoomGuildsPopupMenu();
            } elsif ($objType eq 'exit_tag' && $self->selectedExitTag) {
                $popupMenu = $self->enableExitTagsPopupMenu();
            } elsif ($objType eq 'exit' && $self->selectedExit) {

                # Store the position of the right-click, in case the user wants to add a bend from
                #   the popup menu
                $self->ivPoke('exitClickXPosn', int($event->x));
                $self->ivPoke('exitClickYPosn', int($event->y));
                # Now we can open the poup menu
                $popupMenu = $self->enableExitsPopupMenu();

            } elsif ($objType eq 'label' && $self->selectedLabel) {

                $popupMenu = $self->enableLabelsPopupMenu();
            }

            if ($popupMenu) {

                $popupMenu->popup(undef, undef, undef, undef, $event->button, $event->time);
            }
        }

        return 1;
    }

    sub deleteCanvasObj {

        # Called by numerous functions
        #

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

            if (! $count) {

                $count = 0;
            }

            # For the message we're about to compose, @regionmapList must contain the affected
            #   regionmap
            push (@regionmapList, $self->currentRegionmap);
        }

        # Display a popup showing the results
        $msg = 'Recalculation complete: ';

        if (! $count) {
            $msg .= 'no region paths found';
        } elsif ($count == 1) {
            $msg .= '1 region path found';
        } else {
            $msg .= $count . ' region paths found';
        }

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        #   ->findPath)
        ($roomListRef, $exitListRef) = $self->worldModelObj->findUniversalPath(
            $self->session,
            $self->mapObj->currentRoom,
            $self->selectedRoom,
            $self->worldModelObj->avoidHazardsFlag,
        );

        if (! defined $roomListRef || ! @$roomListRef) {

            # There is no path between the current and selected room. Notify the user with a popup
            $self->showMsgDialogue(
                'No path found',
                'warning',
                'There is no known path between the current room (#'
                . $self->mapObj->currentRoom->number . ') and the selected room (#'
                . $self->selectedRoom->number . ')',
                'ok',
            );

            return undef;

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

                if ($roomName eq '<unnamed room>') {
                    $roomName = '(unnamed room)';
                } elsif (length($roomName) > 31) {
                    $roomName = substr($roomName, 0, 29) . '...';
                }

                $msg .= $roomName . "'";
            }
        }

        # Display a popup to show the results
        $self->showMsgDialogue(
            'Identify rooms',
            'info',
            $msg,
            'ok',
            undef,
            TRUE,           # Preserve newline characters in $msg
        );

        return 1;

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

                $msg .= "   #" . $exitObj->number . " '" . $exitObj->dir . "' (room #"
                            . $exitObj->parent . ")\n";

            } else {

                $msg .= "   #" . $exitObj->number . " '" . $exitObj->dir . "' [" . $exitObj->mapDir
                            . "] (room #" . $exitObj->parent . ")\n";
            }
        }

        # Display a popup to show the results
        $self->showMsgDialogue(
            'Identify exits',
            'info',
            $msg,
            'ok',
            undef,
            TRUE,           # Preserve newline characters in $msg
        );

        return 1;

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

            TRUE,           # Update Automapper windows now
            @finalList,
        );

        return 1;
    }

    sub addBendCallback {

        # Called by $self->enableExitsPopupMenu (only)
        # After a right-click on an exit, when the user has selected 'add bend' in the popup menu,
        #   add a bend at the same position
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments, if the standard callback check fails or if the bend is
        #       not added
        #   1 otherwise

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

                );
            }

            return undef;
        }
    }

    sub removeBendCallback {

        # Called by $self->enableExitsPopupMenu (only)
        # After a right-click on an exit, when the user has selected 'remove bend' in the popup
        #   menu, remove the bend closest to the clicked position
        #
        # Expected arguments
        #   (none besides $self)
        #
        # Return values
        #   'undef' on improper arguments, if the standard callback check fails or if the mouse
        #       click was not near a bend
        #   1 otherwise

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

        } else {

            # Mouse button was not release over a suitable destination room
            return undef;
        }
    }

    sub findExitClick {

        # Called by $self->addBendCallback and ->findExitBend
        # After a right-click on an exit, when the user has selected 'add bend' in the popup menu,
        #   find the position of the click relative to the start of the middle (bending) section of
        #   the drawn exit (the bending section starts at the same position, that an uncertain exit
        #   would end). Returns the relative position of the click, as well as the absolute
        #   position of the start and end of the bending section
        # (When called by ->findExitBend, process a left-mouse click)
        #
        # Expected arguments
        #   $exitObj                - The exit that was right-clicked
        #   $clickXPos, $clickYPos  - The position of the mouse click on the canvas
        #

lib/Language/Axbasic.pm  view on Meta::CPAN

                'getroomtag$'           => '',
                'getroomtitle$'         => '',
                'iface$'                => '',
                'ifacedata$'            => '',
                'ifacename$'            => '',
                'ifacepop$'             => '',
                'ifaceselect$'          => 'N',
                'ifaceshift$'           => '',
                'ifacetext$'            => '',
                'ifacetype$'            => '',
                'popup$'                => 'SSS',
                'scriptname$'           => '',
                'showprofile$'          => '',
                'unabbrevdir$'          => 'S',
            },
            # While parsing the script (in $self->parse), we need to keep track of whether the line
            #   being parsed is within a subroutine declaration, or whether it is outside one - so
            #   that we can detect subroutines declared inside another, and respond to correctly to
            #   an END SUB
            # While parsing statements inside a subroutine declaration, this IV stores the
            #   LA::Subroutine. While parsing statements outside a subroutine declaration (but

lib/Language/Axbasic/Function.pm  view on Meta::CPAN

                'notificationList',
                $self->scriptObj->currentNotification,
            );

            # Return its category
            return $obj->category;
        }
    }
}

{ package Language::Axbasic::Function::Intrinsic::String::popup;

    use strict;
    use warnings;
#   use diagnostics;

    use Glib qw(TRUE FALSE);

    @Language::Axbasic::Function::Intrinsic::String::popup::ISA = qw(
        Language::Axbasic::Function::Intrinsic::String
    );

    # Popup$ (type, text, response)

    ##################
    # Methods

    sub evaluate {

share/docs/guide/ch11.html  view on Meta::CPAN

<p>If you're connected to several worlds at the same time, you might also find the Watch task useful. Everything displayed in Channels, Chat and Divert task windows, in any session, is copied into any Watch task window that's open.</p>
<h2><a name="11.7">11.7 The Chat task</a></h2>
<p>The Chat task is an instant messenger service. It is an almost complete implementation of the MudMaster and zChat protocols (only encryption has not yet been implemented).</p>
<p>Several popular MUD clients implement these protocols, so your friends don't need to be using Axmud; they only need to be using a compatible MUD client.</p>
<p>There are some issues of security to consider, so we recommend you read the whole of this Section before using the task.</p>
<p>You can get started by listening out for incoming calls.</p>
<pre><code>    ;chatlisten
    ;listen
</code></pre>
<p>When you receive an incoming call, you can either accept or decline it.</p>
<p><img alt="Incoming chat popup" src="img/ch11/incoming_chat.png"></p>
<p>For outgoing calls you'll need to know your friend's IP address and the port they're using for chat sessions.</p>
<p>Calls can be made with either protocol. The zChat protocol is slightly more powerful, so let's use that.</p>
<pre><code>    ;chatzcall 159.200.36.251 4050
    ;zcall 159.200.36.251 4050
</code></pre>
<p>Most MUD clients use the port 4050, so it's normally safe to omit it.</p>
<pre><code>    ;chatzcall 159.200.36.251
    ;zcall 159.200.36.251
</code></pre>
<p>You can also call someone using the main window menu.</p>

share/docs/guide/ch11.mkd  view on Meta::CPAN


There are some issues of security to consider, so we recommend you read the whole of this Section before using the task.

You can get started by listening out for incoming calls.

        ;chatlisten
        ;listen

When you receive an incoming call, you can either accept or decline it.

![Incoming chat popup](img/ch11/incoming_chat.png)

For outgoing calls you'll need to know your friend's IP address and the port they're using for chat sessions.

Calls can be made with either protocol. The zChat protocol is slightly more powerful, so let's use that.

        ;chatzcall 159.200.36.251 4050
        ;zcall 159.200.36.251 4050

Most MUD clients use the port 4050, so it's normally safe to omit it.

share/docs/guide/ch15.html  view on Meta::CPAN

<li>In the edit window that appears, click the <strong>Label styles</strong> tab</li>
<li>Select a style by clicking on it</li>
<li>Click the <strong>Edit</strong> button</li>
<li>Make any changes you want in the new edit window</li>
<li>Click the <strong>OK</strong> button in both edit windows to apply your changes</li>
</ul>
<p>The best way to use label styles is to use one style for titles, another style for street names, another style for warnings, and so on.</p>
<p>If you want a label with its own unique colours, you can modify the appearance of that label only.</p>
<ul>
<li>Right-click the label</li>
<li>In the popup menu that appears, select <strong>Customise label...</strong></li>
<li>Make any changes you want, and click the <strong>OK</strong> button</li>
</ul>
<p>If you want to get rid of the unique colours, you can do this:</p>
<ul>
<li>Right-click the label</li>
<li>In the popup menu that appears, select <strong>Set label...</strong></li>
<li>Select a label style, and click the <strong>OK</strong> button</li>
</ul>
<p>If you want to creates labels with multiple lines of text, you can do this:</p>
<ul>
<li>From the menu, select <strong>Labels &gt; Use multiline labels</strong><ul>
<li>Repeat this step to go back to single-line labels</li>
<li>This setting only affects new labels. If you turn off multiline labels, any existing multiline labels are not affected</li>
</ul>
</li>
</ul>

share/docs/guide/ch15.html  view on Meta::CPAN

<h3><a name="15.22.1">15.22.1 Using the room painting toolbar</a></h3>
<p>The room painting toolbar can be used instead of the menus.  In many ways it's more convenient.</p>
<p><img alt="Room painting toolbar" src="img/ch15/paint_toolbar.png"></p>
<ul>
<li>Click the paintbrush button to enable the painter</li>
<li>Click the <strong>Ne</strong> button to paint only new rooms, or the <strong>All</strong> button to paint all rooms</li>
</ul>
<p>Now you can add your favourite room flags.</p>
<ul>
<li>Click the plus button</li>
<li>In the popup menu, select <strong>Terrain &gt; Room is in a forest/wood</strong></li>
<li>A new green button will appear</li>
</ul>
<p>You can add as many favourite room flags as you like.  Each room flag aren't actually applied until you have clicked its button to select it.  Click the button a second time to unselect it.</p>
<p>The remaining buttons in this toolbar are used for wilderness rooms, discussed in <a href="#15.24">Section 15.24</a>.</p>
<h3><a name="15.22.2">15.22.2 Using the quick painting toolbar</a></h3>
<p>The painter described above is fine for painting rooms as you move around, but if you just want to toggle room flags in existing roms, you can use the quick painting toolbar.</p>
<p><img alt="Quick painting toolbar" src="img/ch15/quick_toolbar.png"></p>
<p>This toolbar doesn't interact with the painter, but it does use the same set of favourite room flags. (Click the plus button to add some favourite room flags, if none currently exist).</p>
<p>Using this toolbar is as simple as clicking on a coloured button, then clicking on a room.</p>
<p>If you click on a selected room, the room flag is toggled in any other selected rooms at the same time. (If you're not careful, this can mean that a particular room flag is turned <em>on</em> in some rooms, and turned <em>off</em> in others!)</p>

share/docs/guide/ch15.html  view on Meta::CPAN

<li>Click the paintbrush button to enable the painter</li>
<li>Click the <strong>Wi</strong> button to make it paint wilderness rooms</li>
</ul>
<p>Now, as your character moves around the world, the automapper draws wilderness rooms instead of normal rooms.  Wilderness rooms are drawn with a black circle in the middle of the room.</p>
<p><img alt="Wilderness rooms" src="img/ch15/wild_room_1.png"></p>
<p>In a normal room, if you try to move in a direction without an exit, the automapper will get lost.</p>
<p>In a wilderness room, the automapper will assume that there's an exit leading to <em>any adjacent room</em>.  In fact, the automapper won't draw exits at all in wilderness rooms.</p>
<p>You can convert a normal room to a wilderness room and back again, if you want to.</p>
<ul>
<li>Right click the room</li>
<li>In the popup menu, select <strong>Add/set exits &gt; Mark room as wilderness</strong><ul>
<li>Select <strong>Add/set exits &gt; Mark room as normal</strong> to convert back to a normal room</li>
</ul>
</li>
</ul>
<p>When you've finished drawing wilderness rooms, click the painter button to disable the painter.</p>
<h3><a name="15.24.1">15.24.1 Wilderness border rooms</a></h3>
<p><em>EmpireMUD 2.0</em> presents us with another problem: the wilderness contains buildings which can only be entered in one direction, a situation something like this:</p>
<p><img alt="Wilderness rooms" src="img/ch15/wild_room_2.png"></p>
<p>The solution to the problem is to use <em>wilderness border rooms</em>.  For these rooms, the automapper makes these assumptions:</p>
<ul>

share/docs/guide/ch15.html  view on Meta::CPAN

<p><img alt="Character visits" src="img/ch15/char_visits_2.png"></p>
<ul>
<li>Click the orange <strong>SC</strong> button to set the selected room as the current room, and increase the number of visits by one</li>
<li>Click the <strong>V+</strong> and <strong>V-</strong> buttons to increase/decrease visits in the selected room(s) by one</li>
<li>Click the <strong>SV</strong> button to set the number of visits manually</li>
<li>Click the <strong>RV</strong> button to reset the number of visits to zero<ul>
<li>The number zero is not drawn inside the room</li>
</ul>
</li>
</ul>
<p>These operations can also be performed by right-clicking a room and using the popup menu, or by using the window's main menu.</p>
<h3><a name="15.25.1">15.25.1 Synchronising grid coordinates</a></h3>
<p>Another useful feature is to display each room's grid coordinates.</p>
<ul>
<li>In the automapper menu, select <strong>View &gt; Room interiors &gt; Draw grid coordinates</strong></li>
</ul>
<p>If it's important, you can synchronise the grid coordinates used by the world with those used by Axmud. (This synchronisation only affects the coordinates displayed inside the room box).</p>
<p>For example, if the automapper is showing a room's coordinates as <strong>100, 100</strong>, but the game is using the coordinates <strong>20, 135</strong>:</p>
<ul>
<li>In the automapper menu, click <strong>Rooms &gt; Other room features &gt; Synchronise grid coordinates...</strong></li>
<li>In the dialogue window, adjust the X coordinate with the (negative) value <strong>-80</strong> </li>

share/docs/guide/ch15.mkd  view on Meta::CPAN

* Select a style by clicking on it
* Click the **Edit** button
* Make any changes you want in the new edit window
* Click the **OK** button in both edit windows to apply your changes

The best way to use label styles is to use one style for titles, another style for street names, another style for warnings, and so on.

If you want a label with its own unique colours, you can modify the appearance of that label only.

* Right-click the label
* In the popup menu that appears, select **Customise label...**
* Make any changes you want, and click the **OK** button

If you want to get rid of the unique colours, you can do this:

* Right-click the label
* In the popup menu that appears, select **Set label...**
* Select a label style, and click the **OK** button

If you want to creates labels with multiple lines of text, you can do this:

* From the menu, select **Labels > Use multiline labels**
    * Repeat this step to go back to single-line labels
    * This setting only affects new labels. If you turn off multiline labels, any existing multiline labels are not affected

##<a name="15.16">15.16 Exit ornaments</a>

share/docs/guide/ch15.mkd  view on Meta::CPAN

The room painting toolbar can be used instead of the menus.  In many ways it's more convenient.

![Room painting toolbar](img/ch15/paint_toolbar.png)

* Click the paintbrush button to enable the painter
* Click the **Ne** button to paint only new rooms, or the **All** button to paint all rooms

Now you can add your favourite room flags.

* Click the plus button
* In the popup menu, select **Terrain > Room is in a forest/wood**
* A new green button will appear

You can add as many favourite room flags as you like.  Each room flag aren't actually applied until you have clicked its button to select it.  Click the button a second time to unselect it.

The remaining buttons in this toolbar are used for wilderness rooms, discussed in [Section 15.24](#15.24).

###<a name="15.22.2">15.22.2 Using the quick painting toolbar</a>

The painter described above is fine for painting rooms as you move around, but if you just want to toggle room flags in existing roms, you can use the quick painting toolbar.

share/docs/guide/ch15.mkd  view on Meta::CPAN


![Wilderness rooms](img/ch15/wild_room_1.png)

In a normal room, if you try to move in a direction without an exit, the automapper will get lost.

In a wilderness room, the automapper will assume that there's an exit leading to *any adjacent room*.  In fact, the automapper won't draw exits at all in wilderness rooms.

You can convert a normal room to a wilderness room and back again, if you want to.

* Right click the room
* In the popup menu, select **Add/set exits > Mark room as wilderness**
    * Select **Add/set exits > Mark room as normal** to convert back to a normal room

When you've finished drawing wilderness rooms, click the painter button to disable the painter.

###<a name="15.24.1">15.24.1 Wilderness border rooms</a>

*EmpireMUD 2.0* presents us with another problem: the wilderness contains buildings which can only be entered in one direction, a situation something like this:

![Wilderness rooms](img/ch15/wild_room_2.png)

share/docs/guide/ch15.mkd  view on Meta::CPAN

For the benefit of users who need to keep precise records of which rooms they've visited, and how often, there are some toolbar buttons you can use to modify the numbers shown.

![Character visits](img/ch15/char_visits_2.png)

* Click the orange **SC** button to set the selected room as the current room, and increase the number of visits by one
* Click the **V+** and **V-** buttons to increase/decrease visits in the selected room(s) by one
* Click the **SV** button to set the number of visits manually
* Click the **RV** button to reset the number of visits to zero
    * The number zero is not drawn inside the room

These operations can also be performed by right-clicking a room and using the popup menu, or by using the window's main menu.

###<a name="15.25.1">15.25.1 Synchronising grid coordinates</a>

Another useful feature is to display each room's grid coordinates.

* In the automapper menu, select **View > Room interiors > Draw grid coordinates**

If it's important, you can synchronise the grid coordinates used by the world with those used by Axmud. (This synchronisation only affects the coordinates displayed inside the room box).

For example, if the automapper is showing a room's coordinates as **100, 100**, but the game is using the coordinates **20, 135**:

share/docs/guide/tut02.html  view on Meta::CPAN

</code></pre>
<p>This room from the Dead Souls mudlib is easy to map, at least during the day. But at night, the exit list disappears, and the automapper doesn't recognise it at all.</p>
<pre><code>    You are in a forest outside the town. To the southwest the path continues toward 
    a clearing. To the east it leads to a bridge over a river toward a town.
</code></pre>
<p>Well, in this situation you can tell Axmud to look for a line containing <strong>You are in a forest outside the town</strong>, instead of an exit list. Updating the map is a little tricky, so here's the best way to do it.</p>
<h2><a name="2.1.1">2.1.1 Draw a nearby room</a></h2>
<p>Move to a neighbouring room, one that the automapper does recognise, and draw it on the map</p>
<p><img alt="The nearby room, drawn on the map" src="img/tut02/nearby_room.png"></p>
<h2><a name="2.1.2">2.1.2 Draw an empty room</a></h2>
<p>Right-click the background at the position where you want to draw the arkward room. In the popup menu, select <strong>Add room here</strong>.</p>
<p><img alt="An empty room, added to the map" src="img/tut02/empty_room.png"></p>
<h2><a name="2.1.3">2.1.3 Add the pattern</a></h2>
<p>Right-click the empty room, and select <strong>Add pattern &gt; Add unspecified room pattern...</strong></p>
<p>In the dialogue window, add the first few words from the tricky room's description, for example:</p>
<pre><code>    You are in a forest outside the town
</code></pre>
<p>Axmud expects a pattern (regular expression/regex). If you're not sure what that means, read <a href="ch06.html">Section 6</a> of the Guide.</p>
<h2><a name="2.1.4">2.1.4 Connect the two rooms</a></h2>
<p>Axmud won't check this pattern unless the two rooms are connected to each other. A one-way exit will do just fine.</p>
<p>Right-click the west exit, select <strong>Connect to click</strong>, then click on the arkward (empty) room.</p>

share/docs/guide/tut02.mkd  view on Meta::CPAN

Well, in this situation you can tell Axmud to look for a line containing **You are in a forest outside the town**, instead of an exit list. Updating the map is a little tricky, so here's the best way to do it.

##<a name="2.1.1">2.1.1 Draw a nearby room</a>

Move to a neighbouring room, one that the automapper does recognise, and draw it on the map

![The nearby room, drawn on the map](img/tut02/nearby_room.png)

##<a name="2.1.2">2.1.2 Draw an empty room</a>

Right-click the background at the position where you want to draw the arkward room. In the popup menu, select **Add room here**.

![An empty room, added to the map](img/tut02/empty_room.png)

##<a name="2.1.3">2.1.3 Add the pattern</a>

Right-click the empty room, and select **Add pattern > Add unspecified room pattern...**

In the dialogue window, add the first few words from the tricky room's description, for example:

        You are in a forest outside the town

share/docs/tutorial/ch05.html  view on Meta::CPAN

<p>You can use as many brackets as you want, but the expression must contain exactly the same number of open brackets and close brackets.</p>
<h2><a name="5.11">5.11 Getting input</a></h2>
<p>One way to set a variable's value is to use LET. Another way is to ask the user to type the value themselves.</p>
<p>An INPUT statement waits for the user to type something, and then stores it in a variable</p>
<pre><code>    PRINT "What is your name?"
    INPUT name$
    PRINT "Your name is"
    PRINT name$
    END
</code></pre>
<p>Axbasic creates a dialogue (popup) window. After the user types their name and presses ENTER, the window disappears. The user's response is stored in the variable <strong>name$</strong>.</p>
<h2><a name="5.12">5.12 Avoiding LET</a></h2>
<p>After a while, BASIC programmers grow weary of typing LET every time they want to set a variable, and begin wondering why they can't just type something like this:</p>
<pre><code>    number = 10
</code></pre>
<p>Well, in fact it's possible to do tell Axbasic that you don't want to use LET at all. Just put this line somewhere in your script:</p>
<pre><code>    OPTION NOLET
</code></pre>
<p>Now you don't need to use LET at all.</p>
<pre><code>    OPTION NOLET
    first = 10

share/docs/tutorial/ch05.mkd  view on Meta::CPAN

One way to set a variable's value is to use LET. Another way is to ask the user to type the value themselves.

An INPUT statement waits for the user to type something, and then stores it in a variable

        PRINT "What is your name?"
        INPUT name$
        PRINT "Your name is"
        PRINT name$
        END

Axbasic creates a dialogue (popup) window. After the user types their name and presses ENTER, the window disappears. The user's response is stored in the variable **name$**.

##<a name="5.12">5.12 Avoiding LET</a>

After a while, BASIC programmers grow weary of typing LET every time they want to set a variable, and begin wondering why they can't just type something like this:

        number = 10

Well, in fact it's possible to do tell Axbasic that you don't want to use LET at all. Just put this line somewhere in your script:

        OPTION NOLET

share/docs/tutorial/ch14.html  view on Meta::CPAN

</code></pre>
<p>The flashing usually stops after a few seconds, but you can use an UNFLASHWIN statement at any time.</p>
<h2><a name="14.11">14.11 Changing the window's title</a></h2>
<p>You can change the window's title using a TITLEWIN statement.</p>
<pre><code>    TITLEWIN "I'm in control now!"
</code></pre>
<p>To restore the window's original title - which will be something like <strong>Script (test)</strong> - just use an empty string.</p>
<pre><code>    TITLEWIN ""
</code></pre>
<h2><a name="14.12">14.12 Dialogue windows</a></h2>
<p>Besides task windows, Axbasic scripts can create their own dialogue (popup) windows using the <strong>Popup$ ()</strong> function. The window asks the user to make a choice, and the function returns that choice.</p>
<pre><code>    ! Ask a question
    LET choice$ = POPUP$ ("question", "Are you ready?", "yes-no")
    ! Display "yes" or "no"
    PRINT choice$
    END
</code></pre>
<p>The <strong>Popup$</strong> always takes three arguments. For a full list of the arguments that can be used, see the function's help file.</p>
<pre><code>    ;axbasichelp popup
</code></pre>
<hr>
<p><a href="ch13.html">Previous</a> <a href="index.html">Index</a> <a href="ch15.html">Next</a></p>

</body>
</html>

share/docs/tutorial/ch14.mkd  view on Meta::CPAN

You can change the window's title using a TITLEWIN statement.

        TITLEWIN "I'm in control now!"

To restore the window's original title - which will be something like **Script (test)** - just use an empty string.

        TITLEWIN ""

##<a name="14.12">14.12 Dialogue windows</a>

Besides task windows, Axbasic scripts can create their own dialogue (popup) windows using the **Popup$ ()** function. The window asks the user to make a choice, and the function returns that choice.

        ! Ask a question
        LET choice$ = POPUP$ ("question", "Are you ready?", "yes-no")
        ! Display "yes" or "no"
        PRINT choice$
        END

The **Popup$** always takes three arguments. For a full list of the arguments that can be used, see the function's help file.

        ;axbasichelp popup

---

[Previous](ch13.html) [Index](index.html) [Next](ch15.html)

share/docs/tutorial/ch19.html  view on Meta::CPAN

</code></pre>
<p>This shows all system messages generated by the client command, as if the user had typed it themselves.</p>
<pre><code>    OPTION PSEUDO "hide_complete"
</code></pre>
<p>This shows any error messages in the main window, but not the confirmation message. (This is the default behaviour if no OPTION PSEUDO statement is used.)</p>
<pre><code>    OPTION PSEUDO "hide_system"
</code></pre>
<p>This hides any error messages, as well as any confirmation message.</p>
<pre><code>    OPTION PSEUDO "win_error"
</code></pre>
<p>This displays a confirmation message in the main window, but any error messages appear in a dialogue (popup) window.</p>
<pre><code>    OPTION PSEUDO "win_only"
</code></pre>
<p>This displays both confirmation and error messages in a dialogue (popup) window.</p>
<h2><a name="19.7">19.7 OPTION REDIRECT</a></h2>
<pre><code>    OPTION REDIRECT
</code></pre>
<p>Axbasic scripts can create their own task window. A WRITEWIN statement display text in that task window. However, if the task window isn't open, nothing is displayed.</p>
<p>OPTION REDIRECT redirects text into the main window, if the task window has been closed for some reason.</p>
<h2><a name="19.8">19.8 OPTION PERSIST</a></h2>
<pre><code>    OPTION PERSIST
</code></pre>
<p>Interfaces can be created with an ADDTRIG, ADDALIAS, ADDMACRO, ADDTIMER or ADDHOOK statement. Normally, those interfaces are destroyed as soon as the script stops running, but OPTION PERSIST prevents that destruction.</p>
<h2><a name="19.9">19.9 OPTION ANGLE</a></h2>

share/docs/tutorial/ch19.mkd  view on Meta::CPAN

        OPTION PSEUDO "hide_complete"

This shows any error messages in the main window, but not the confirmation message. (This is the default behaviour if no OPTION PSEUDO statement is used.)

        OPTION PSEUDO "hide_system"

This hides any error messages, as well as any confirmation message.

        OPTION PSEUDO "win_error"

This displays a confirmation message in the main window, but any error messages appear in a dialogue (popup) window.

        OPTION PSEUDO "win_only"

This displays both confirmation and error messages in a dialogue (popup) window.

##<a name="19.7">19.7 OPTION REDIRECT</a>

        OPTION REDIRECT

Axbasic scripts can create their own task window. A WRITEWIN statement display text in that task window. However, if the task window isn't open, nothing is displayed.

OPTION REDIRECT redirects text into the main window, if the task window has been closed for some reason.

##<a name="19.8">19.8 OPTION PERSIST</a>

share/help/axbasic/keyword/input  view on Meta::CPAN

   Synopsis:
      Prompts the user to input data or reads data from a file

   Notes:
      The first form of the INPUT statement prompts the user to enter one or
         more items of data, which are stored in the specified variables.
      The string constant, if specified, is displayed as a prompt to the user;
         otherwise no prompt is displayed.
      If the script is being run from within a task, and if a task window with
         its own entry box is open, the user's response can be typed there.
         Otherwise, Axmud will open a popup window for each value expected. The
         values are stored in the specified variable(s).
      If you type nothing in the entry box, string variables are given the value
         "" (an empty string) and numeric variables are given the value 0.

      The second form of the INPUT statement reads data from a file channel
         created with an earlier OPEN statement. If the file channel is closed,
         if it was opened in write-only mode or if the end-of-file has already
         been reached, an error is generated.

   Examples:

share/help/cmd/mxp  view on Meta::CPAN

      ;mxp -c                 Allow MXP to crosslink to new servers
      ;mxp -r                 Allow Locator task to use MXP room data
      ;mxp -k                 Allow MXP to use (some) illegal keywords
                                 (not recommended)
      ;mxp -p                 Assume world has enabled MXP (recommended for IRE
                                 MUDs)

   Notes:
      The Mud Xtension Protocol (MXP) allows a world more control over the way
         text is displayed in the client. Typically it's used to change colours
         and fonts, to create clickable links and popup menus, to display images
         and play sound/music files and to create extra windows (frames).

   User commands:
      mxp



( run in 3.019 seconds using v1.01-cache-2.11-cpan-364913b4093 )