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

Go to the source code of this file.

Functions

static sds config_path_from_args (int argc, char **argv)
static bool confirm_discard_changes (const DTTR_ImGuiDialogContext *ctx, const config_ui_state *state, const char *action)
static void draw_toolbar (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
static void handle_shortcuts (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
static bool env_flag_enabled (const char *name)
static void draw_shortcut_debug_row (const char *label, ImGuiKeyChord chord)
static void draw_shortcut_debug_window (const config_ui_state *state)
static bool init_state_from_args (config_ui_state *state, int argc, char **argv)
static void draw_ui (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
static void process_events (const DTTR_ImGuiDialogContext *ctx, config_ui_state *state, bool *running)
int dttr_config_main (int argc, char **argv)

Variables

static const char *const CONFIG_WINDOW_TITLE = "DttR Configuration"
static const char *const CONFIG_DEBUG_SHORTCUTS_ENV = "DTTR_CONFIG_DEBUG_SHORTCUTS"

Function Documentation

◆ config_path_from_args()

sds config_path_from_args ( int argc,
char ** argv )
static

Definition at line 8 of file gui.c.

References DTTR_CONFIG_FILENAME, DTTR_Path_ModuleSibling(), and NULL.

Referenced by init_state_from_args().

◆ confirm_discard_changes()

bool confirm_discard_changes ( const DTTR_ImGuiDialogContext * ctx,
const config_ui_state * state,
const char * action )
static

Definition at line 16 of file gui.c.

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

Referenced by draw_toolbar(), handle_shortcuts(), and process_events().

◆ draw_shortcut_debug_row()

void draw_shortcut_debug_row ( const char * label,
ImGuiKeyChord chord )
static

Definition at line 89 of file gui.c.

References NULL.

Referenced by draw_shortcut_debug_window().

◆ draw_shortcut_debug_window()

void draw_shortcut_debug_window ( const config_ui_state * state)
static

Definition at line 117 of file gui.c.

References draw_shortcut_debug_row(), NULL, and state.

Referenced by draw_ui().

◆ draw_toolbar()

void draw_toolbar ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state )
static

Definition at line 52 of file gui.c.

References confirm_discard_changes(), ctx, load_config(), NULL, request_reset_defaults(), save_config(), and state.

Referenced by draw_ui().

◆ draw_ui()

◆ dttr_config_main()

◆ env_flag_enabled()

bool env_flag_enabled ( const char * name)
static

Definition at line 84 of file gui.c.

Referenced by init_state_from_args().

◆ handle_shortcuts()

void handle_shortcuts ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state )
static

Definition at line 73 of file gui.c.

References confirm_discard_changes(), ctx, load_config(), save_config(), and state.

Referenced by draw_ui().

◆ init_state_from_args()

◆ process_events()

void process_events ( const DTTR_ImGuiDialogContext * ctx,
config_ui_state * state,
bool * running )
static

Variable Documentation

◆ CONFIG_DEBUG_SHORTCUTS_ENV

const char* const CONFIG_DEBUG_SHORTCUTS_ENV = "DTTR_CONFIG_DEBUG_SHORTCUTS"
static

Definition at line 6 of file gui.c.

Referenced by init_state_from_args().

◆ CONFIG_WINDOW_TITLE

const char* const CONFIG_WINDOW_TITLE = "DttR Configuration"
static

Definition at line 5 of file gui.c.

Referenced by draw_ui(), dttr_config_main(), and init_state_from_args().