102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
gui_tab_gamepad.c File Reference
#include "gui_internal.h"

Go to the source code of this file.

Data Structures

struct  gamepad_axis_field

Functions

static config_label_state gamepad_axis_label_state (const config_ui_state *state, const int *saved_values, const int *default_values, int axis_index)
static config_label_state gamepad_deadzone_label_state (const config_ui_state *state, const int *saved_values, const int *default_values, int axis_index)
static void draw_gamepad_axis_choice (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state, const char *label, const char *id, int axis_index)
static void draw_gamepad_deadzone_input (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state, const char *label, const char *id, int axis_index)
const char * source_label (int source)
const char * source_tooltip (int source)
int source_from_event (const SDL_Event *event)
static void draw_gamepad_axes (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
static void draw_gamepad_button_row (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state, int row)
static void draw_gamepad_buttons (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void draw_gamepad_tab (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)

Variables

static const char *const GAMEPAD_AXIS_TOOLTIPS []
static const char * TOOLTIP_GAMEPAD_ENABLED = "Enable controller input. Default: true."
static const char * TOOLTIP_GAMEPAD_INDEX = "Controller index, starting at 0. Default: 0."
static const char * TOOLTIP_GAMEPAD_AXIS
static const char * TOOLTIP_GAMEPAD_DEADZONE
static const char * TOOLTIP_GAMEPAD_BUTTONS
static const char * TOOLTIP_GAMEPAD_SOUTH = "Default menu confirm action."
static const char * TOOLTIP_GAMEPAD_EAST = "Default menu back action."
static const char * TOOLTIP_GAMEPAD_START = "Default start/pause action."
static const char * TOOLTIP_BIND_BUTTON
static const char * TOOLTIP_CLEAR_BUTTON = "Set this SDL input mapping to none."
static const char * TOOLTIP_RESET_BUTTON
static const char *const GAMEPAD_SOURCE_UNKNOWN = "Unknown"
static const gamepad_axis_field GAMEPAD_AXIS_FIELDS []
static const gamepad_axis_field GAMEPAD_DEADZONE_FIELDS []

Function Documentation

◆ draw_gamepad_axes()

◆ draw_gamepad_axis_choice()

void draw_gamepad_axis_choice ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state,
const char * label,
const char * id,
int axis_index )
static

◆ draw_gamepad_button_row()

◆ draw_gamepad_buttons()

◆ draw_gamepad_deadzone_input()

void draw_gamepad_deadzone_input ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state,
const char * label,
const char * id,
int axis_index )
static

◆ draw_gamepad_tab()

void draw_gamepad_tab ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state )

Definition at line 311 of file gui_tab_gamepad.c.

References ctx, draw_gamepad_axes(), draw_gamepad_buttons(), and state.

◆ gamepad_axis_label_state()

config_label_state gamepad_axis_label_state ( const config_ui_state * state,
const int * saved_values,
const int * default_values,
int axis_index )
static

Definition at line 51 of file gui_tab_gamepad.c.

References make_config_label_state(), and state.

Referenced by draw_gamepad_axis_choice().

◆ gamepad_deadzone_label_state()

config_label_state gamepad_deadzone_label_state ( const config_ui_state * state,
const int * saved_values,
const int * default_values,
int axis_index )
static

Definition at line 63 of file gui_tab_gamepad.c.

References make_config_label_state(), and state.

Referenced by draw_gamepad_deadzone_input().

◆ source_from_event()

int source_from_event ( const SDL_Event * event)

◆ source_label()

const char * source_label ( int source)

◆ source_tooltip()

const char * source_tooltip ( int source)

Variable Documentation

◆ GAMEPAD_AXIS_FIELDS

const gamepad_axis_field GAMEPAD_AXIS_FIELDS[]
static
Initial value:
= {
{"Stick X Axis", "##axis_stick_x", DTTR_GAMEPAD_AXIS_IDX_STICK_X},
{"Stick Y Axis", "##axis_stick_y", DTTR_GAMEPAD_AXIS_IDX_STICK_Y},
{"Camera RZ Axis", "##axis_camera_rz", DTTR_GAMEPAD_AXIS_IDX_CAMERA_RZ},
}
#define DTTR_GAMEPAD_AXIS_IDX_STICK_Y
Definition dttr_config.h:61
#define DTTR_GAMEPAD_AXIS_IDX_CAMERA_RZ
Definition dttr_config.h:62
#define DTTR_GAMEPAD_AXIS_IDX_STICK_X
Definition dttr_config.h:60

