mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-06 07:38:05 -04:00
config: save disabled options also
Pandora uses disabled menu options to store the layer position (mee_range_hide() menu entries) and actually modifies them using a special menu handler.
This commit is contained in:
parent
82f97f10a1
commit
70db485b44
1 changed files with 6 additions and 3 deletions
|
@ -118,7 +118,7 @@ int config_write(const char *fname)
|
||||||
for (me = me_list_get_first(); me != NULL; me = me_list_get_next())
|
for (me = me_list_get_first(); me != NULL; me = me_list_get_next())
|
||||||
{
|
{
|
||||||
int dummy;
|
int dummy;
|
||||||
if (!me->need_to_save || !me->enabled)
|
if (!me->need_to_save)
|
||||||
continue;
|
continue;
|
||||||
if (me->name == NULL || me->name[0] == 0)
|
if (me->name == NULL || me->name[0] == 0)
|
||||||
continue;
|
continue;
|
||||||
|
@ -129,8 +129,10 @@ int config_write(const char *fname)
|
||||||
else if (me->beh == MB_OPT_RANGE || me->beh == MB_OPT_CUSTRANGE) {
|
else if (me->beh == MB_OPT_RANGE || me->beh == MB_OPT_CUSTRANGE) {
|
||||||
fprintf(fn, "%s = %i" NL, me->name, *(int *)me->var);
|
fprintf(fn, "%s = %i" NL, me->name, *(int *)me->var);
|
||||||
}
|
}
|
||||||
else if (me->beh == MB_OPT_ENUM && me->data != NULL) {
|
else if (me->beh == MB_OPT_ENUM) {
|
||||||
const char **names = (const char **)me->data;
|
const char **names = (const char **)me->data;
|
||||||
|
if (names == NULL)
|
||||||
|
continue;
|
||||||
for (t = 0; names[t] != NULL; t++) {
|
for (t = 0; names[t] != NULL; t++) {
|
||||||
if (*(int *)me->var == t) {
|
if (*(int *)me->var == t) {
|
||||||
strncpy(line, names[t], sizeof(line)-1);
|
strncpy(line, names[t], sizeof(line)-1);
|
||||||
|
@ -145,7 +147,8 @@ int config_write(const char *fname)
|
||||||
goto write_line;
|
goto write_line;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lprintf("config: unhandled write: %i\n", me->id);
|
lprintf("config: unhandled write: '%s' id %d behavior %d\n",
|
||||||
|
me->name, me->id, me->beh);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
write_line:
|
write_line:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue