Skip to content

Commit 86f69fa

Browse files
committed
Merge upstream changes for the first BETA release
1 parent 6a3d785 commit 86f69fa

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

source/cia.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ int displayCIA(const char * path)
331331

332332
sf2d_set_clear_color(RGBA8(245, 245, 245, 255));
333333

334-
int pBar = 34, xlim = 300;
335-
336334
int isInstalling = 0;
337335

338336
Cia cia = getCiaInfo(path, MEDIATYPE_SD);
339337

340338
char size[16];
341339
getSizeString(size, cia.size);
340+
341+
int pBar = 34, xlim = 300;
342342

343343
while (aptMainLoop())
344344
{
@@ -377,7 +377,6 @@ int displayCIA(const char * path)
377377

378378
if (isInstalling == 0)
379379
sftd_draw_text(font, 15, 86, RGBA8(0, 0, 0, 255), 11, "Do you want to install this application?");
380-
381380
else if (isInstalling == 1)
382381
{
383382
sf2d_draw_rectangle(100, 130, 200, 3, RGBA8(185, 224, 220, 255));
@@ -386,26 +385,28 @@ int displayCIA(const char * path)
386385
// Boundary stuff
387386
sf2d_draw_rectangle(0, 130, 100, 3, RGBA8(245, 245, 245, 255));
388387
sf2d_draw_rectangle(300, 130, 66, 3, RGBA8(245, 245, 245, 255));
389-
388+
390389
sftd_draw_text(font, ((400 - sftd_get_text_width(font, 11, "Installing...")) / 2), 146, RGBA8(0, 0, 0, 255), 11, "Installing...");
391-
390+
392391
pBar += 4;
393392

394393
if (pBar >= xlim)
395394
pBar = 34;
395+
396+
isInstalling = installCIA(path, MEDIATYPE_SD, update);
396397
}
397398
else
398399
sftd_draw_text(font, ((400 - sftd_get_text_width(font, 11, "App installed.")) / 2), 146, RGBA8(0, 0, 0, 255), 11, "App installed.");
399400

401+
400402
endDrawing();
401403

402404
if (isInstalling == 0)
403405
{
404406
if (touchInRect((300 - sftd_get_text_width(font, 11, "INSTALL")), 300, 220, 240))
405407
{
408+
wait(100000000);
406409
isInstalling = 1;
407-
isInstalling = installCIA(path, MEDIATYPE_SD, update);
408-
//wait(100000000);
409410
}
410411
else if (touchInRect((300 - (sftd_get_text_width(font, 11, "CANCEL") + sftd_get_text_width(font, 11, "INSTALL") + 20)), ((300 - 20) - sftd_get_text_width(font, 11, "INSTALL")), 220, 240))
411412
{

source/file/dirlist.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ void updateList(int clearindex)
154154
// Attempt to keep Index
155155
if(!clearindex)
156156
{
157-
// Fix Position
158-
if(position >= fileCount) position = fileCount - 1;
157+
if(position >= fileCount)
158+
position = fileCount - 1; // Fix Position
159159
}
160160

161161
// Reset Position
162-
else position = 0;
162+
else
163+
position = 0;
163164
}
164165

165166
void recursiveFree(File * node)
@@ -224,7 +225,7 @@ void displayFiles()
224225
else
225226
sf2d_draw_texture(settingsIcon, 50, 1);
226227

227-
if (DEFAULT_STATE == STATE_UPDATE)
228+
/*if (DEFAULT_STATE == STATE_UPDATE)
228229
{
229230
sf2d_draw_texture(s_UpdateIcon, 75, 0);
230231
sftd_draw_text(font, ((320 - (sftd_get_text_width(font, 11, lang_update[language][0]))) / 2), 40, RGBA8(BottomScreen_text_colour.r, BottomScreen_text_colour.g , BottomScreen_text_colour.b, 255), 11, lang_update[language][0]);
@@ -240,7 +241,7 @@ void displayFiles()
240241
wait(300000000);
241242
longjmp(exitJmp, 1);
242243
}
243-
else
244+
else*/
244245
sf2d_draw_texture(updateIcon, 75, 0);
245246

246247
sf2d_draw_texture(ftpIcon, 100, 0);
@@ -397,7 +398,12 @@ void displayFiles()
397398
else
398399
{
399400
getSizeString(size, getFileSize(sdmcArchive, path));
400-
sftd_draw_textf(font2, 70, 75 + (38 * printed), RGBA8(TopScreen_min_colour.r, TopScreen_min_colour.g, TopScreen_min_colour.b, 255), 10, "%s -rw-rw----", getFileModifiedTime(path));
401+
402+
if (file->isRDONLY)
403+
sftd_draw_textf(font2, 70, 75 + (38 * printed), RGBA8(TopScreen_min_colour.r, TopScreen_min_colour.g, TopScreen_min_colour.b, 255), 10, "%s -r--r-----", getFileModifiedTime(path));
404+
else
405+
sftd_draw_textf(font2, 70, 75 + (38 * printed), RGBA8(TopScreen_min_colour.r, TopScreen_min_colour.g, TopScreen_min_colour.b, 255), 10, "%s -rw-rw----", getFileModifiedTime(path));
406+
401407
sftd_draw_textf(font2, 395 - sftd_get_text_width(font2, 10, size), 75 + (38 * printed), RGBA8(TopScreen_colour.r, TopScreen_colour.g, TopScreen_colour.b, 255), 10, "%s", size);
402408
}
403409

@@ -441,8 +447,6 @@ void openFile(void)
441447
displayImage(path, 1);
442448
else if ((strncmp(file->ext, "gif", 3) == 0) || (strncmp(file->ext, "GIF", 3) == 0))
443449
displayImage(path, 2);
444-
else if ((strncmp(file->ext, "txt", 3) == 0) || (strncmp(file->ext, "TXT", 3) == 0))
445-
displayText(path);
446450
else if ((strncmp(file->ext, "cia", 3) == 0) || (strncmp(file->ext, "CIA", 3) == 0))
447451
displayCIA(path);
448452
else if ((strncmp(file->ext, "zip", 3) == 0) || (strncmp(file->ext, "ZIP", 3) == 0))
@@ -451,6 +455,8 @@ void openFile(void)
451455
updateList(CLEAR);
452456
displayFiles(CLEAR);
453457
}
458+
/*else if ((strncmp(file->ext, "txt", 3) == 0) || (strncmp(file->ext, "TXT", 3) == 0))
459+
displayText(path);*/
454460
}
455461