Definition at line 39 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_axes().

◆ GAMEPAD_AXIS_TOOLTIPS

const char* const GAMEPAD_AXIS_TOOLTIPS[]
static
Initial value:
= {
"Disables this gamepad axis mapping.",
"Left stick horizontal axis.",
"Left stick vertical axis.",
"Right stick horizontal axis.",
"Right stick vertical axis.",
"Left trigger axis.",
"Right trigger axis.",
}

Definition at line 3 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_axis_choice().

◆ GAMEPAD_DEADZONE_FIELDS

const gamepad_axis_field GAMEPAD_DEADZONE_FIELDS[]
static
Initial value:
= {
{"Stick X Deadzone", "##deadzone_stick_x", DTTR_GAMEPAD_AXIS_IDX_STICK_X},
{"Stick Y Deadzone", "##deadzone_stick_y", DTTR_GAMEPAD_AXIS_IDX_STICK_Y},
{"Camera RZ Deadzone", "##deadzone_camera_rz", DTTR_GAMEPAD_AXIS_IDX_CAMERA_RZ},
}

Definition at line 45 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_axes().

◆ GAMEPAD_SOURCE_UNKNOWN

const char* const GAMEPAD_SOURCE_UNKNOWN = "Unknown"
static

Definition at line 31 of file gui_tab_gamepad.c.

Referenced by source_label().

◆ TOOLTIP_BIND_BUTTON

const char* TOOLTIP_BIND_BUTTON
static
Initial value:
= "Click, then press a gamepad button or "
"trigger to remap this SDL source row."

Definition at line 26 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_button_row().

◆ TOOLTIP_CLEAR_BUTTON

const char* TOOLTIP_CLEAR_BUTTON = "Set this SDL input mapping to none."
static

Definition at line 28 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_button_row().

◆ TOOLTIP_GAMEPAD_AXIS

const char* TOOLTIP_GAMEPAD_AXIS
static
Initial value:
= "SDL axis for this DttR control. Default: "
"movement uses the left stick; camera RZ "
"uses the right stick X axis."

Definition at line 15 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_axis_choice().

◆ TOOLTIP_GAMEPAD_BUTTONS

const char* TOOLTIP_GAMEPAD_BUTTONS
static
Initial value:
= "Map controller inputs to game actions. "
"Bind waits for a button; Clear leaves the "
"action unused."

Definition at line 20 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_buttons(), and source_tooltip().

◆ TOOLTIP_GAMEPAD_DEADZONE

const char* TOOLTIP_GAMEPAD_DEADZONE
static
Initial value:
= "Per-axis deadzone in scaled axis units. "
"Default: 700."

Definition at line 18 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_deadzone_input().

◆ TOOLTIP_GAMEPAD_EAST

const char* TOOLTIP_GAMEPAD_EAST = "Default menu back action."
static

Definition at line 24 of file gui_tab_gamepad.c.

Referenced by source_tooltip().

◆ TOOLTIP_GAMEPAD_ENABLED

const char* TOOLTIP_GAMEPAD_ENABLED = "Enable controller input. Default: true."
static

Definition at line 13 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_axes().

◆ TOOLTIP_GAMEPAD_INDEX

const char* TOOLTIP_GAMEPAD_INDEX = "Controller index, starting at 0. Default: 0."
static

Definition at line 14 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_axes().

◆ TOOLTIP_GAMEPAD_SOUTH

const char* TOOLTIP_GAMEPAD_SOUTH = "Default menu confirm action."
static

Definition at line 23 of file gui_tab_gamepad.c.

Referenced by source_tooltip().

◆ TOOLTIP_GAMEPAD_START

const char* TOOLTIP_GAMEPAD_START = "Default start/pause action."
static

Definition at line 25 of file gui_tab_gamepad.c.

Referenced by source_tooltip().

◆ TOOLTIP_RESET_BUTTON

const char* TOOLTIP_RESET_BUTTON
static
Initial value:
= "Reset this game action to its default "
"controller input."

Definition at line 29 of file gui_tab_gamepad.c.

Referenced by draw_gamepad_button_row().