102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
gui_internal.h File Reference
#include <dttr_config.h>
#include <dttr_imgui.h>
#include <dttr_path.h>
#include <dttr_sdl.h>
#include <SDL3/SDL.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  config_ui_state

Macros

#define DTTR_CONFIG_UI_WINDOW_H   550
#define DTTR_CONFIG_UI_LABEL_W   170.0f
#define DTTR_CONFIG_UI_INPUT_W   285.0f
#define DTTR_CONFIG_UI_PATH_INPUT_W   160.0f
#define DTTR_CONFIG_UI_PATH_BUTTON_W   70.0f
#define DTTR_CONFIG_UI_GAMEPAD_SOURCE_W   135.0f
#define DTTR_CONFIG_UI_GAMEPAD_BUTTON_W   58.0f
#define DTTR_CONFIG_UI_PANEL_PADDING_X   7.5f
#define DTTR_CONFIG_UI_PANEL_PADDING_Y   14.0f
#define DTTR_CONFIG_UI_ITEM_SPACING_X   8.0f
#define DTTR_CONFIG_UI_ITEM_SPACING_Y   6.0f
#define DTTR_CONFIG_UI_TABLE_CELL_PADDING_X   8.0f
#define DTTR_CONFIG_UI_TABLE_CELL_PADDING_Y   4.0f
#define DTTR_CONFIG_UI_HEADER_TEXT_INSET_X   2.0f
#define DTTR_CONFIG_UI_COMBO_POPUP_PADDING_Y   0.0f
#define DTTR_CONFIG_UI_SECTION_SPACING   10.0f
#define DTTR_CONFIG_UI_LABEL_TEXT_COLOR   ((ImVec4_c){0.72f, 0.50f, 0.95f, 1.0f})
#define DTTR_CONFIG_UI_CHANGED_LABEL_TEXT_COLOR   ((ImVec4_c){1.0f, 0.82f, 0.25f, 1.0f})
#define DTTR_CONFIG_UI_SAVED_CHANGED_LABEL_TEXT_COLOR   ((ImVec4_c){0.48f, 0.78f, 1.0f, 1.0f})
#define DTTR_CONFIG_UI_TOOLTIP_DEFAULT_TEXT_COLOR   ((ImVec4_c){0.48f, 0.90f, 0.48f, 1.0f})
#define DTTR_CONFIG_UI_SELECTED_TAB_BG   ((ImVec4_c){0.115f, 0.130f, 0.150f, 1.0f})
#define DTTR_CONFIG_UI_BORDER_COLOR   ((ImVec4_c){0.105f, 0.115f, 0.125f, 1.0f})
#define DTTR_CONFIG_UI_TABLE_BORDER_COLOR   ((ImVec4_c){0.135f, 0.145f, 0.155f, 1.0f})
#define DTTR_CONFIG_UI_SEPARATOR_COLOR   ((ImVec4_c){0.120f, 0.130f, 0.140f, 1.0f})
#define DTTR_CONFIG_UI_PATH_BUTTON_SPACING   4.0f
#define DTTR_CONFIG_UI_STATUS_TEXT_COLOR   ((ImVec4_c){1.0f, 0.82f, 0.25f, 1.0f})
#define DTTR_CONFIG_UI_HINT_TEXT_COLOR   ((ImVec4_c){0.72f, 0.74f, 0.78f, 1.0f})
#define DTTR_CONFIG_UI_WARNING_TEXT_COLOR   ((ImVec4_c){1.0f, 0.55f, 0.18f, 1.0f})
#define DTTR_CONFIG_UI_STATUS_TIMEOUT_MS   5000
#define DTTR_CONFIG_UI_HEADER_TOP_SPACING   0.0f
#define DTTR_CONFIG_UI_TOOLTIP_PADDING_Y   4.0f
#define DTTR_CONFIG_UI_TOOLTIP_WRAP_W   360.0f
#define CONFIG_TABLE_FLAGS
#define DTTR_VERSION   "unknown"
#define FIELD_DIFFERS(state, base, field)
#define FIELD_UNSAVED(state, field)
#define FIELD_DEFAULT_CHANGED(state, field)
#define PATH_FIELD_DIFFERS(state, base, field)
#define PATH_FIELD_UNSAVED(state, field)
#define PATH_FIELD_DEFAULT_CHANGED(state, field)
#define FIELD_LABEL_STATE(state, field)
#define PATH_FIELD_LABEL_STATE(state, field)

