Defines the client-side cw.salesman library, which holds the state of the salesman being created or edited in the cwSalesman editor.

The Cable receivers and the editor write the fields straight into the library table; its getters expose the name, model, sells and buys lists, stock, cash, price scale, buy rate, responses and the factions, classes and flags allowed to trade.

Summary

Methods

Returns whether the salesman being edited sells items in whole shipments (the item's batch size).
Returns the percentage of an item's cost the salesman being edited pays when buying it.
GetBuys()client
Returns the items the salesman being edited buys.
GetCash()client
Returns the cash the salesman being edited has to buy items with.
Returns the classes allowed to trade with the salesman being edited.
Returns the factions allowed to trade with the salesman being edited.
Returns the flags required to trade with the salesman being edited.
Returns every non-base item that can be added to the salesman being edited.
Returns the model of the salesman being edited.
GetName()client
Returns the name of the salesman being edited.
Returns the salesman editor panel.
Returns the multiplier applied to item costs when the salesman being edited sells.
Returns the items the salesman being edited sells.
Returns whether the salesman being edited shows a chat bubble above its head.
Returns the starting stock of each item the salesman being edited sells.
GetText()client
Returns the responses of the salesman being edited.
Returns whether the salesman editor panel exists and is visible.

Methods

Returns whether the salesman being edited sells items in whole shipments (the item's batch size).

Returns

  • Boolean Whether items are sold in shipments

Returns the percentage of an item's cost the salesman being edited pays when buying it.

Returns

  • Number The buy rate, from 1 to 100

Returns the items the salesman being edited buys.

Returns

  • Map Item unique IDs mapped to a price override, or true to use the item's cost

Returns the cash the salesman being edited has to buy items with.

Returns

  • Number The salesman's cash, -1 for unlimited

Returns the classes allowed to trade with the salesman being edited.

Returns

  • Map Class names mapped to true; empty for no restriction

Returns the factions allowed to trade with the salesman being edited.

Returns

  • Map Faction names mapped to true; empty for no restriction

Returns the flags required to trade with the salesman being edited.

Returns

  • String The flags; a - in the string refuses players without them

Returns every non-base item that can be added to the salesman being edited.

Returns

  • Map<Item> Item tables keyed by unique ID

Returns the model of the salesman being edited.

Returns

  • String The model path

Returns the name of the salesman being edited.

Returns

  • String The salesman's name

Returns the salesman editor panel.

Returns

  • Panel The cwSalesman panel, or nil if it was never created

Returns the multiplier applied to item costs when the salesman being edited sells.

Returns

  • Number The price scale, 1 when unset

Returns the items the salesman being edited sells.

Returns

  • Map Item unique IDs mapped to a price override, or true to use the item's cost

Returns whether the salesman being edited shows a chat bubble above its head.

Returns

  • Boolean Whether the chat bubble is shown

Returns the starting stock of each item the salesman being edited sells.

Returns

  • Number Stock per item, -1 for unlimited

Returns the responses of the salesman being edited.

The keys are start, noSale, noStock, needMore, cannotAfford and doneBusiness; each value is a Map with text, sound and bHideName.

Returns

  • Map The salesman's responses

Returns whether the salesman editor panel exists and is visible.

Returns

  • Boolean true when the editor is open, otherwise nil

Defined in