This commit is contained in:
MysterD 2022-06-05 19:22:11 -07:00
parent defb1d43d7
commit e621b2f370
2 changed files with 3 additions and 8 deletions

View File

@ -29,15 +29,11 @@ void djui_panel_controls_create(struct DjuiBase* caller) {
struct DjuiCheckbox* checkboxGB = djui_checkbox_create(&body->base, "Background Gamepad (must restart)", &configBackgroundGamepad);
djui_base_set_size_type(&checkboxGB->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&checkboxGB->base, 1.0f, 32);
// djui_interactable_hook_value_change(&checkboxGB->base, djui_panel_display_uncapped_change);
int numJoys = SDL_NumJoysticks();
if (numJoys == 0) { numJoys = 1; }
if (numJoys > 100) { numJoys = 100; }
if (numJoys > 10) { numJoys = 10; }
int strSize = numJoys * 2;
if (numJoys > 10) {
strSize += (numJoys - 10);
}
char* gamepadChoices[numJoys];
char gamepadChoicesLong[strSize];
for (int i = 0; i < numJoys; i++) {
@ -45,10 +41,9 @@ void djui_panel_controls_create(struct DjuiBase* caller) {
if (i > 9) {
index += (i - 9);
}
sprintf(&gamepadChoicesLong[index], "%d\0", i);
sprintf(&gamepadChoicesLong[index], "%d", i);
gamepadChoices[i] = &gamepadChoicesLong[index];
}
// char* gamepadChoices[16] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"};
struct DjuiSelectionbox* selectionboxGamepad = djui_selectionbox_create(&body->base, "Gamepad", gamepadChoices, numJoys, &configGamepadNumber);
djui_base_set_size_type(&selectionboxGamepad->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&selectionboxGamepad->base, 1.0f, 32);

View File

@ -23,7 +23,7 @@ static void playerlist_update_row(u8 i, struct NetworkPlayer *np) {
if (np->currActNum != 99 && np->currActNum != 0) {
snprintf(sActNum, 7, "# %d", np->currActNum);
} else if (np->currActNum == 0) {
snprintf(sActNum, 7, "");
snprintf(sActNum, 7, " ");
} else {
snprintf(sActNum, 7, "Done");
}