Added sc style input boxes

This commit is contained in:
jsalmon3 2003-02-03 05:17:03 +00:00
parent afe561d8f4
commit b9abe67274

View file

@ -778,7 +778,8 @@ local void DrawGem(Menuitem *mi, int mx, int my)
*/
local void DrawInput(Menuitem *mi, int mx, int my)
{
int nc, rc;
int nc;
int rc;
char *text;
unsigned flags;
MenuButtonId rb;
@ -786,6 +787,7 @@ local void DrawInput(Menuitem *mi, int mx, int my)
int h;
int x;
int y;
int p;
flags = mi->flags;
rb = mi->d.input.button;
@ -795,6 +797,22 @@ local void DrawInput(Menuitem *mi, int mx, int my)
h = mi->d.input.ysize;
GetDefaultTextColors(&nc, &rc);
if (mi->d.input.button == MBUTTON_SC_PULLDOWN) {
rb = MBUTTON_SC_INPUT;
if (flags&MenuButtonDisabled) {
rb -= 3;
SetDefaultTextColors(FontGrey,FontGrey);
}
VideoDraw(MenuButtonGfx.Sprite, rb - 1, x, y);
for (p = x+16; p < x+w-1-16; p += 16) {
VideoDraw(MenuButtonGfx.Sprite, rb, p, y);
}
VideoDraw(MenuButtonGfx.Sprite, rb + 1, x + w-1 - 16, y);
text = mi->d.input.buffer;
if (text) {
VideoDrawText(x+4,y+2,mi->font,text);
}
} else {
if (flags&MenuButtonDisabled) {
rb--;
SetDefaultTextColors(FontGrey,FontGrey);
@ -815,6 +833,7 @@ local void DrawInput(Menuitem *mi, int mx, int my)
VideoDrawRectangleClip(ColorYellow,x-2,y-2,w+4,h);
}
}
}
SetDefaultTextColors(nc,rc);
}