Atrinik Client 2.5
Functions | Variables
gui/quickslots.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static void quickslot_set_item (uint8 slot, sint32 tag)
static void quickslot_set_spell (uint8 slot, char *spell_name)
static void quickslot_unset (uint8 slot)
void quickslots_init ()
static void quickslots_remove (int tag)
void quickslots_handle_key (int slot)
int get_quickslot (int x, int y)
void show_quickslots (int x, int y, int vertical_quickslot)
void widget_quickslots (widgetdata *widget)
void widget_quickslots_mouse_event (widgetdata *widget, SDL_Event *event)
void QuickSlotCmd (unsigned char *data, int len)

Variables

static _quickslot quick_slots [MAX_QUICK_SLOTS *MAX_QUICKSLOT_GROUPS]
int quickslot_group = 1
int quickslots_pos [MAX_QUICK_SLOTS][2]

Detailed Description

Definition in file quickslots.c.


Function Documentation

int get_quickslot ( int  x,
int  y 
)

Get the current quickslot ID based on mouse coordinates.

Parameters:
xMouse X.
yMouse Y.
Returns:
Quickslot ID if mouse is over it, -1 if not.

Definition at line 204 of file quickslots.c.

static void quickslot_set_item ( uint8  slot,
sint32  tag 
) [static]

Tell the server to set quickslot with ID 'slot' to the item with ID 'tag'.

Parameters:
slotQuickslot ID.
tagID of the item to set.

Definition at line 58 of file quickslots.c.

static void quickslot_set_spell ( uint8  slot,
char *  spell_name 
) [static]

Tell the server to set quickslot with ID 'slot' to the spell with name 'spell_name'.

Parameters:
slotQuickslot ID.
spell_nameName of the spell to set.

Definition at line 77 of file quickslots.c.

static void quickslot_unset ( uint8  slot) [static]

Tell the server to unset the specified quickslot ID.

Parameters:
slotQuickslot ID to unset.

Definition at line 94 of file quickslots.c.

void QuickSlotCmd ( unsigned char *  data,
int  len 
)

Parses data returned by the server for quickslots.

Parameters:
dataThe data to parse.
lenLength of 'data'.

Definition at line 438 of file quickslots.c.

static void quickslots_remove ( int  tag) [static]

Remove item from the quickslots by tag.

Will also make sure all the quickslot tags still resolve to the correct inventory objects.

Parameters:
tagItem tag to remove from quickslots. -1 not to remove anything.

Definition at line 126 of file quickslots.c.

void show_quickslots ( int  x,
int  y,
int  vertical_quickslot 
)

Show quickslots widget.

Parameters:
xX position of the quickslots
yY position of the quickslots
vertical_quickslotIs the quickslot vertical? 1 for vertical, 0 for horizontal.

Definition at line 240 of file quickslots.c.

void widget_quickslots ( widgetdata widget)

We come here for quickslots shown during the game

Definition at line 322 of file quickslots.c.

void widget_quickslots_mouse_event ( widgetdata widget,
SDL_Event *  event 
)

Handle mouse events over quickslots.

Parameters:
widgetThe quickslots widget.
eventThe event to handle.

Definition at line 338 of file quickslots.c.


Variable Documentation

_quickslot quick_slots[MAX_QUICK_SLOTS *MAX_QUICKSLOT_GROUPS] [static]

Quick slot entries

Definition at line 33 of file quickslots.c.

int quickslot_group = 1

Current quickslot group

Definition at line 36 of file quickslots.c.

int quickslots_pos[MAX_QUICK_SLOTS][2]
Initial value:
{
    {17,    1},
    {50,    1},
    {83,    1},
    {116,   1},
    {149,   1},
    {182,   1},
    {215,   1},
    {248,   1}
}

Quickslot positions, because some things change depending on which quickslot bitmap is displayed.

Definition at line 41 of file quickslots.c.