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

Go to the source code of this file.

Defines

#define EYES_BLINK_TIME   (10 * 1000)
#define EYES_BLINK_DELAY   (200)
#define NEWS_MAX_WIDTH   455
#define NEWS_MAX_HEIGHT   260
#define NEWS_FONT   FONT_SANS12

Functions

static void news_popup_draw_func (popup_struct *popup)
static int news_popup_event_func (popup_struct *popup, SDL_Event *event)
static void char_creation_reset (list_struct *list)
static void char_creation_enter (list_struct *list)
static void char_stat_change (int stat_id, int adjust)
static int char_creation_key (list_struct *list, SDLKey key)
static void popup_draw_func_post (popup_struct *popup)
static void popup_draw_func (popup_struct *popup)
static int popup_destroy_callback_func (popup_struct *popup)
static int popup_event_func (popup_struct *popup, SDL_Event *event)
static void list_handle_enter (list_struct *list)
static void list_handle_esc (list_struct *list)
void show_meta_server ()

Variables

static size_t last_server_count = 0
static curl_datanews_data = NULL
static uint32 eyes_blink_ticks = 0
static uint8 eyes_draw = 1
static int char_step = 0
static uint32 char_race_selected
static int char_gender_selected
static int char_points_left
static int char_points_assigned [7]
const int char_step_max = 2
static progress_dots progress

Detailed Description

Servers list, logging to a server, creating new character, etc.

Definition in file main.c.


Define Documentation

#define EYES_BLINK_DELAY   (200)

How long the eyes remain 'closed' (not drawn).

Definition at line 35 of file main.c.

#define EYES_BLINK_TIME   (10 * 1000)

How often to blink the eyes in ticks.

Definition at line 33 of file main.c.

#define NEWS_FONT   FONT_SANS12

Font of the news text.

Definition at line 42 of file main.c.

#define NEWS_MAX_HEIGHT   260

Maximum height of the news text.

Definition at line 40 of file main.c.

#define NEWS_MAX_WIDTH   455

Maximum width of the news text.

Definition at line 38 of file main.c.


Function Documentation

static void char_creation_enter ( list_struct list) [static]

Handle enter, double-clicking etc in character creation popup.

Parameters:
listAssociated list; holds the selected entry etc. Will be removed.

Definition at line 268 of file main.c.

static int char_creation_key ( list_struct list,
SDLKey  key 
) [static]

Custom function to call for handling keyboard events.

Parameters:
listList.
keyKey ID.
Return values:
-1Did not handle the event.
0Handled the event.
1Handled the event, and allow keyboard repeating.

Definition at line 336 of file main.c.

static void char_creation_reset ( list_struct list) [static]

(Re-)initialize character creation. Used when first showing the popup, or when using the 'Previous' buttons to reset the current data.

Parameters:
listIf not NULL, will be removed.

Definition at line 232 of file main.c.

static void char_stat_change ( int  stat_id,
int  adjust 
) [static]

Adjust specified stat, taking into account the character's min/max stats.

Parameters:
stat_idStat ID.
adjustIf higher than 0 the stat will be increased, if lower than 0 it will be decreased.

Definition at line 317 of file main.c.

static void list_handle_enter ( list_struct list) [static]

Handle enter key being pressed in the servers list.

Parameters:
listThe servers list.

Definition at line 721 of file main.c.

static void list_handle_esc ( list_struct list) [static]

Definition at line 755 of file main.c.

static void news_popup_draw_func ( popup_struct popup) [static]

Function used for drawing on the popup's surface.

Parameters:
popupThe popup.

Definition at line 75 of file main.c.

static int news_popup_event_func ( popup_struct popup,
SDL_Event *  event 
) [static]

Function used for handling mouse/key events when popup is visible.

Parameters:
eventSDL event.
Return values:
-1Did not handle the event.
0Did not handle the event, but allow other keyboard events.
1Handled the event.

Definition at line 161 of file main.c.

static int popup_destroy_callback_func ( popup_struct popup) [static]

Function used right before the visible popup is destroyed using popup_destroy_visible().

Parameters:
popupThe popup.
Returns:
1 to proceed with the destruction of the popup, 0 otherwise.

Definition at line 653 of file main.c.

static void popup_draw_func ( popup_struct popup) [static]

Draw the server connection/character creation popup.

Parameters:
popupPopup.

Definition at line 526 of file main.c.

static void popup_draw_func_post ( popup_struct popup) [static]

Function used for drawing after blitting the popup's surface on the main surface.

Parameters:
popupThe popup..

Definition at line 352 of file main.c.

static int popup_event_func ( popup_struct popup,
SDL_Event *  event 
) [static]

Function used for handling mouse/key events when popup is visible.

Parameters:
eventSDL event.
Return values:
-1Did not handle the event.
0Did not handle the event, but allow other keyboard events.
1Handled the event.

Definition at line 674 of file main.c.

void show_meta_server ( )

Show the main GUI after starting the client -- servers list, chat box, connecting to server, etc.

Definition at line 766 of file main.c.


Variable Documentation

int char_gender_selected [static]

Selected gender.

Definition at line 63 of file main.c.

int char_points_assigned[7] [static]

Assigned stats points.

Definition at line 67 of file main.c.

int char_points_left [static]

Number of stat points left to assign.

Definition at line 65 of file main.c.

Selected race.

Definition at line 61 of file main.c.

int char_step = 0 [static]

Character creation step.

Definition at line 59 of file main.c.

const int char_step_max = 2

Maximum number of character creation steps.

Definition at line 69 of file main.c.

uint32 eyes_blink_ticks = 0 [static]

Last time the eyes blinked.

Definition at line 54 of file main.c.

uint8 eyes_draw = 1 [static]

Whether to draw the eyes.

Definition at line 56 of file main.c.

size_t last_server_count = 0 [static]

Last server count to see when to re-create the servers list. Since the metaserver code uses threading so the whole program doesn't lock up, we need to do it like this.

Definition at line 48 of file main.c.

curl_data* news_data = NULL [static]

Data buffer used when downloading news from the site.

Definition at line 51 of file main.c.

Progress dots in login.

Definition at line 72 of file main.c.