Update of "Menu Section"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 3fbfa1ef482506cad543e61eb87036605f322ed4
Page Name:Menu Section
Date: 2017-04-23 17:52:57
Original User: Entomy
Parent: 72211327dae41f91dff11e7addbc339a7115ff19
Content

Purpose

Tipmenus can grow quite large, and a useful management tool is grouping them into sections. These sections can be manipulated independently of each other, but all items within are treated communally.

Use

A tipmenu is generally built up through individual sections, themselves containing a number of Menu Item.

Interface

add()

Adds the item to the section. Two parameters, name and cost, are required. An optional parameter, handler, is a callback when tipped for; params are passed to handler.

If you only need simple tipmenu items, that is, matching to them but no logic, then only worry about name and cost. If the items require logic however, handlers must be written which do the world.

clear()

Clear the section of all items. This is used at the beginning of rebuilding a menu.

del()

Delete an item from the menu. This is generally completely useless, but is used in the Special manager.

lookup()

Look up the menu item with the specified name.

print()

Print the menu section to chat. User is the user to send the section to. Limit is optional, and is the upper cost limit to print; all items which cost more than the limit will not be printed. Discounted is optional, and defaults to false; if the section is discounted Discount.apply() will be called for each item.

Requirements