mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
demo: on restart, maintain HUD if up
This commit is contained in:
parent
7120d428e8
commit
636f1ec09b
@ -439,18 +439,27 @@ int main(int argc, char** argv){
|
|||||||
nanosleep(&demodelay, NULL);
|
nanosleep(&demodelay, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// if we're restarted with the HUD up, we want it to seamlessly restart
|
||||||
|
bool start_with_hud = false;
|
||||||
do{
|
do{
|
||||||
restart_demos = false;
|
restart_demos = false;
|
||||||
interrupted = false;
|
interrupted = false;
|
||||||
notcurses_drop_planes(nc);
|
notcurses_drop_planes(nc);
|
||||||
|
if(start_with_hud){
|
||||||
|
if(!hud_create(nc)){
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(menu_create(nc) == NULL){
|
if(menu_create(nc) == NULL){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if(ext_demos(nc, spec, ignore_failures) == NULL){
|
if(ext_demos(nc, spec, ignore_failures) == NULL){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if(hud_destroy()){ // destroy here since notcurses_drop_planes will kill it
|
if( (start_with_hud = !!hud) ){
|
||||||
goto err;
|
if(hud_destroy()){ // destroy here since notcurses_drop_planes will kill it
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}while(restart_demos);
|
}while(restart_demos);
|
||||||
if(stop_input()){
|
if(stop_input()){
|
||||||
|
Loading…
Reference in New Issue
Block a user