MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / menuToggleStar

Function menuToggleStar

source/menu-list.c:207–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void menuToggleStar(menuEntry_s* me)
208{
209 me->isStarred = !me->isStarred;
210 if (me->isStarred)
211 {
212 FILE* f = fopen(me->starpath, "w");
213 if (f) fclose(f);
214 } else
215 remove(me->starpath);
216
217 // Sort the menu again
218 s_curMenu = !s_curMenu;
219 menuSort();
220 s_curMenu = !s_curMenu;
221 menuClear();
222
223 menu_s* menu = menuGetCurrent();
224 int pos = -1;
225 for (menuEntry_s* cur = menu->firstEntry; cur; cur = cur->next)
226 {
227 ++pos;
228 if (cur == me)
229 break;
230 }
231 menu->curEntry = pos;
232 menu->perturbed = true;
233}

Callers 1

toggleStarTaskFunction · 0.85

Calls 3

menuSortFunction · 0.85
menuClearFunction · 0.85
menuGetCurrentFunction · 0.85

Tested by

no test coverage detected