Enumerations

enum  config_label_state { CONFIG_LABEL_DEFAULT , CONFIG_LABEL_SAVED_CHANGED , CONFIG_LABEL_UNSAVED }

Functions

float config_standard_input_width ()
int config_window_width ()
void same_path_button_row (const DTTR_ImGuiDialogContext *ctx)
void add_scaled_vertical_spacing (const DTTR_ImGuiDialogContext *ctx, float height)
void set_status (config_ui_state *state, const char *status)
void set_mods_dir_from_config_path (config_ui_state *state)
void sync_rows_from_config (config_ui_state *state)
void sync_config_from_rows (config_ui_state *state)
int gamepad_button_row_count ()
int gamepad_button_row_action (int row)
const char * gamepad_button_row_label (int row)
int gamepad_default_source_for_action (const config_ui_state *state, int action)
const char * game_action_tooltip (int action)
void load_config (config_ui_state *state)
void save_config (config_ui_state *state)
void reset_defaults (config_ui_state *state)
void request_reset_defaults (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
config_label_state make_config_label_state (bool unsaved_changed, bool default_changed)
bool gamepad_button_rows_have_unsaved_changes (const config_ui_state *state)
config_label_state gamepad_button_label_state (const config_ui_state *state, int source, int action)
bool config_has_unsaved_changes (const config_ui_state *state)
bool choice_combo (const char *label, int *value, DTTR_ConfigChoiceList choices, const char *const *tooltips)
void show_tooltip (const char *text)
bool themed_row_button (const DTTR_ImGuiDialogContext *ctx, const char *id, const char *label, float width)
void push_config_theme ()
void pop_config_theme ()
float config_footer_height (const DTTR_ImGuiDialogContext *ctx, const config_ui_state *state)
bool begin_config_content_region (const DTTR_ImGuiDialogContext *ctx, const config_ui_state *state)
void end_config_content_region ()
void draw_footer_text (const DTTR_ImGuiDialogContext *ctx, const config_ui_state *state)
bool begin_padded_panel (const DTTR_ImGuiDialogContext *ctx)
void end_padded_panel ()
bool begin_settings_table_with_width (const DTTR_ImGuiDialogContext *ctx, const char *id, float label_width, float input_width, float table_width)
bool begin_settings_table (const DTTR_ImGuiDialogContext *ctx, const char *id, float label_width, float input_width)
void end_settings_table ()
bool begin_gamepad_button_table (const DTTR_ImGuiDialogContext *ctx)
void begin_config_table_row ()
void begin_setting_row ()
float table_input_width (const DTTR_ImGuiDialogContext *ctx, float input_width)
float path_text_input_width (const DTTR_ImGuiDialogContext *ctx, int button_count)
void draw_config_label (const char *label, const char *tooltip, config_label_state label_state)
bool labeled_input_text (const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, char *buf, size_t buf_size, const char *tooltip, config_label_state label_state)
bool labeled_path_picker (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state, const char *label, const char *id, char *buf, size_t buf_size, const char *tooltip, config_label_state label_state)
bool labeled_log_path_picker (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state, const char *label, const char *id, char *buf, size_t buf_size, const char *tooltip, config_label_state label_state)
bool labeled_input_int (const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, int *value, int step, int step_fast, const char *tooltip, config_label_state label_state)
bool labeled_input_float (const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, float *value, const char *tooltip, config_label_state label_state)
bool labeled_checkbox (const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, bool *value, const char *tooltip, config_label_state label_state)
bool labeled_choice_combo (const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, int *value, DTTR_ConfigChoiceList choices, const char *const *tooltips, const char *tooltip, config_label_state label_state)
void open_pcdogs_dir_dialog (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void open_pcdogs_iso_dialog (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void open_log_file_dialog (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
const char * source_label (int source)
const char * source_tooltip (int source)
int source_from_event (const SDL_Event *event)
bool event_cancels_binding (const SDL_Event *event)
void cancel_binding (config_ui_state *state)
void capture_source (config_ui_state *state, int new_source)
bool begin_tab_settings_table (const DTTR_ImGuiDialogContext *ctx, const char *id, float input_width)
void draw_general_tab (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void draw_graphics_tab (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void draw_audio_tab (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void draw_gamepad_tab (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void draw_modding_tab (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
void draw_tabs (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)

Macro Definition Documentation

◆ CONFIG_TABLE_FLAGS

#define CONFIG_TABLE_FLAGS
Value:
(ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH \
| ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_NoSavedSettings \
| ImGuiTableFlags_PadOuterX)

Definition at line 49 of file gui_internal.h.

Referenced by begin_config_table(), and begin_mod_table().

◆ DTTR_CONFIG_UI_BORDER_COLOR

#define DTTR_CONFIG_UI_BORDER_COLOR   ((ImVec4_c){0.105f, 0.115f, 0.125f, 1.0f})

Definition at line 37 of file gui_internal.h.

◆ DTTR_CONFIG_UI_CHANGED_LABEL_TEXT_COLOR

#define DTTR_CONFIG_UI_CHANGED_LABEL_TEXT_COLOR   ((ImVec4_c){1.0f, 0.82f, 0.25f, 1.0f})

Definition at line 32 of file gui_internal.h.

Referenced by config_label_text_color().

◆ DTTR_CONFIG_UI_COMBO_POPUP_PADDING_Y

#define DTTR_CONFIG_UI_COMBO_POPUP_PADDING_Y   0.0f

Definition at line 29 of file gui_internal.h.

Referenced by choice_combo().

◆ DTTR_CONFIG_UI_GAMEPAD_BUTTON_W

#define DTTR_CONFIG_UI_GAMEPAD_BUTTON_W   58.0f

◆ DTTR_CONFIG_UI_GAMEPAD_SOURCE_W

#define DTTR_CONFIG_UI_GAMEPAD_SOURCE_W   135.0f

Definition at line 20 of file gui_internal.h.

Referenced by begin_gamepad_button_table(), and config_gamepad_content_width().

◆ DTTR_CONFIG_UI_HEADER_TEXT_INSET_X

#define DTTR_CONFIG_UI_HEADER_TEXT_INSET_X   2.0f

Definition at line 28 of file gui_internal.h.

Referenced by append_table_header_text().

◆ DTTR_CONFIG_UI_HEADER_TOP_SPACING

#define DTTR_CONFIG_UI_HEADER_TOP_SPACING   0.0f

Definition at line 45 of file gui_internal.h.

Referenced by draw_ui().

◆ DTTR_CONFIG_UI_HINT_TEXT_COLOR

#define DTTR_CONFIG_UI_HINT_TEXT_COLOR   ((ImVec4_c){0.72f, 0.74f, 0.78f, 1.0f})

Definition at line 42 of file gui_internal.h.

Referenced by draw_footer_text().

◆ DTTR_CONFIG_UI_INPUT_W

◆ DTTR_CONFIG_UI_ITEM_SPACING_X

#define DTTR_CONFIG_UI_ITEM_SPACING_X   8.0f

Definition at line 24 of file gui_internal.h.

Referenced by begin_padded_panel().

◆ DTTR_CONFIG_UI_ITEM_SPACING_Y

#define DTTR_CONFIG_UI_ITEM_SPACING_Y   6.0f

Definition at line 25 of file gui_internal.h.

Referenced by begin_padded_panel().

◆ DTTR_CONFIG_UI_LABEL_TEXT_COLOR

#define DTTR_CONFIG_UI_LABEL_TEXT_COLOR   ((ImVec4_c){0.72f, 0.50f, 0.95f, 1.0f})

Definition at line 31 of file gui_internal.h.

Referenced by config_label_text_color().

◆ DTTR_CONFIG_UI_LABEL_W

#define DTTR_CONFIG_UI_LABEL_W   170.0f

◆ DTTR_CONFIG_UI_PANEL_PADDING_X

#define DTTR_CONFIG_UI_PANEL_PADDING_X   7.5f

Definition at line 22 of file gui_internal.h.

Referenced by begin_padded_panel(), and config_window_width().

◆ DTTR_CONFIG_UI_PANEL_PADDING_Y

#define DTTR_CONFIG_UI_PANEL_PADDING_Y   14.0f

Definition at line 23 of file gui_internal.h.

Referenced by begin_padded_panel().

◆ DTTR_CONFIG_UI_PATH_BUTTON_SPACING

#define DTTR_CONFIG_UI_PATH_BUTTON_SPACING   4.0f

◆ DTTR_CONFIG_UI_PATH_BUTTON_W

#define DTTR_CONFIG_UI_PATH_BUTTON_W   70.0f

◆ DTTR_CONFIG_UI_PATH_INPUT_W

#define DTTR_CONFIG_UI_PATH_INPUT_W   160.0f

◆ DTTR_CONFIG_UI_SAVED_CHANGED_LABEL_TEXT_COLOR

#define DTTR_CONFIG_UI_SAVED_CHANGED_LABEL_TEXT_COLOR   ((ImVec4_c){0.48f, 0.78f, 1.0f, 1.0f})

Definition at line 33 of file gui_internal.h.

Referenced by config_label_text_color().

◆ DTTR_CONFIG_UI_SECTION_SPACING

#define DTTR_CONFIG_UI_SECTION_SPACING   10.0f

Definition at line 30 of file gui_internal.h.

Referenced by draw_gamepad_buttons(), and draw_mod_section_header().

◆ DTTR_CONFIG_UI_SELECTED_TAB_BG

#define DTTR_CONFIG_UI_SELECTED_TAB_BG   ((ImVec4_c){0.115f, 0.130f, 0.150f, 1.0f})

Definition at line 36 of file gui_internal.h.

◆ DTTR_CONFIG_UI_SEPARATOR_COLOR

#define DTTR_CONFIG_UI_SEPARATOR_COLOR   ((ImVec4_c){0.120f, 0.130f, 0.140f, 1.0f})

Definition at line 39 of file gui_internal.h.

◆ DTTR_CONFIG_UI_STATUS_TEXT_COLOR

#define DTTR_CONFIG_UI_STATUS_TEXT_COLOR   ((ImVec4_c){1.0f, 0.82f, 0.25f, 1.0f})

Definition at line 41 of file gui_internal.h.

Referenced by draw_footer_text().

◆ DTTR_CONFIG_UI_STATUS_TIMEOUT_MS

#define DTTR_CONFIG_UI_STATUS_TIMEOUT_MS   5000

Definition at line 44 of file gui_internal.h.

Referenced by set_status().

◆ DTTR_CONFIG_UI_TABLE_BORDER_COLOR

#define DTTR_CONFIG_UI_TABLE_BORDER_COLOR   ((ImVec4_c){0.135f, 0.145f, 0.155f, 1.0f})

Definition at line 38 of file gui_internal.h.

◆ DTTR_CONFIG_UI_TABLE_CELL_PADDING_X

#define DTTR_CONFIG_UI_TABLE_CELL_PADDING_X   8.0f

Definition at line 26 of file gui_internal.h.

Referenced by begin_gamepad_button_table(), and begin_settings_table_with_width().

◆ DTTR_CONFIG_UI_TABLE_CELL_PADDING_Y

#define DTTR_CONFIG_UI_TABLE_CELL_PADDING_Y   4.0f

Definition at line 27 of file gui_internal.h.

Referenced by table_cell_padding().

◆ DTTR_CONFIG_UI_TOOLTIP_DEFAULT_TEXT_COLOR

#define DTTR_CONFIG_UI_TOOLTIP_DEFAULT_TEXT_COLOR   ((ImVec4_c){0.48f, 0.90f, 0.48f, 1.0f})

Definition at line 35 of file gui_internal.h.

Referenced by draw_default_inline_text().

◆ DTTR_CONFIG_UI_TOOLTIP_PADDING_Y

#define DTTR_CONFIG_UI_TOOLTIP_PADDING_Y   4.0f

Definition at line 46 of file gui_internal.h.

Referenced by show_tooltip().

◆ DTTR_CONFIG_UI_TOOLTIP_WRAP_W

#define DTTR_CONFIG_UI_TOOLTIP_WRAP_W   360.0f

Definition at line 47 of file gui_internal.h.

Referenced by show_tooltip().

◆ DTTR_CONFIG_UI_WARNING_TEXT_COLOR

#define DTTR_CONFIG_UI_WARNING_TEXT_COLOR   ((ImVec4_c){1.0f, 0.55f, 0.18f, 1.0f})

Definition at line 43 of file gui_internal.h.

Referenced by draw_modding_tab().

◆ DTTR_CONFIG_UI_WINDOW_H

#define DTTR_CONFIG_UI_WINDOW_H   550

Definition at line 15 of file gui_internal.h.

Referenced by dttr_config_main().

◆ DTTR_VERSION

#define DTTR_VERSION   "unknown"

Definition at line 55 of file gui_internal.h.

◆ FIELD_DEFAULT_CHANGED

#define FIELD_DEFAULT_CHANGED ( state,
field )
Value:
FIELD_DIFFERS(state, defaults, field)
const DTTR_BackendState * state
#define FIELD_DIFFERS(state, base, field)

Definition at line 82 of file gui_internal.h.

◆ FIELD_DIFFERS

#define FIELD_DIFFERS ( state,
base,
field )
Value:
(memcmp(&(state)->config.field, &(state)->base.field, sizeof((state)->config.field)) \
!= 0)

Definition at line 78 of file gui_internal.h.

◆ FIELD_LABEL_STATE

#define FIELD_LABEL_STATE ( state,
field )
Value:
FIELD_UNSAVED(state, field), \
)
config_label_state make_config_label_state(bool unsaved_changed, bool default_changed)
Definition gui_state.c:246
#define FIELD_UNSAVED(state, field)
#define FIELD_DEFAULT_CHANGED(state, field)

Definition at line 88 of file gui_internal.h.

Referenced by draw_audio_tab(), draw_gamepad_axes(), draw_general_tab(), draw_graphics_tab(), and draw_modding_tab().

◆ FIELD_UNSAVED

#define FIELD_UNSAVED ( state,
field )
Value:
FIELD_DIFFERS(state, saved_config, field)

Definition at line 81 of file gui_internal.h.

◆ PATH_FIELD_DEFAULT_CHANGED

#define PATH_FIELD_DEFAULT_CHANGED ( state,
field )
Value:
PATH_FIELD_DIFFERS(state, defaults, field)
#define PATH_FIELD_DIFFERS(state, base, field)

Definition at line 86 of file gui_internal.h.

◆ PATH_FIELD_DIFFERS

#define PATH_FIELD_DIFFERS ( state,
base,
field )
Value:
(!DTTR_Path_MatchesNormalized((state)->config.field, (state)->base.field))
bool DTTR_Path_MatchesNormalized(const char *lhs, const char *rhs)
Definition path.c:165

Definition at line 83 of file gui_internal.h.

◆ PATH_FIELD_LABEL_STATE

#define PATH_FIELD_LABEL_STATE ( state,
field )
Value:
)
#define PATH_FIELD_UNSAVED(state, field)
#define PATH_FIELD_DEFAULT_CHANGED(state, field)

