19 const Selection* prev_selection,
20 const Selection* new_selection
23 List* owned_jokers_list = get_jokers_list();
27 key_is_down(SELECT_CARD) && new_selection->y == row_idx && prev_selection->y == row_idx;
29 if (prev_selection->y == row_idx)
34 if (joker_object != NULL && !swapping)
41 if (new_selection->y == row_idx)
45 if (joker_object != NULL)
54 if (!key_is_down(SELECT_CARD))
68 (
unsigned int)prev_selection->x,
69 (
unsigned int)new_selection->x
76static inline void sell_joker(
int joker_idx)
78 List* owned_jokers_list = get_jokers_list();
80 if (joker_idx < 0 || joker_idx >=
list_get_len(owned_jokers_list))
82 MGBA_FUNC_ERROR(
"Invalid joker_idx == %d", joker_idx);
89 remove_owned_joker(joker_idx);
95 if (joker_object != NULL)
97 if (key_hit(SELECT_CARD))
101 else if (key_released(SELECT_CARD))
110 if (key_hit(SELL_KEY))
112 int sold_joker_idx = selection->x;
118 sell_joker(sold_joker_idx);
Game global game variables struct definition.
void item_sell(Item *item)
Performs the item sell transaction, gaining its sell value and discarding it.
Functions relative to the handling of Jokers.
int joker_object_get_sell_price(Item *joker_object)
Returns the sell price of the joker object.
All the functions used specifically to interact with Jokers. This includes browsing,...
bool jokers_sel_row_on_selection_changed(SelectionGrid *selection_grid, int row_idx, const Selection *prev_selection, const Selection *new_selection)
Handle directional inputs on the Jokers' row at the top of the game screen.
void jokers_sel_row_on_key_transit(SelectionGrid *selection_grid, Selection *selection)
Handle button inputs on the Jokers' row at the top of the game screen.
int jokers_sel_row_get_size(void)
Returns the size of the Jokers' row at the top of the game screen. Is equal to the number of Jokers o...
Header of shared rects and points needed for ui.
bool list_swap(List *list, unsigned int idx_a, unsigned int idx_b)
void * list_get_at_idx(List *list, unsigned int idx)
int list_get_len(const List *list)
void selection_grid_move_selection_vert(SelectionGrid *selection_grid, int direction_tribool)
Moves the selection vertically within the selection grid.
Sprite system for Gbalatro.
void sprite_object_set_focus(SpriteObject *sprite_object, bool focus)
Set the focus for SpriteObject Raises the object by SPRITE_FOCUS_RAISE_PX.
void sprite_object_print_price_under(SpriteObject *sprite_object, int price)
Print the price string directly beneath a SpriteObject. More specialized version of sprite_object_pri...
void sprite_object_erase_text_under(SpriteObject *sprite_object)
Erase the text within the Rect directly beneath a SpriteObject. This is used only for Cards for now.
A generic interface for all items that can appear in the shop or be in the inventory....
The core selection grid struct, represents the grid itself and its state.
A sprite object is a sprite that is focusable and movable in animation.
Utilities relating around number string representation and protected arithmatic helper functions.