Skip to content

Commit

Permalink
Merge pull request #270 from KrahJohlito/this-time
Browse files Browse the repository at this point in the history
Small Update...
  • Loading branch information
ElPatas1 authored May 23, 2020
2 parents 50a93d3 + 598944b commit a5dd73a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
12 changes: 7 additions & 5 deletions misc/conf_theme_OPL.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ main1:
type=ItemsList
x=42
y=42
width=350
width=400
height=306
main2:
type=MenuIcon
Expand All @@ -22,7 +22,7 @@ main3:
main4:
type=ItemCover
default=cover
x=-122
x=-102
y=-295
overlay=case
overlay_ulx=49
Expand All @@ -36,15 +36,16 @@ main4:
main5:
type=ItemIcon
default=disc
x=-185
x=-165
y=-207
main6:
type=ItemText
x=-129
x=-109
y=-145
main7:
type=HintText
aligned=1
x=POS_MID
main8:
type=LoadingIcon
y=-80
Expand Down Expand Up @@ -157,4 +158,5 @@ info16:
height=148
info17:
type=InfoHintText
aligned=1
aligned=1
x=POS_MID
6 changes: 3 additions & 3 deletions src/themes.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ static int addGUIElem(const char *themePath, config_set_t *themeConfig, theme_t
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_MENU_ICON, screenWidth >> 1, 400, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]);
elem->drawElem = &drawMenuIcon;
} else if (!strcmp(elementsType[ELEM_TYPE_MENU_TEXT], type)) {
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_MENU_TEXT, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, theme->fonts[0]);
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_MENU_TEXT, screenWidth >> 1, 20, ALIGN_CENTER, 200, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]);
elem->drawElem = &drawMenuText;
} else if (!strcmp(elementsType[ELEM_TYPE_ITEMS_LIST], type)) {
if (!theme->itemsList) {
Expand All @@ -972,10 +972,10 @@ static int addGUIElem(const char *themePath, config_set_t *themeConfig, theme_t
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_ITEM_TEXT, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, theme->fonts[0]);
elem->drawElem = &drawItemText;
} else if (!strcmp(elementsType[ELEM_TYPE_HINT_TEXT], type)) {
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_HINT_TEXT, screenWidth >> 1, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]);
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_HINT_TEXT, 16, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]);
elem->drawElem = &drawHintText;
} else if (!strcmp(elementsType[ELEM_TYPE_INFO_HINT_TEXT], type)) {
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_INFO_HINT_TEXT, screenWidth >> 1, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]);
elem = initBasic(themePath, themeConfig, theme, name, ELEM_TYPE_INFO_HINT_TEXT, 16, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]);
elem->drawElem = &drawInfoHintText;
} else if (!strcmp(elementsType[ELEM_TYPE_LOADING_ICON], type)) {
if (!theme->loadingIcon)
Expand Down
25 changes: 16 additions & 9 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void checkMCFolder(void)

snprintf(path, sizeof(path), "mc%d:OPL", mcID);
DIR *dir = opendir(path);
if (dir != NULL)
if (dir == NULL)
mkdir(path, 0777);
else
closedir(dir);
Expand All @@ -81,22 +81,29 @@ void checkMCFolder(void)

static int checkMC()
{
int dummy, ret, fd;
int fd;

if (mcID == -1) {
mcGetInfo(0, 0, &dummy, &dummy, &dummy);
mcSync(0, NULL, &ret);

DIR *dir = opendir("mc0:OPL");
if (dir == NULL) {
dir = opendir("mc1:OPL");
if (dir == NULL) {
// No base dir found on any MC, check MC is inserted
fd = sysCheckMC();
if (fd == 0)
mcID = 0x30;
else if (fd == 1)
mcID = 0x31;
if (fd >= 0) {
dir = opendir("mc0:");
if (dir != NULL) {
closedir(dir);
mcID = 0x30;
}
else {
dir = opendir("mc1:");
if (dir != NULL) {
closedir(dir);
mcID = 0x31;
}
}
}
} else {
closedir(dir);
mcID = 0x31;
Expand Down

0 comments on commit a5dd73a

Please sign in to comment.