Definition at line 93 of file gui_internal.h.

Referenced by draw_general_tab().

◆ PATH_FIELD_UNSAVED

#define PATH_FIELD_UNSAVED ( state,
field )
Value:
PATH_FIELD_DIFFERS(state, saved_config, field)

Definition at line 85 of file gui_internal.h.

Enumeration Type Documentation

◆ config_label_state

Enumerator
CONFIG_LABEL_DEFAULT 
CONFIG_LABEL_SAVED_CHANGED 
CONFIG_LABEL_UNSAVED 

Definition at line 58 of file gui_internal.h.

Function Documentation

◆ add_scaled_vertical_spacing()

void add_scaled_vertical_spacing ( const DTTR_ImGuiDialogContext * ctx,
float height )

◆ begin_config_content_region()

bool begin_config_content_region ( const DTTR_ImGuiDialogContext * ctx,
const config_ui_state * state )

Definition at line 333 of file gui_widgets.c.

References config_footer_height(), ctx, and state.

Referenced by draw_ui().

◆ begin_config_table_row()

void begin_config_table_row ( )

Definition at line 575 of file gui_widgets.c.

Referenced by begin_setting_row(), draw_gamepad_button_row(), and draw_mod_toggle_row().

◆ begin_gamepad_button_table()

◆ begin_padded_panel()

