uniblock: adapt to ncmenu

pull/344/head
nick black 5 years ago committed by Nick Black
parent 1fc5afbe8d
commit b56e597bb8

@ -177,8 +177,8 @@ eagles(struct notcurses* nc){
continue;
}
e[i].yoff += random() % (2 + i) - 1;
if(e[i].yoff < 0){
e[i].yoff = 0;
if(e[i].yoff < 1){
e[i].yoff = 1;
}else if(e[i].yoff + height >= truey){
e[i].yoff = truey - height - 1;
}

@ -300,12 +300,13 @@ ncreel_demo_core(struct notcurses* nc, int efdr, int efdw){
fprintf(stderr, "Error creating ncreel\n");
return -1;
}
int dimy = ncplane_dim_y(w);
// Press a for a new nc above the current, c for a new one below the
// current, and b for a new block at arbitrary placement.
ncplane_styles_on(w, NCSTYLE_BOLD | NCSTYLE_ITALIC);
ncplane_set_fg_rgb(w, 58, 150, 221);
ncplane_set_bg_default(w);
ncplane_printf_yx(w, 1, 1, "a, b, c create tablets, DEL deletes.");
ncplane_printf_yx(w, dimy - 1, 1, "a, b, c create tablets, DEL deletes.");
ncplane_styles_off(w, NCSTYLE_BOLD | NCSTYLE_ITALIC);
// FIXME clrtoeol();
struct timespec deadline;
@ -314,7 +315,6 @@ ncreel_demo_core(struct notcurses* nc, int efdr, int efdw){
&deadline);
unsigned id = 0;
struct tabletctx* newtablet;
int dimy = ncplane_dim_y(w);
// Make an initial number of tablets suitable for the screen's height
while(id < dimy / 8u){
newtablet = new_tabletctx(pr, &id);
@ -330,7 +330,7 @@ ncreel_demo_core(struct notcurses* nc, int efdr, int efdw){
ncplane_set_fg_rgb(w, 197, 15, 31);
int count = ncreel_tabletcount(pr);
ncplane_styles_on(w, NCSTYLE_BOLD);
ncplane_printf_yx(w, 2, 2, "%d tablet%s", count, count == 1 ? "" : "s");
ncplane_printf_yx(w, dimy - 2, 2, "%d tablet%s", count, count == 1 ? "" : "s");
ncplane_styles_off(w, NCSTYLE_BOLD);
// FIXME wclrtoeol(w);
ncplane_set_fg_rgb(w, 0, 55, 218);

@ -66,8 +66,8 @@ slideitslideit(struct notcurses* nc, struct ncplane* n, uint64_t deadline,
}
yoff += *vely;
xoff += *velx;
if(xoff <= 0){
xoff = 0;
if(xoff <= 1){
xoff = 1;
*velx = -*velx;
}else if(xoff >= dimx - nx){
xoff = dimx - nx - 1;

@ -518,7 +518,7 @@ int witherworm_demo(struct notcurses* nc){
if(math == NULL){
return -1;
}
struct ncplane* mess = ncplane_new(nc, 7, 57, 1, 4, NULL);
struct ncplane* mess = ncplane_new(nc, 7, 57, 2, 4, NULL);
if(mess == NULL){
return -1;
}

Loading…
Cancel
Save