102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
ui_logic.c
Go to the documentation of this file.
1#include <dttr_loader_ui.h>
2
7
8bool DTTR_LoaderUI_ChoiceIsDisc(DTTR_LoaderUIChoice choice, size_t *out_index) {
9 const int index = (int)choice - DTTR_LOADER_UI_CHOICE_DISC_BASE;
10 if (index < 0 || index >= DTTR_LOADER_UI_MAX_DISC_CANDIDATES) {
11 return false;
12 }
13
14 if (out_index) {
15 *out_index = (size_t)index;
16 }
17
18 return true;
19}
20
22 const DTTR_LoaderUIChoice choice = (DTTR_LoaderUIChoice)choice_id;
23 if (DTTR_LoaderUI_ChoiceIsBrowse(choice)) {
24 return choice;
25 }
26
27 if (DTTR_LoaderUI_ChoiceIsDisc(choice, NULL)) {
28 return choice;
29 }
30
32}
33
DTTR_Graphics_COM_DirectDrawSurface7 DWORD flags void NULL
@ DTTR_LOADER_UI_MAX_DISC_CANDIDATES
@ DTTR_LOADER_UI_CHOICE_DISC_BASE
DTTR_LoaderUIChoice
@ DTTR_LOADER_UI_CHOICE_BROWSE_ISO
@ DTTR_LOADER_UI_CHOICE_BROWSE_FOLDER
@ DTTR_LOADER_UI_CHOICE_EXIT
bool DTTR_LoaderUI_ChoiceIsBrowse(DTTR_LoaderUIChoice choice)
Definition ui_logic.c:3
DTTR_LoaderUIChoice DTTR_LoaderUI_ChoiceFromID(int choice_id)
Definition ui_logic.c:21
DTTR_LoaderUIChoice DTTR_LoaderUI_DiscChoiceForIndex(size_t index)
Definition ui_logic.c:34
bool DTTR_LoaderUI_ChoiceIsDisc(DTTR_LoaderUIChoice choice, size_t *out_index)
Definition ui_logic.c:8