◆ begin_setting_row()

◆ begin_settings_table()

bool begin_settings_table ( const DTTR_ImGuiDialogContext * ctx,
const char * id,
float label_width,
float input_width )

Definition at line 510 of file gui_widgets.c.

References begin_settings_table_with_width(), and ctx.

Referenced by begin_tab_settings_table(), and draw_gamepad_axes().

◆ begin_settings_table_with_width()

bool begin_settings_table_with_width ( const DTTR_ImGuiDialogContext * ctx,
const char * id,
float label_width,
float input_width,
float table_width )

◆ begin_tab_settings_table()

bool begin_tab_settings_table ( const DTTR_ImGuiDialogContext * ctx,
const char * id,
float input_width )

◆ cancel_binding()

void cancel_binding ( config_ui_state * state)

Definition at line 140 of file gui_state.c.

References set_status(), and state.

Referenced by process_events().

◆ capture_source()

void capture_source ( config_ui_state * state,
int new_source )

Definition at line 149 of file gui_state.c.

References button_source_in_range(), gamepad_button_row_count(), set_status(), and state.

Referenced by process_events().

◆ choice_combo()

bool choice_combo ( const char * label,
int * value,
DTTR_ConfigChoiceList choices,
const char *const * tooltips )

◆ config_footer_height()

