Esempio n. 1
0
int DrawYesNoDialog(char *message) {
	int sel = 0;
	while ((PAD_ButtonsHeld(0) & PAD_BUTTON_A)){ VIDEO_WaitVSync (); }
	while(1) {
		doBackdrop();
		DrawEmptyBox(75,190, vmode->fbWidth-78, 330, COLOR_BLACK);
		WriteFontStyled(640/2, 215, message, 1.0f, true, defaultColor);
		DrawSelectableButton(100, 280, -1, 310, "Yes", (sel==1) ? B_SELECTED:B_NOSELECT,-1);
		DrawSelectableButton(380, 280, -1, 310, "No", (!sel) ? B_SELECTED:B_NOSELECT,-1);
		DrawFrameFinish();
		while (!(PAD_ButtonsHeld(0) & PAD_BUTTON_RIGHT) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_LEFT) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_B)&& !(PAD_ButtonsHeld(0) & PAD_BUTTON_A))
			{ VIDEO_WaitVSync (); }
		u16 btns = PAD_ButtonsHeld(0);
		if((btns & PAD_BUTTON_RIGHT) || (btns & PAD_BUTTON_LEFT)) {
			sel^=1;
		}
		if((btns & PAD_BUTTON_A) || (btns & PAD_BUTTON_B))
			break;
		while (!(!(PAD_ButtonsHeld(0) & PAD_BUTTON_RIGHT) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_LEFT) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_B) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_A)))
			{ VIDEO_WaitVSync (); }
	}
	while ((PAD_ButtonsHeld(0) & PAD_BUTTON_A)){ VIDEO_WaitVSync (); }
	return sel;
} 
Esempio n. 2
0
void settings_draw_page(int page_num, int option, file_handle *file) {
    doBackdrop();
    DrawEmptyBox(20,60, vmode->fbWidth-20, 460, COLOR_BLACK);

    // Save Settings to current device (**Shown on all tabs**)
    /** Global Settings (Page 1/) */
    // IPL/Game Language [English/German/French/Spanish/Italian/Dutch]
    // IPL/Game Audio [Mono/Stereo]
    // SD/IDE Speed [16/32 MHz]
    // Swiss Video Mode [576i (PAL 50Hz), 480i (NTSC 60Hz), 480p (NTSC 60Hz)]
    // Stop DVD Motor on startup [Yes/No]

    /** Advanced Settings (Page 2/) */
    // Enable USB Gecko Debug via Slot B [Yes/No]
    // Force No DVD Drive Mode [Yes/No]
    // Hide Unknown file types [Yes/No]	// TO BE IMPLEMENTED

    /** Current Game Settings - only if a valid GCM file is highlighted (Page 3/) */
    // Force Video Mode [576i (PAL 50Hz), 480i (NTSC 60Hz), 480p (NTSC 60Hz), Auto]
    // Mute Audio Streaming [Yes/No]
    // Try to mute audio stutter [Yes/No]

    if(!page_num) {
        WriteFont(30, 65, "Global Settings (1/3):");
        WriteFontStyled(30, 120, "IPL/Game Language:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 120, -1, 150, getSramLang(swissSettings.sramLanguage), option == 0 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 160, "IPL/Game Audio:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 160, -1, 190, swissSettings.sramStereo ? "Stereo":"Mono", option == 1 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 200, "SD/IDE Speed:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 200, -1, 230, swissSettings.exiSpeed ? "32 MHz":"16 MHz", option == 2 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 240, "Swiss Video Mode:", 1.0f, false, defaultColor);
        DrawSelectableButton(400, 240, -1, 270, uiVModeStr[swissSettings.uiVMode], option == 3 ? B_SELECTED:B_NOSELECT,-1);
    }
    else if(page_num == 1) {
        WriteFont(30, 65, "Advanced Settings (2/3):");
        WriteFontStyled(30, 120, "Enable USB Gecko Debug via Slot B:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 120, -1, 150, swissSettings.debugUSB ? "Yes":"No", option == 0 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 160, "Force No DVD Drive Mode:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 160, -1, 190, swissSettings.hasDVDDrive ? "No":"Yes", option == 1 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 200, "Hide Unknown file types:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 200, -1, 230, swissSettings.hideUnknownFileTypes ? "Yes":"No", option == 2 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 240, "Stop DVD Motor on startup:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 240, -1, 270, swissSettings.stopMotor ? "Yes":"No", option == 3 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 280, "Enable WiiRD debugging in Games:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 280, -1, 310, swissSettings.wiirdDebug ? "Yes":"No", option == 4 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 320, "Enable File Management:", 1.0f, false, defaultColor);
        DrawSelectableButton(500, 320, -1, 350, swissSettings.enableFileManagement ? "Yes":"No", option == 5 ? B_SELECTED:B_NOSELECT,-1);
    }
    else if(page_num == 2) {
        WriteFont(30, 65, "Current Game Settings (3/3):");
        WriteFontStyled(30, 110, "Force Video Mode:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 110, -1, 135, gameVModeStr[swissSettings.gameVMode], option == 0 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 140, "If Progressive, Soften:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 140, -1, 165, softProgressiveStr[swissSettings.softProgressive], option == 1 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 170, "Force Widescreen:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 170, -1, 195, forceWidescreenStr[swissSettings.forceWidescreen], option == 2 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 200, "Force Anisotropy:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 200, -1, 225, swissSettings.forceAnisotropy ? "Yes":"No", option == 3 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 230, "Disable Audio Streaming:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 230, -1, 255, swissSettings.muteAudioStreaming ? "Yes":"No", option == 4 ? B_SELECTED:B_NOSELECT,-1);
        WriteFontStyled(30, 260, "Force Encoding:", 1.0f, false, file != NULL ? defaultColor : disabledColor);
        DrawSelectableButton(480, 260, -1, 285, forceEncodingStr[swissSettings.forceEncoding], option == 5 ? B_SELECTED:B_NOSELECT,-1);
    }
    if(page_num != 0) {
        DrawSelectableButton(40, 390, -1, 420, "Back",
                             option == settings_count_pp[page_num]-(page_num != 2 ? 3:2) ? B_SELECTED:B_NOSELECT,-1);
    }
    if(page_num != 2) {
        DrawSelectableButton(510, 390, -1, 420, "Next",
                             option == settings_count_pp[page_num]-2 ? B_SELECTED:B_NOSELECT,-1);
    }
    DrawSelectableButton(100, 425, -1, 455, "Save & Exit", option == settings_count_pp[page_num]-1 ? B_SELECTED:B_NOSELECT,-1);
    DrawSelectableButton(320, 425, -1, 455, "Discard & Exit", option ==  settings_count_pp[page_num] ? B_SELECTED:B_NOSELECT,-1);
    DrawFrameFinish();
}