| 30 | } |
| 31 | |
| 32 | void showmenu(const char *name, bool top) |
| 33 | { |
| 34 | menurighttabwidth = max(VIRTW/4, 15 * text_width("w")); // adapt to screen and font size every time a menu opens |
| 35 | if(!name) |
| 36 | { |
| 37 | setcurmenu(NULL); |
| 38 | return; |
| 39 | } |
| 40 | gmenu *m = menus.access(name); |
| 41 | if(!m) return; |
| 42 | if(!top && curmenu) |
| 43 | { |
| 44 | if(curmenu==m) return; |
| 45 | loopv(menustack) if(menustack[i]==m) return; |
| 46 | menustack.insert(0, m); |
| 47 | return; |
| 48 | } |
| 49 | menuset(m); |
| 50 | } |
| 51 | |
| 52 | void closemenu(const char *name) |
| 53 | { |
no test coverage detected