pymasep.interface.ui_merchant
Classes
Interface for selecting objects to buy or to take from a container |
Module Contents
- class pymasep.interface.ui_merchant.UIMerchant(relative_rect, manager, container, item_list, sub_application, object_to_init_name)
Bases:
pygame_gui.elements.UIPanelInterface for selecting objects to buy or to take from a container
- Parameters:
relative_rect (pygame.Rect) – Position and size of the window
manager (pygame_gui.core.interfaces.IUIManagerInterface) – Manager (from pygame_gui)
container (pygame_gui.core.interfaces.IContainerLikeInterface) – Container of the UIMerchant (form pygame_gui)
sub_application – the sub application (interface) that will handle the panel
object_to_init_name – name of the Object or Agent to init
item_list (List[str])
- sub_application
interface application
- object_to_init_name
name of the agent to initialize container
- selected_item_to_add = []
items to add to the container
- selected_item_to_remove = []
items to remove from the container
- item_list
list of possible items
- label_pos
cost label position
- costs
cost UI label
- list_objects_rect
list of possible items rectangle
- list_objects
UI element of possible items
- list_objects_chosen_rect
chosen objects rectangle
- list_objects_chosen
UI element of chosen items
- add_button
UI button to add items
- del_button
UI button to remove items
- process_event(event)
process event to launch dices if user press the button.
- Parameters:
event (pygame.event.Event) – event that could be a UI_BUTTON_PRESSED
- Returns:
True if the event has been processed
- Return type:
bool
- update(time_delta)
Update the UI element
- Parameters:
time_delta (float) – time delta since last call
- Return type:
None