456462
// Navigate to Folder

source/main.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void initServices()
133133
}
134134

135135
void termServices()
136-
{
136+
{
137137
osSetSpeedupEnable(0);
138138

139139
sftd_free_font(font);
@@ -227,16 +227,17 @@ static loop_status_t loop(loop_status_t (*callback)(void))
227227
sf2d_draw_texture(settingsIcon, 50, 0);
228228
sf2d_draw_texture(updateIcon, 75, 0);
229229
sf2d_draw_texture(s_ftpIcon, 100, 0);
230+
sf2d_draw_texture(dlIcon, 125, 0);
230231

231232
if (BROWSE_STATE == STATE_SD)
232-
sf2d_draw_texture(s_SdIcon, 125, 0);
233+
sf2d_draw_texture(s_SdIcon, 150, 0);
233234
else
234-
sf2d_draw_texture(sdIcon, 125, 0);
235+
sf2d_draw_texture(sdIcon, 150, 0);
235236

236237
if (BROWSE_STATE == STATE_NAND)
237-
sf2d_draw_texture(s_NandIcon, 150, 0);
238+
sf2d_draw_texture(s_NandIcon, 175, 0);
238239
else
239-
sf2d_draw_texture(nandIcon, 150, 0);
240+
sf2d_draw_texture(nandIcon, 175, 0);
240241

241242
sf2d_draw_texture(searchIcon, (320 - searchIcon->width), -2);
242243

@@ -323,13 +324,13 @@ void mainMenu(int clearindex)
323324
wait(100000000);
324325
DEFAULT_STATE = STATE_SETTINGS;
325326
}
326-
else if ((kPressed & KEY_TOUCH) && (touchInRect(74, 97, 0, 20)))
327+
/*else if ((kPressed & KEY_TOUCH) && (touchInRect(74, 97, 0, 20)))
327328
{
328329
wait(100000000);
329330
DEFAULT_STATE = STATE_UPDATE;
330331
}
331332
332-
/*else if ((kPressed & KEY_TOUCH) && (touchInRect(0, 320, 50, 72)) && (IF_SETTINGS))
333+
else if ((kPressed & KEY_TOUCH) && (touchInRect(0, 320, 50, 72)) && (IF_SETTINGS))
333334
{
334335
if (bgmEnable == false)
335336
{
@@ -398,7 +399,7 @@ void mainMenu(int clearindex)
398399
}
399400
}
400401

401-
if ((kPressed & KEY_TOUCH) && (touchInRect(124, 147, 0, 20)))
402+
/*if ((kPressed & KEY_TOUCH) && (touchInRect(124, 147, 0, 20)))
402403
{
403404
wait(100000000);
404405
DEFAULT_STATE = STATE_DOWNLOAD;
@@ -417,7 +418,7 @@ void mainMenu(int clearindex)
417418
418419
if (downloadReady == true)
419420
downloadFile(dl_url, "/");
420-
}
421+
}*/
421422

422423
if ((kPressed & KEY_TOUCH) && (touchInRect(148, 173, 0, 20)))
423424
{

0 commit comments

Comments
 (0)