8#define DTTR_LOADER_UI_WINDOW_W 560
9#define DTTR_LOADER_UI_WINDOW_H 190
10#define DTTR_LOADER_UI_BUTTON_W 160.0f
11#define DTTR_LOADER_UI_BUTTON_H 28.0f
12#define DTTR_LOADER_UI_BUTTON_SPACING 8.0f
13#define DTTR_LOADER_UI_TEXT_PADDING_X 18.0f
14#define DTTR_LOADER_UI_TEXT_PADDING_Y 16.0f
17#define DTTR_VERSION "unknown"
21static const char *
const HEADER_TITLE =
"102 Patches: Detours to the Rescue!";
23 =
"Select either a directory containing the 102 Dalmatians: Puppies to the Rescue "
24 "files, the original game disc, or an ISO image.";
28 const SDL_MessageBoxButtonData buttons[] = {
30 {SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT,
35 const SDL_MessageBoxData msgbox = {
36 .flags = SDL_MESSAGEBOX_INFORMATION,
57 if (button_count == 0) {
62 return (button_width * (
float)button_count)
97 igPushID_Int((
int)disc_index);
101 disc_candidates[disc_index].label,
119 return disc_candidate_count;
152 size_t disc_candidate_count,
156 size_t disc_index = 0;
157 const size_t first_row_buttons = disc_candidate_count > 0 ? 3 : 2;
160 if (disc_candidate_count > 0) {
167 while (disc_index < disc_candidate_count && *running) {
168 const size_t remaining = disc_candidate_count - disc_index;
169 const size_t row_count = remaining < 3 ? remaining : 3;
172 for (
size_t col = 0; col < row_count && *running; col++, disc_index++) {
184 size_t disc_candidate_count
197 disc_candidate_count = disc_candidates
220 disc_candidate_count,
238 const char *safe_message = message ? message :
"";
DTTR_Graphics_COM_Direct3DDevice7 DWORD block DTTR_Graphics_COM_Direct3DDevice7 DWORD block DTTR_Graphics_COM_Direct3DDevice7 void void void void DWORD f DTTR_Graphics_COM_Direct3DDevice7 DWORD idx float
DTTR_Graphics_COM_DirectDrawSurface7 DWORD flags void NULL
void DTTR_ImGuiDialog_End(DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_DrawHeader(const DTTR_ImGuiDialogContext *ctx, const char *title, const char *version)
bool DTTR_ImGui_ErrorShow(const char *title, const char *message)
void DTTR_ImGuiDialog_CenterNextItem(float item_width)
void DTTR_ImGuiDialog_Render(DTTR_ImGuiDialogContext *ctx)
bool DTTR_ImGuiDialog_RefreshScale(DTTR_ImGuiDialogContext *ctx)
bool DTTR_ImGuiDialog_BeginRoot(DTTR_ImGuiDialogContext *ctx, const char *title, ImGuiWindowFlags flags)
float DTTR_ImGuiDialog_ScaledFloat(const DTTR_ImGuiDialogContext *ctx, float value)
void DTTR_ImGuiDialog_DrawPaddedText(const DTTR_ImGuiDialogContext *ctx, const char *message, float padding_x, float padding_y)
void DTTR_ImGuiDialog_ProcessEvents(const DTTR_ImGuiDialogContext *ctx, bool *running)
bool DTTR_ImGuiDialog_Button(const DTTR_ImGuiDialogContext *ctx, const char *id, const char *label, ImVec2_c size)
void DTTR_ImGuiDialog_EndRoot()
void DTTR_ImGuiDialog_NewFrame(const DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_FitWindowToContent(DTTR_ImGuiDialogContext *ctx, int width, float padding_y)
bool DTTR_ImGuiDialog_Begin(DTTR_ImGuiDialogContext *ctx, const char *title, int width, int height)
@ DTTR_LOADER_UI_MAX_DISC_CANDIDATES
DTTR_LoaderUIChoice DTTR_LoaderUI_ChoiceFromID(int choice_id)
@ DTTR_LOADER_UI_CHOICE_BROWSE_ISO
@ DTTR_LOADER_UI_CHOICE_BROWSE_FOLDER
@ DTTR_LOADER_UI_CHOICE_EXIT
DTTR_LoaderUIChoice DTTR_LoaderUI_DiscChoiceForIndex(size_t index)
bool DTTR_SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
bool DTTR_SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window)
static const char *const HEADER_TITLE
static const char *const ERROR_TITLE
static float button_spacing(const DTTR_ImGuiDialogContext *ctx)
DTTR_LoaderUIChoice DTTR_LoaderUI_ChooseGameSource(const DTTR_LoaderUIDiscCandidate *disc_candidates, size_t disc_candidate_count)
static bool draw_disc_button(const DTTR_ImGuiDialogContext *ctx, size_t disc_index, const DTTR_LoaderUIDiscCandidate *disc_candidates, DTTR_LoaderUIChoice *result, bool *running)
static void draw_browse_buttons(const DTTR_ImGuiDialogContext *ctx, DTTR_LoaderUIChoice *result, bool *running)
#define DTTR_LOADER_UI_BUTTON_W
static void draw_source_buttons(const DTTR_ImGuiDialogContext *ctx, const DTTR_LoaderUIDiscCandidate *disc_candidates, size_t disc_candidate_count, DTTR_LoaderUIChoice *result, bool *running)
static float button_row_width(const DTTR_ImGuiDialogContext *ctx, size_t button_count)
static size_t clamp_disc_candidate_count(size_t disc_candidate_count)
#define DTTR_LOADER_UI_WINDOW_W
#define DTTR_LOADER_UI_BUTTON_H
#define DTTR_LOADER_UI_TEXT_PADDING_Y
static const char *const GAME_SOURCE_MESSAGE
#define DTTR_LOADER_UI_BUTTON_SPACING
#define DTTR_LOADER_UI_TEXT_PADDING_X
static void same_button_row(const DTTR_ImGuiDialogContext *ctx)
static ImVec2_c button_size(const DTTR_ImGuiDialogContext *ctx)
static bool draw_source_button(const DTTR_ImGuiDialogContext *ctx, const char *id, const char *label, DTTR_LoaderUIChoice choice, DTTR_LoaderUIChoice *result, bool *running)
static const char *const WINDOW_TITLE
void DTTR_LoaderUI_ShowError(const char *title, const char *message)
static DTTR_LoaderUIChoice native_choose_game_source()
#define DTTR_LOADER_UI_WINDOW_H