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

Go to the source code of this file.

Enumerations

enum  {
  BUTTON_SETTINGS, BUTTON_KEY_SETTINGS, BUTTON_LOGOUT, BUTTON_BACK,
  BUTTON_NUM
}

Functions

static void settings_list_reload (list_struct *list)
static void list_handle_mouse_row (list_struct *list, uint32 row, SDL_Event *event)
static void list_handle_esc (list_struct *list)
static void setting_change_value (int cat, int set, sint64 val)
static void list_post_column (list_struct *list, uint32 row, uint32 col)
static void setting_keybind_apply (list_struct *list)
static int setting_keybind_action (SDLKey key, list_struct *list)
static void setting_category_change (int advance)
static void settings_popup_draw_func_post (popup_struct *popup)
static void settings_popup_draw_func (popup_struct *popup)
static int settings_popup_destroy_callback (popup_struct *popup)
static void list_handle_enter (list_struct *list)
static int list_key_event (list_struct *list, SDLKey key)
static void settings_button_handle (size_t button)
static int settings_popup_event_func (popup_struct *popup, SDL_Event *event)
void settings_open ()

Variables

static button_struct button_password
static const char *const button_names [BUTTON_NUM]
static uint8 setting_type = SETTING_TYPE_NONE
static size_t button_selected
static size_t setting_category_selected
static uint32 list_row_clicked
static uint32 list_clicked = 0
static uint8 setting_keybind_step
static SDLKey setting_keybind_key
static SDLMod setting_keybind_mod
static sint32 setting_keybind_id
static uint8 setting_password_confirmed

Detailed Description

Settings GUI.

Definition in file settings.c.


Enumeration Type Documentation

anonymous enum

The different buttons of the settings popup.

Definition at line 36 of file settings.c.


Function Documentation

static void list_handle_enter ( list_struct list) [static]

Handle using enter in the settings list.

Parameters:
listThe list.

Definition at line 655 of file settings.c.

static void list_handle_esc ( list_struct list) [static]

Handle ESC in a list.

In this case, just destroys the visible popup.

Parameters:
listThe list.

Definition at line 142 of file settings.c.

static void list_handle_mouse_row ( list_struct list,
uint32  row,
SDL_Event *  event 
) [static]

Handle mouse event in a list.

Parameters:
listThe list.
rowRow the mouse is over.
eventThe mouse event.

Definition at line 124 of file settings.c.

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

Handle list key events.

Parameters:
listList.
keyKey that was pressed.
Returns:
1 if the key was handled, -1 otherwise.

Definition at line 681 of file settings.c.

static void list_post_column ( list_struct list,
uint32  row,
uint32  col 
) [static]

Do custom drawing after the list has finished drawing a column.

Parameters:
listThe list.
rowThe row.
colColumn being drawn.

Definition at line 212 of file settings.c.

static void setting_category_change ( int  advance) [static]

Change the currently selected setting category.

Parameters:
advanceIf -1, change to the previous category; if 1, change to the next one.

Definition at line 385 of file settings.c.

static void setting_change_value ( int  cat,
int  set,
sint64  val 
) [static]

Change setting value.

Parameters:
catCategory.
setSetting.
valModifier.

Definition at line 153 of file settings.c.

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

Do an action related to the keybind settings list.

Parameters:
keyKey used.
listThe keybinding list.
Returns:
1 if the action was handled, 0 otherwise.

Definition at line 351 of file settings.c.

static void setting_keybind_apply ( list_struct list) [static]

Apply keybinding changes - adds or edits a keybinding.

Parameters:
listThe keybinding list.

Definition at line 320 of file settings.c.

static void settings_button_handle ( size_t  button) [static]

Handle pressing a button in the settings popup.

Parameters:
buttonThe button ID.

Definition at line 719 of file settings.c.

static void settings_list_reload ( list_struct list) [static]

Reload the settings list.

Parameters:
listThe list.

Definition at line 78 of file settings.c.

void settings_open ( )

Open the settings popup.

Definition at line 983 of file settings.c.

static int settings_popup_destroy_callback ( popup_struct popup) [static]

Exit the settings popup.

Parameters:
popupThe popup.
Returns:
1.

Definition at line 635 of file settings.c.

static void settings_popup_draw_func ( popup_struct popup) [static]

Draw the settings popup.

Parameters:
popupThe popup.

Definition at line 559 of file settings.c.

static void settings_popup_draw_func_post ( popup_struct popup) [static]

Do drawing immediately after finishing drawing the settings popup.

Parameters:
popupThe settings popup.

Definition at line 422 of file settings.c.

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

Handle events for the settings popup.

Definition at line 780 of file settings.c.


Variable Documentation

const char* const button_names[BUTTON_NUM] [static]
Initial value:
{
    "Client Settings", "Key Settings", "Logout", "Back to Play"
}

Names of the buttons.

Definition at line 47 of file settings.c.

Password button.

Definition at line 33 of file settings.c.

size_t button_selected [static]

Currently selected button.

Definition at line 55 of file settings.c.

uint32 list_clicked = 0 [static]

1 if there is a clicked to handle.

Definition at line 61 of file settings.c.

Which row was clicked.

Definition at line 59 of file settings.c.

size_t setting_category_selected [static]

Selected setting category.

Definition at line 57 of file settings.c.

If not -1, we're editing this keybinding ID.

Definition at line 69 of file settings.c.

SDLKey setting_keybind_key [static]

Key of the shortcut being added/edited.

Definition at line 65 of file settings.c.

SDLMod setting_keybind_mod [static]

Modifier for the shortcut.

Definition at line 67 of file settings.c.

Step in the keybinding GUI.

Definition at line 63 of file settings.c.

Whether player has entered their current password in the password changing GUI.

Definition at line 73 of file settings.c.

uint8 setting_type = SETTING_TYPE_NONE [static]

Currently selected setting type.

Definition at line 53 of file settings.c.