float config_footer_height ( const DTTR_ImGuiDialogContext * ctx,
const config_ui_state * state )

Definition at line 318 of file gui_widgets.c.

References ctx, format_status_text(), state, and status_text_height().

Referenced by begin_config_content_region().

◆ config_has_unsaved_changes()

bool config_has_unsaved_changes ( const config_ui_state * state)

◆ config_standard_input_width()

◆ config_window_width()

int config_window_width ( )

◆ draw_audio_tab()

◆ draw_config_label()

void draw_config_label ( const char * label,
const char * tooltip,
config_label_state label_state )

◆ draw_footer_text()

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

◆ 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.

◆ draw_general_tab()

◆ draw_graphics_tab()

◆ draw_modding_tab()

◆ draw_tabs()

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

Definition at line 31 of file gui_tabs.c.

References CONFIG_TABS, ctx, config_tab_spec::draw, config_tab_spec::label, NULL, and state.

Referenced by draw_ui().

◆ end_config_content_region()

void end_config_content_region ( )

Definition at line 348 of file gui_widgets.c.

Referenced by draw_ui().

◆ end_padded_panel()

void end_padded_panel ( )

Definition at line 386 of file gui_widgets.c.

Referenced by draw_ui().

◆ end_settings_table()

◆ event_cancels_binding()

