Coin

Contributed by Jacob Wolf

class quest.contrib.shop.ShopMixin[source]

A mixin for QuestGame which implements a shop.

shop_inventory()[source]

A helper to return the shop inventory

on_key_press(key, modifier)[source]

Overrides on_key_press so that when the inventory shortcut key is pressed, opens the inventory. Otherwise, delegates to the parent on_key_press method.

buy_item(item)[source]

Buys an item.

Reduces money by the item’s price, removes the item from the shop inventory, and (if InventoryMixin is also being used) adds the item to the player’s inventory.

class quest.contrib.shop.ShopModal(game, inventory)[source]

Opens a shop modal.

text_label_contents()[source]

Returns a list of strings to be presented as text labels.

option_label_contents()[source]

Returns a list of strings to be presented as option labels.

choose_option(value)[source]

When a button is clicked, it calls choose_option with its value.

class quest.contrib.shop.ShopItemModal(game, item)[source]
text_label_contents()[source]

Returns a list of strings to be presented as text labels.

option_label_contents()[source]

Returns a list of strings to be presented as option labels.

choose_option(value)[source]

When a button is clicked, it calls choose_option with its value.

class quest.contrib.shop.ShopResultModal(game, message, response='OK')[source]
choose_option(value)[source]

When a button is clicked, it calls choose_option with its value.