7static const char *
MODDING_WARNING_TEXT =
"The DttR modding API is currently experimental and may change "
10#define DTTR_CONFIG_UI_MOD_ENABLE_W 4.0f
18 return igGetFrameHeight()
28 memset(out, 0,
sizeof(*out));
34 char search_pattern[MAX_PATH];
35 const int written = snprintf(
37 sizeof(search_pattern),
41 if (written <= 0 || (
size_t)written >=
sizeof(search_pattern)) {
45 WIN32_FIND_DATAA find_data;
46 HANDLE find_handle = FindFirstFileA(search_pattern, &find_data);
47 if (find_handle == INVALID_HANDLE_VALUE) {
52 if ((find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
70 }
while (FindNextFileA(find_handle, &find_data));
72 FindClose(find_handle);
77 | ImGuiTableFlags_NoPadOuterX;
78 if (!igBeginTable(
"##modding_mod_table", 2,
flags, (ImVec2_c){0.0f, 0.0f}, 0.0f)) {
84 ImGuiTableColumnFlags_WidthFixed,
88 igTableSetupColumn(
"DLL", ImGuiTableColumnFlags_WidthStretch, 0.0f, 0);
103 igPushID_Int(row_index);
104 const bool changed = igCheckbox(
"##mod_enabled", &enabled);
114 igBeginDisabled(!enabled);
115 igTextUnformatted(mod_name,
NULL);
121 igSeparatorText(
"Mods");
133 "##modding_settings_table",
143 &
state->config.hot_reload,
154 if (mods.
count == 0) {
156 "No mod DLLs found in %s",
166 for (
int i = 0; i < mods.
count; i++) {
const DTTR_BackendState * state
DTTR_Graphics_COM_Direct3DDevice7 void DWORD flags DWORD void DWORD flags
DTTR_Graphics_COM_DirectDrawSurface7 DWORD flags void NULL
#define DTTR_MODS_SHADOW_PREFIX
bool DTTR_Config_SetModEnabled(DTTR_Config *config, const char *mod_filename, bool enabled)
bool DTTR_Config_IsModDisabled(const DTTR_Config *config, const char *mod_filename)
#define DTTR_CONFIG_DISABLED_MODS_MAX
float DTTR_ImGuiDialog_ScaledFloat(const DTTR_ImGuiDialogContext *ctx, float value)
bool DTTR_Path_CopyString(char *out, size_t out_size, const char *value)
bool labeled_checkbox(const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, bool *value, const char *tooltip, config_label_state label_state)
void show_tooltip(const char *text)
void add_scaled_vertical_spacing(const DTTR_ImGuiDialogContext *ctx, float height)
#define DTTR_CONFIG_UI_SECTION_SPACING
void begin_config_table_row()
void end_settings_table()
#define DTTR_CONFIG_UI_WARNING_TEXT_COLOR
#define FIELD_LABEL_STATE(state, field)
#define DTTR_CONFIG_UI_INPUT_W
bool begin_tab_settings_table(const DTTR_ImGuiDialogContext *ctx, const char *id, float input_width)
#define CONFIG_TABLE_FLAGS
void set_status(config_ui_state *state, const char *status)
#define DTTR_CONFIG_UI_MOD_ENABLE_W
static bool is_shadow_mod_dll(const char *filename)
static bool begin_mod_table(const DTTR_ImGuiDialogContext *ctx)
static void scan_mod_dlls(const config_ui_state *state, config_mod_dll_list *out)
static float mod_enable_column_width(const DTTR_ImGuiDialogContext *ctx)
static void draw_mod_section_header(const DTTR_ImGuiDialogContext *ctx)
static const char * MODDING_WARNING_TEXT
static const char * TOOLTIP_MOD_ENABLE
static void draw_mod_toggle_row(const DTTR_ImGuiDialogContext *ctx, config_ui_state *state, const char *mod_name, int row_index)
void draw_modding_tab(const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)
static const char * TOOLTIP_HOT_RELOAD
char names[DTTR_CONFIG_DISABLED_MODS_MAX][MAX_PATH]