bool event_cancels_binding ( const SDL_Event * event)

Definition at line 135 of file gui_state.c.

References event.

Referenced by process_events().

◆ game_action_tooltip()

const char * game_action_tooltip ( int action)

Definition at line 26 of file gui_state.c.

References DTTR_GAMEPAD_MAPPING_NONE, and GAME_ACTION_TOOLTIPS.

Referenced by draw_gamepad_button_row().

◆ gamepad_button_label_state()

config_label_state gamepad_button_label_state ( const config_ui_state * state,
int source,
int action )

Definition at line 269 of file gui_state.c.

References make_config_label_state(), source, source_for_action(), and state.

Referenced by draw_gamepad_button_row().

◆ gamepad_button_row_action()

int gamepad_button_row_action ( int row)

◆ gamepad_button_row_count()

◆ gamepad_button_row_label()

const char * gamepad_button_row_label ( int row)

◆ gamepad_button_rows_have_unsaved_changes()

bool gamepad_button_rows_have_unsaved_changes ( const config_ui_state * state)

Definition at line 254 of file gui_state.c.

References gamepad_button_row_count(), source_for_action(), and state.

Referenced by config_has_unsaved_changes().

◆ gamepad_default_source_for_action()

int gamepad_default_source_for_action ( const config_ui_state * state,
int action )

