Index: edit.c ================================================================== --- edit.c +++ edit.c @@ -380,10 +380,11 @@ int imgscroll=0; int clcount=0; int imgcount=0; int cl=0; int img=0; + char re=0; Uint16 cllist[0x4000]; Uint8 imglist[256]; char name[256]; int namei=0; char buf[4]; @@ -406,20 +407,28 @@ r.h=8; SDL_LockSurface(screen); for(i=0;ih/8;i++) { if(i+clscroll>=clcount) break; j=cllist[i+clscroll]; - if(j==cl) SDL_FillRect(screen,&r,0xF3); + if(j==cl) SDL_FillRect(screen,&r,0xF3),re=0; draw_text(r.x,r.y,classes[j]->name,j==cl?0xF3:0xF1,classes[j]->cflags&CF_PLAYER?0xFE:0xFF); if(j==cl && namei) { memcpy(name,classes[j]->name,namei); name[namei]=0; draw_text(r.x,r.y,name,0xF4,classes[j]->cflags&CF_PLAYER?0xFE:0xFF); } r.y+=8; } SDL_UnlockSurface(screen); + if(re && cl) { + for(i=0;ii?0:1-screen->h/8); + break; + } + re=0; + goto redraw; + } scrollbar(&imgscroll,screen->h/picture_size,imgcount,0,0); r.x=14; r.y=0; r.w=r.h=picture_size; for(i=0;ih/picture_size;i++) { @@ -460,10 +469,11 @@ cl=cllist[i]; setclass: imgscroll=imgcount=0; for(i=0;inimages;i++) if(classes[cl]->images[i]&0x8000) imglist[imgcount++]=i; img=*imglist; + re=1; } else { i=imgscroll+ev.button.y/picture_size; if(i<0 || i>=imgcount) break; img=imglist[i]; } @@ -474,10 +484,12 @@ switch(ev.key.keysym.sym) { case SDLK_HOME: case SDLK_KP7: clscroll=0; goto redraw; case SDLK_END: case SDLK_KP1: clscroll=clcount-screen->h/8; goto redraw; case SDLK_PAGEDOWN: case SDLK_KP3: clscroll+=screen->h/8; goto redraw; case SDLK_PAGEUP: case SDLK_KP9: clscroll-=screen->h/8; goto redraw; + case SDLK_KP_PLUS: clscroll++; goto redraw; + case SDLK_KP_MINUS: clscroll--; goto redraw; case SDLK_ESCAPE: return; case SDLK_CLEAR: case SDLK_DELETE: case SDLK_KP_PERIOD: namei=0; goto redraw; case SDLK_BACKSPACE: if(namei) --namei; goto redraw; case SDLK_TAB: if(!cl) break; @@ -503,16 +515,18 @@ } goto redraw; case SDLK_LEFT: case SDLK_KP4: for(i=0;ii) imgscroll=i; goto redraw; } break; case SDLK_RIGHT: case SDLK_KP6: for(i=0;ih/picture_size) imgscroll=i+2-screen->h/picture_size; goto redraw; } break; case SDLK_UP: case SDLK_KP8: namei=0;