|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include <SDL3/SDL.h>#include <cimgui.h>#include <cimgui_impl.h>#include <cimgui_impl_sdlgpu3.h>#include <stdbool.h>Go to the source code of this file.
Data Structures | |
| struct | DTTR_ImGuiDesktopScaleState |
| struct | DTTR_ImGuiDialogContext |
Macros | |
| #define | DTTR_IMGUI_COLOR_LINK ((ImVec4_c){0.33f, 0.63f, 1.0f, 1.0f}) |
| #define | DTTR_IMGUI_COLOR_STACK_FRAME_BG ((ImVec4_c){0.10f, 0.11f, 0.12f, 1.0f}) |
| #define | DTTR_IMGUI_COLOR_BUTTON_BG ((ImVec4_c){0.184f, 0.204f, 0.227f, 1.0f}) |
| #define | DTTR_IMGUI_COLOR_BUTTON_BG_HOVERED ((ImVec4_c){0.235f, 0.267f, 0.298f, 1.0f}) |
| #define | DTTR_IMGUI_COLOR_BUTTON_BG_ACTIVE ((ImVec4_c){0.145f, 0.165f, 0.188f, 1.0f}) |
| #define | DTTR_IMGUI_COLOR_BUTTON_TEXT ((ImVec4_c){0.91f, 0.90f, 0.87f, 1.0f}) |
| #define | DTTR_IMGUI_SCALE_EPSILON 0.001f |
Typedefs | |
| typedef struct DTTR_ImGuiDesktopScaleState | DTTR_ImGuiDesktopScaleState |
| typedef struct DTTR_ImGuiDialogContext | DTTR_ImGuiDialogContext |
Definition at line 12 of file dttr_imgui.h.
Referenced by DTTR_ImGuiDialog_Button().
Definition at line 14 of file dttr_imgui.h.
Referenced by DTTR_ImGuiDialog_Button().
Definition at line 13 of file dttr_imgui.h.
Referenced by DTTR_ImGuiDialog_Button().
Definition at line 15 of file dttr_imgui.h.
Referenced by DTTR_ImGuiDialog_Button().
Definition at line 10 of file dttr_imgui.h.
Referenced by draw_clickable_text().
Definition at line 11 of file dttr_imgui.h.
Referenced by draw_copyable_stack_trace().
| #define DTTR_IMGUI_SCALE_EPSILON 0.001f |
Definition at line 16 of file dttr_imgui.h.
Referenced by DTTR_ImGui_ScaleChanged().
| typedef struct DTTR_ImGuiDesktopScaleState DTTR_ImGuiDesktopScaleState |
| typedef struct DTTR_ImGuiDialogContext DTTR_ImGuiDialogContext |
|
inlinestatic |
Definition at line 51 of file dttr_imgui.h.
References DTTR_ImGui_NormalizeDesktopScale(), DTTR_ImGui_ScaleChanged(), and state.
Referenced by DTTR_ImGui_ApplyWindowDesktopScale().
|
inlinestatic |
Definition at line 77 of file dttr_imgui.h.
References DTTR_ImGui_ApplyDesktopScale(), DTTR_ImGui_GetWindowDesktopScale(), and state.
Referenced by DTTR_ImGuiDialog_RefreshScale().
| bool DTTR_ImGui_ErrorShow | ( | const char * | title, |
| const char * | message ) |
Definition at line 221 of file imgui_error_ui.c.
References ctx, draw_copyable_stack_trace(), DTTR_ERROR_UI_BUTTON_H, DTTR_ERROR_UI_INITIAL_WINDOW_H, DTTR_ERROR_UI_TEXT_PADDING_X, DTTR_ERROR_UI_TEXT_PADDING_Y, DTTR_ERROR_UI_WINDOW_W, DTTR_ImGuiDialog_Begin(), DTTR_ImGuiDialog_BeginRoot(), DTTR_ImGuiDialog_Button(), DTTR_ImGuiDialog_CenterNextItem(), DTTR_ImGuiDialog_DrawHeader(), DTTR_ImGuiDialog_DrawPaddedText(), DTTR_ImGuiDialog_End(), DTTR_ImGuiDialog_EndRoot(), DTTR_ImGuiDialog_FitWindowToContent(), DTTR_ImGuiDialog_NewFrame(), DTTR_ImGuiDialog_ProcessEvents(), DTTR_ImGuiDialog_RefreshScale(), DTTR_ImGuiDialog_Render(), DTTR_ImGuiDialog_ScaledFloat(), DTTR_VERSION, ERROR_TITLE, HEADER_TITLE, parse_error_message(), error_message::stack_trace, and window_title.
Referenced by DTTR_LoaderUI_ShowError(), and unhandled_exception_filter().
|
inlinestatic |
Definition at line 38 of file dttr_imgui.h.
References DTTR_ImGui_NormalizeDesktopScale(), and state.
Referenced by DTTR_ImGuiDialog_RefreshScale().
|
inlinestatic |
Definition at line 32 of file dttr_imgui.h.
References DTTR_ImGui_NormalizeDesktopScale().
Referenced by DTTR_ImGui_ApplyWindowDesktopScale().
Definition at line 28 of file dttr_imgui.h.
Referenced by DTTR_ImGui_ApplyDesktopScale(), DTTR_ImGui_GetCurrentDesktopScale(), and DTTR_ImGui_GetWindowDesktopScale().
Definition at line 46 of file dttr_imgui.h.
References DTTR_IMGUI_SCALE_EPSILON.
Referenced by DTTR_ImGui_ApplyDesktopScale(), and DTTR_ImGuiDialog_RefreshScale().
| bool DTTR_ImGuiDialog_Begin | ( | DTTR_ImGuiDialogContext * | ctx, |
| const char * | title, | ||
| int | width, | ||
| int | height ) |
Definition at line 122 of file imgui_dialog.c.
References ctx, DTTR_ImGuiDialog_End(), init_dialog_imgui(), init_sdl_video(), and set_gl_attributes().
Referenced by dttr_config_main(), DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| bool DTTR_ImGuiDialog_BeginRoot | ( | DTTR_ImGuiDialogContext * | ctx, |
| const char * | title, | ||
| ImGuiWindowFlags | flags ) |
Definition at line 274 of file imgui_dialog.c.
References begin_full_window(), ctx, flags, NULL, and ROOT_WINDOW_FLAGS.
Referenced by dttr_config_main(), DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| bool DTTR_ImGuiDialog_Button | ( | const DTTR_ImGuiDialogContext * | ctx, |
| const char * | id, | ||
| const char * | label, | ||
| ImVec2_c | size ) |
Definition at line 289 of file imgui_dialog.c.
References ctx, DTTR_IMGUI_COLOR_BUTTON_BG, DTTR_IMGUI_COLOR_BUTTON_BG_ACTIVE, DTTR_IMGUI_COLOR_BUTTON_BG_HOVERED, DTTR_IMGUI_COLOR_BUTTON_TEXT, DTTR_ImGuiDialog_ScaledFloat(), and size.
Referenced by draw_source_button(), DTTR_ImGui_ErrorShow(), and themed_row_button().
Definition at line 311 of file imgui_dialog.c.
Referenced by draw_centered_text(), draw_source_buttons(), and DTTR_ImGui_ErrorShow().
| void DTTR_ImGuiDialog_DrawHeader | ( | const DTTR_ImGuiDialogContext * | ctx, |
| const char * | title, | ||
| const char * | version ) |
Definition at line 324 of file imgui_dialog.c.
References ctx, draw_centered_text(), DTTR_ImGuiDialog_OffsetCursorY(), and NULL.
Referenced by draw_ui(), DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| void DTTR_ImGuiDialog_DrawPaddedText | ( | const DTTR_ImGuiDialogContext * | ctx, |
| const char * | message, | ||
| float | padding_x, | ||
| float | padding_y ) |
Definition at line 340 of file imgui_dialog.c.
References ctx, DTTR_ImGuiDialog_OffsetCursorY(), and DTTR_ImGuiDialog_ScaledFloat().
Referenced by DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| void DTTR_ImGuiDialog_End | ( | DTTR_ImGuiDialogContext * | ctx | ) |
Definition at line 174 of file imgui_dialog.c.
References ctx, restore_previous_imgui_context(), and use_dialog_imgui_context().
Referenced by dttr_config_main(), DTTR_ImGui_ErrorShow(), DTTR_ImGuiDialog_Begin(), and DTTR_LoaderUI_ChooseGameSource().
| void DTTR_ImGuiDialog_EndRoot | ( | ) |
Definition at line 284 of file imgui_dialog.c.
Referenced by dttr_config_main(), DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| void DTTR_ImGuiDialog_FitWindowToContent | ( | DTTR_ImGuiDialogContext * | ctx, |
| int | width, | ||
| float | padding_y ) |
Definition at line 354 of file imgui_dialog.c.
References ctx, DTTR_ImGuiDialog_ScaledFloat(), and scaled_int().
Referenced by DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| void DTTR_ImGuiDialog_NewFrame | ( | const DTTR_ImGuiDialogContext * | ctx | ) |
Definition at line 214 of file imgui_dialog.c.
References ctx, and use_dialog_imgui_context().
Referenced by dttr_config_main(), DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| void DTTR_ImGuiDialog_OffsetCursorY | ( | const DTTR_ImGuiDialogContext * | ctx, |
| float | amount ) |
Definition at line 25 of file imgui_dialog.c.
References ctx, and DTTR_ImGuiDialog_ScaledFloat().
Referenced by draw_copyable_stack_trace(), DTTR_ImGuiDialog_DrawHeader(), and DTTR_ImGuiDialog_DrawPaddedText().
| void DTTR_ImGuiDialog_ProcessEvent | ( | const DTTR_ImGuiDialogContext * | ctx, |
| const SDL_Event * | event, | ||
| bool * | running ) |
Definition at line 235 of file imgui_dialog.c.
References ctx, event, and use_dialog_imgui_context().
Referenced by DTTR_ImGuiDialog_ProcessEvents(), and process_events().
| void DTTR_ImGuiDialog_ProcessEvents | ( | const DTTR_ImGuiDialogContext * | ctx, |
| bool * | running ) |
Definition at line 255 of file imgui_dialog.c.
References ctx, DTTR_ImGuiDialog_ProcessEvent(), and event.
Referenced by DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| bool DTTR_ImGuiDialog_RefreshScale | ( | DTTR_ImGuiDialogContext * | ctx | ) |
Definition at line 55 of file imgui_dialog.c.
References context_scale(), ctx, DTTR_ImGui_ApplyWindowDesktopScale(), DTTR_ImGui_GetCurrentDesktopScale(), DTTR_ImGui_ScaleChanged(), and resize_dialog_window_for_scale().
Referenced by dttr_config_main(), DTTR_ImGui_ErrorShow(), DTTR_LoaderUI_ChooseGameSource(), and init_dialog_imgui().
| void DTTR_ImGuiDialog_Render | ( | DTTR_ImGuiDialogContext * | ctx | ) |
Definition at line 221 of file imgui_dialog.c.
References ctx, and use_dialog_imgui_context().
Referenced by dttr_config_main(), DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().
| float DTTR_ImGuiDialog_ScaledFloat | ( | const DTTR_ImGuiDialogContext * | ctx, |
| float | value ) |
Definition at line 33 of file imgui_dialog.c.
References context_scale(), and ctx.
Referenced by add_scaled_vertical_spacing(), append_table_header_text(), begin_padded_panel(), button_row_width(), button_size(), button_spacing(), DTTR_ImGui_ErrorShow(), DTTR_ImGuiDialog_Button(), DTTR_ImGuiDialog_DrawPaddedText(), DTTR_ImGuiDialog_FitWindowToContent(), DTTR_ImGuiDialog_OffsetCursorY(), mod_enable_column_width(), path_text_input_width(), same_path_button_row(), scaled_int(), setup_scaled_table_column(), table_cell_padding(), table_input_width(), text_padding_x(), and themed_row_button().
| void DTTR_ImGuiDialog_Shutdown | ( | ) |
Definition at line 204 of file imgui_dialog.c.
References sdl_video_ready.
Referenced by dttr_config_main(), and dttr_launcher_main().