Definition at line 88 of file gui_state.c.

References DTTR_GAMEPAD_MAPPING_NONE, source_for_action(), and state.

Referenced by draw_gamepad_button_row().

◆ labeled_checkbox()

bool labeled_checkbox ( const DTTR_ImGuiDialogContext * ctx,
const char * label,
const char * id,
bool * value,
const char * tooltip,
config_label_state label_state )

◆ labeled_choice_combo()

bool labeled_choice_combo ( const DTTR_ImGuiDialogContext * ctx,
const char * label,
const char * id,
int * value,
DTTR_ConfigChoiceList choices,
const char *const * tooltips,
const char * tooltip,
config_label_state label_state )

◆ labeled_input_float()

bool labeled_input_float ( const DTTR_ImGuiDialogContext * ctx,
const char * label,
const char * id,
float * value,
const char * tooltip,
config_label_state label_state )

◆ labeled_input_int()

bool labeled_input_int ( const DTTR_ImGuiDialogContext * ctx,
const char * label,
const char * id,
int * value,
int step,
int step_fast,
const char * tooltip,
config_label_state label_state )

◆ labeled_input_text()

bool labeled_input_text ( const DTTR_ImGuiDialogContext * ctx,
const char * label,
const char * id,
char * buf,
size_t buf_size,
const char * tooltip,
config_label_state label_state )

◆ labeled_log_path_picker()

bool labeled_log_path_picker ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state,
const char * label,
const char * id,
char * buf,
size_t buf_size,
const char * tooltip,
config_label_state label_state )

Definition at line 768 of file gui_widgets.c.

References ctx, labeled_path_picker_with_dialog(), open_log_file_dialog(), and state.

Referenced by draw_general_tab().

◆ labeled_path_picker()

bool labeled_path_picker ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state,
const char * label,
const char * id,
char * buf,
size_t buf_size,
const char * tooltip,
config_label_state label_state )

◆ load_config()

◆ make_config_label_state()

config_label_state make_config_label_state ( bool unsaved_changed,
bool default_changed )

◆ open_log_file_dialog()

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

◆ open_pcdogs_dir_dialog()

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

◆ open_pcdogs_iso_dialog()

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

◆ path_text_input_width()

◆ pop_config_theme()

void pop_config_theme ( )

Definition at line 271 of file gui_widgets.c.

References CONFIG_THEME_COLORS.

Referenced by draw_ui().

◆ push_config_theme()

void push_config_theme ( )

Definition at line 265 of file gui_widgets.c.

References color, CONFIG_THEME_COLORS, and target.

Referenced by draw_ui().

◆ request_reset_defaults()

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

Definition at line 223 of file gui_state.c.

References ctx, DTTR_SDL_ShowMessageBox(), NULL, reset_defaults(), and state.

Referenced by draw_toolbar().

◆ reset_defaults()

void reset_defaults ( config_ui_state * state)

Definition at line 217 of file gui_state.c.

References DTTR_Config_SetDefaults(), refresh_button_rows(), set_status(), and state.

Referenced by request_reset_defaults().

◆ same_path_button_row()

void same_path_button_row ( const DTTR_ImGuiDialogContext * ctx)

◆ save_config()

void save_config ( config_ui_state * state)

Definition at line 205 of file gui_state.c.

References DTTR_Config_Save(), set_status(), state, and sync_config_from_rows().

Referenced by draw_toolbar(), and handle_shortcuts().

◆ set_mods_dir_from_config_path()

void set_mods_dir_from_config_path ( config_ui_state * state)

◆ set_status()

◆ show_tooltip()

◆ 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)

◆ sync_config_from_rows()

void sync_config_from_rows ( config_ui_state * state)

◆ sync_rows_from_config()

◆ table_input_width()

float table_input_width ( const DTTR_ImGuiDialogContext * ctx,
float input_width )

Definition at line 582 of file gui_widgets.c.

References ctx, and DTTR_ImGuiDialog_ScaledFloat().

Referenced by begin_labeled_control(), and path_text_input_width().

◆ themed_row_button()

bool themed_row_button ( const DTTR_ImGuiDialogContext * ctx,
const char * id,
const char * label,
float width )