Esempio n. 1
0
void InitButtonsList()
{  
	int i,j,k=0;
	QuickList=List_Create(0,1);
	for(i=0;i<g_iButtonsCount;i++)
	{
		TCHAR* pszBName=NULL;
		ListData* ld=NULL;
		if (!(pszBName=getMenuEntry(i,0,3))) { 
			g_iButtonsCount=i;
			db_set_b(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount);
			break;}

		ld = (ListData *)mir_alloc(sizeof(ListData));
		ButtonsList[i]=ld;
		ld->sl=List_Create(0,1);
		ld->ptszQValue=ld->ptszOPQValue=getMenuEntry(i,0,2);
		ld->ptszButtonName=pszBName;
		ld->dwPos=ld->dwOPPos=i;
		ld->dwOPFlags=0;
		ld->bIsServName=ld->bIsOpServName=getEntryByte(i,0,3);
		for(j=0;;j++)
		{	
			TCHAR* pszEntry=NULL;
			ButtonData *bd=NULL;

			if (!(pszEntry=getMenuEntry(i,j,0)))
				break;

			bd = (ButtonData *)mir_alloc(sizeof(ButtonData));
			memset(bd,0,sizeof(ButtonData));

			bd->dwPos=bd->dwOPPos=j;
			bd->pszName=bd->pszOpName=pszEntry;
			bd->pszValue=bd->pszOpValue=getMenuEntry(i,j,1);
			bd->fEntryType=bd->fEntryOpType=getEntryByte(i,j,1);
			bd->bInQMenu=bd->bOpInQMenu=getEntryByte(i,j,0);
			bd->bIsServName=bd->bIsOpServName=getEntryByte(i,j,2);
			if(bd->bInQMenu){
				QuickData* qd = (QuickData *)mir_alloc(sizeof(QuickData));
				qd->dwPos=k++;
				qd->ptszValue=bd->pszValue;
				qd->ptszValueName=bd->pszName;
				List_InsertPtr(QuickList,qd);
			}
			List_InsertPtr((SortedList*)ld->sl,bd);
		}
	}
}
Esempio n. 2
0
void launchTitleFromMenu(menu_s* m) {
    menuEntry_s* me = getMenuEntry(m, m->selectedEntry);

    if (me) {
        if (me->title_id) {
            if (me->title_id > 0) {
                createTitleInfoFromTitleID(me->title_id, me->mediatype, &target_title);

//                titleInfo_s* ret = NULL;
//                ret = getTitleWithID(&titleBrowser, me->title_id);

//                if (ret) {
//                    target_title = *ret;
                    targetProcessId = -2;
                    exitServices();
                    dieImmediately = true;

                    if (hansTitleBoot) {
                        bootApp("/gridlauncher/hans/hans.3dsx", NULL, HansArg);
                    }

                    else {
                        regionFreeRun2(me->title_id & 0xffffffff, (me->title_id >> 32) & 0xffffffff, me->mediatype, 0x1);
                    }
//                }
            }
        }
        else {
Esempio n. 3
0
void randomiseTheme() {
    buildThemesList();
    int minimum_number = 2;
    int max_number = themesMenu.numEntries - 1;
    int r = rand() % (max_number + 1 - minimum_number) + minimum_number;
    menuEntry_s * randomEntry = getMenuEntry(&themesMenu, r);
    setTheme(randomEntry->executablePath);
}
Esempio n. 4
0
void launchSVDTFromTitleMenu() {
    menuEntry_s* me = getMenuEntry(&titleMenu, titleMenu.selectedEntry);

    if (me) {
        if (me->title_id) {
            if (me->title_id > 0) {
                createTitleInfoFromTitleID(me->title_id, me->mediatype, &target_title);
                targetProcessId = -2;

//                titleInfo_s* ret = NULL;
//                ret = getTitleWithID(&titleBrowser, me->title_id);
//                targetProcessId = -2;
//                target_title = *ret;

                die = true;
            }
        }
    }
}
Esempio n. 5
0
void initConfigMenu() {
    settingsMenuNeedsInit = false;

    settingsMenu.entries=NULL;
    settingsMenu.numEntries=0;
    settingsMenu.selectedEntry=0;
    settingsMenu.scrollLocation=0;
    settingsMenu.scrollVelocity=0;
    settingsMenu.scrollBarSize=0;
    settingsMenu.scrollBarPos=0;
    settingsMenu.scrollTarget=0;
    settingsMenu.atEquilibrium=false;

    if (regionFreeAvailable) {
        addSettingsMenuEntry("Region free loader", "Toggle the region free loader in the main menu grid", (u8*)regionfreeEntry.iconData, &showRegionFree, &settingsMenu, &settingsToggleRegionFree, NULL, NULL);
    }

    addSettingsMenuEntry("Grids", "Various settings to control how the launcher's grids function", (u8*)settingsIconGrid_bin, NULL, &settingsMenu, &settingsSetMenuStatus, &menuStatusGridSettings, NULL);

    addSettingsMenuEntry("App sorting", "Toggle alphabetic sorting in the main menu grid", (u8*)settingsIconAlphaSort_bin, &sortAlpha, &settingsMenu, &settingsToggleSortAlpha, NULL, NULL);

    addSettingsMenuEntry("24 hour clock", "Displays the clock in 24 hour format", (u8*)settingsIconClock24_bin, &clock24, &settingsMenu, &settingsToggleBool, &clock24, NULL);

    addSettingsMenuEntry("Show date", "Displays the date on the status bar", (u8*)settingsIconShowDate_bin, &showDate, &settingsMenu, &settingsToggleBool, &showDate, NULL);

    addSettingsMenuEntry("Background title loading", "Load title menu entries in the background. Loading begins when the title menu is opened. May be unstable with many titles", (u8*)settingsIconPreloadTitles_bin, &preloadTitles, &settingsMenu, &settingsToggleBool, &preloadTitles, NULL);

    addSettingsMenuEntry("Theme settings", "Configure the theme for the launcher", (u8*)settingsIconTheme_bin, false, &settingsMenu, &settingsSetMenuStatus, &menuStatusThemeSettings, NULL);

    addSettingsMenuEntry("Title filtering", "Show or hide system titles from the title launcher and save manager", (u8*)helpIconIgnoredTitles_bin, false, &settingsMenu, &settingsSetMenuStatus, &menuStatusOpenTitleFiltering, NULL);



    if (fileExists("/gridlauncher/update/mglupdate.3dsx", &sdmcArchive) && fileExists("/gridlauncher/update/index.lua", &sdmcArchive)) {
        addSettingsMenuEntry("Software update", "Update Gridlauncher to the latest version", (u8*)settingsIconUpdate_bin, false, &settingsMenu, &startUpdate, NULL, NULL);

        menuEntry_s *updateEntry = getMenuEntry(&settingsMenu, settingsMenu.numEntries-1);

        strcpy(updateEntry->author, "By ihaveamac on GBATemp");
    }

    addSettingsMenuEntry("HANS title booting", "Boot titles using HANS rather than Region4. Press SELECT with an app highlighted to manually override this setting.", (u8*)settingsIconHansTitleBooting_bin, &hansTitleBoot, &settingsMenu, &toggleHansBoot, NULL, NULL);
}
Esempio n. 6
0
void handleSettingsMenuSelection(menu_s *m) {
    int selectedEntry = m->selectedEntry;
    menuEntry_s * selectedMenuEntry = getMenuEntry(m, selectedEntry);
    (selectedMenuEntry->callback)(selectedMenuEntry->callbackObject1);
}