void Separator_Draw(menuseparator_s * s) { int alpha = mouseOverAlpha(&s->generic); if (s->generic.name) Menu_DrawStringR2LDark(s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, s->generic.name, alpha); }
void SpinControl_Draw (menulist_s *s) { int alpha = mouseOverAlpha (&s->generic); char buffer[100]; if (s->generic.name) { Menu_DrawStringR2LDark (s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, s->generic.name, alpha); } if (!strchr(s->itemnames[s->curvalue], '\n')) { Menu_DrawString (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, s->itemnames[s->curvalue], alpha); } else { // strncpy(buffer, s->itemnames[s->curvalue]); Q_strncpyz(buffer, s->itemnames[s->curvalue], sizeof(buffer)); *strchr(buffer, '\n') = 0; Menu_DrawString (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, buffer, alpha); // strncpy(buffer, strchr( s->itemnames[s->curvalue], '\n' ) + 1 ); Q_strncpyz(buffer, strchr( s->itemnames[s->curvalue], '\n' ) + 1, sizeof(buffer) ); Menu_DrawString (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y + MENU_LINE_SIZE, buffer, alpha); } }
void Slider_Draw (menuslider_s *s) { int i, alpha = mouseOverAlpha(&s->generic); Menu_DrawStringR2LDark (s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, s->generic.name, alpha); s->range = (s->curvalue - s->minvalue) / (float)(s->maxvalue - s->minvalue); if (s->range < 0) s->range = 0; if (s->range > 1) s->range = 1; SCR_DrawChar (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, ALIGN_CENTER, 128, 255,255,255,255, false, false); for (i = 0; i < SLIDER_RANGE; i++) SCR_DrawChar (s->generic.x + s->generic.parent->x + (i+1)*MENU_FONT_SIZE + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, ALIGN_CENTER, 129, 255,255,255,255, false, false); SCR_DrawChar (s->generic.x + s->generic.parent->x + (i+1)*MENU_FONT_SIZE + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, ALIGN_CENTER, 130, 255,255,255,255, false, false); SCR_DrawChar (s->generic.x + s->generic.parent->x + MENU_FONT_SIZE*((SLIDER_RANGE-1)*s->range+1) + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, ALIGN_CENTER, 131, 255,255,255,255, false, true); }
void Action_Draw (menuaction_s *a) { int alpha = mouseOverAlpha(&a->generic); if (a->generic.flags & QMF_LEFT_JUSTIFY) { if (a->generic.flags & QMF_GRAYED) Menu_DrawStringDark (a->generic.x + a->generic.parent->x + LCOLUMN_OFFSET, a->generic.y + a->generic.parent->y, a->generic.name, alpha); else Menu_DrawString (a->generic.x + a->generic.parent->x + LCOLUMN_OFFSET, a->generic.y + a->generic.parent->y, a->generic.name, alpha); } else { if (a->generic.flags & QMF_GRAYED) Menu_DrawStringR2LDark (a->generic.x + a->generic.parent->x + LCOLUMN_OFFSET, a->generic.y + a->generic.parent->y, a->generic.name, alpha); else Menu_DrawStringR2L (a->generic.x + a->generic.parent->x + LCOLUMN_OFFSET, a->generic.y + a->generic.parent->y, a->generic.name, alpha); } if (a->generic.ownerdraw) a->generic.ownerdraw(a); }
void Field_Draw (menufield_s *f) { int i, alpha = mouseOverAlpha(&f->generic), xtra; char tempbuffer[128]=""; int offset; if (f->generic.name) Menu_DrawStringR2LDark (f->generic.x + f->generic.parent->x + LCOLUMN_OFFSET, f->generic.y + f->generic.parent->y, f->generic.name, 255); if (xtra = stringLengthExtra(f->buffer)) { strncpy( tempbuffer, f->buffer + f->visible_offset, f->visible_length ); offset = strlen(tempbuffer) - xtra; if (offset > f->visible_length) { f->visible_offset = offset - f->visible_length; strncpy( tempbuffer, f->buffer + f->visible_offset - xtra, f->visible_length + xtra ); offset = f->visible_offset; } } else { strncpy( tempbuffer, f->buffer + f->visible_offset, f->visible_length ); offset = strlen(tempbuffer); } SCR_DrawChar (f->generic.x + f->generic.parent->x + MENU_FONT_SIZE*2, f->generic.y + f->generic.parent->y - 4, ALIGN_CENTER, 18, 255,255,255,255, false, false); SCR_DrawChar (f->generic.x + f->generic.parent->x + MENU_FONT_SIZE*2, f->generic.y + f->generic.parent->y + 4, ALIGN_CENTER, 24, 255,255,255,255, false, false); SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+f->visible_length)*MENU_FONT_SIZE, f->generic.y + f->generic.parent->y - 4, ALIGN_CENTER, 20,255,255,255,255, false, false); SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+f->visible_length)*MENU_FONT_SIZE, f->generic.y + f->generic.parent->y + 4, ALIGN_CENTER, 26, 255,255,255,255, false, false); for (i = 0; i < f->visible_length; i++) { SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+i)*MENU_FONT_SIZE, f->generic.y + f->generic.parent->y - 4, ALIGN_CENTER, 19, 255,255,255,255, false, false); SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+i)*MENU_FONT_SIZE, f->generic.y + f->generic.parent->y + 4, ALIGN_CENTER, 25, 255,255,255,255, false, (i==(f->visible_length-1))); } // add cursor thingie if ( Menu_ItemAtCursor(f->generic.parent)==f && ((int)(Sys_Milliseconds()/250))&1 ) Com_sprintf(tempbuffer, sizeof(tempbuffer), "%s%c", tempbuffer, 11); Menu_DrawString (f->generic.x + f->generic.parent->x + MENU_FONT_SIZE*3, f->generic.y + f->generic.parent->y, tempbuffer, alpha); }
void Field_Draw(menufield_s * f) { int i; char tempbuffer[128] = ""; int alpha = mouseOverAlpha(&f->generic); if (f->generic.name) Menu_DrawStringR2LDark(f->generic.x + f->generic.parent->x + LCOLUMN_OFFSET, f->generic.y + f->generic.parent->y, f->generic.name, 255); Q_strncpyz(tempbuffer, f->buffer + f->visible_offset, f->visible_length); Draw_Char(f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y - 4, 18, 255); Draw_Char(f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y + 4, 24, 255); Draw_Char(f->generic.x + f->generic.parent->x + 24 + f->visible_length * 8, f->generic.y + f->generic.parent->y - 4, 20, 255); Draw_Char(f->generic.x + f->generic.parent->x + 24 + f->visible_length * 8, f->generic.y + f->generic.parent->y + 4, 26, 255); for (i = 0; i < f->visible_length; i++) { Draw_Char(f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y - 4, 19, 255); Draw_Char(f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y + 4, 25, 255); } Menu_DrawString(f->generic.x + f->generic.parent->x + 24, f->generic.y + f->generic.parent->y, tempbuffer, alpha); if (Menu_ItemAtCursor(f->generic.parent) == f) { int offset; if (f->visible_offset) offset = f->visible_length; else offset = f->cursor; if (((int)(Sys_Milliseconds() / 250)) & 1) { Draw_Char(f->generic.x + f->generic.parent->x + (offset + 2) * 8 + 8, f->generic.y + f->generic.parent->y, 11, 255); } else { Draw_Char(f->generic.x + f->generic.parent->x + (offset + 2) * 8 + 8, f->generic.y + f->generic.parent->y, ' ', 255); } } }
void MenuList_Draw(menulist_s * l) { const char **n; int y = 0; int alpha = mouseOverAlpha(&l->generic); Menu_DrawStringR2LDark(l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, l->generic.y + l->generic.parent->y, l->generic.name, alpha); n = l->itemnames; Draw_Fill(l->generic.x - 112 + l->generic.parent->x, l->generic.parent->y + l->generic.y + l->curvalue * 10 + 10, 128, 10, 16); while (*n) { Menu_DrawStringR2LDark(l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, l->generic.y + l->generic.parent->y + y + 10, *n, alpha); n++; y += 10; } }
void Slider_Draw(menuslider_s * s) { int i; int alpha = mouseOverAlpha(&s->generic); Menu_DrawStringR2LDark(s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, s->generic.name, alpha); s->range = (s->curvalue - s->minvalue) / (float)(s->maxvalue - s->minvalue); if (s->range < 0) s->range = 0; if (s->range > 1) s->range = 1; Draw_Char(s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, 128, 255); for (i = 0; i < SLIDER_RANGE; i++) Draw_Char(RCOLUMN_OFFSET + s->generic.x + i * 8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 129, 255); Draw_Char(RCOLUMN_OFFSET + s->generic.x + i * 8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 130, 255); Draw_Char((int)(8 + RCOLUMN_OFFSET + s->generic.parent->x + s->generic.x + (SLIDER_RANGE - 1) * 8 * s->range), s->generic.y + s->generic.parent->y, 131, 255); }
void MenuList_Draw (menulist_s *l) { const char **n; int y = 0, alpha = mouseOverAlpha(&l->generic); Menu_DrawStringR2LDark (l->generic.x + l->generic.parent->x - 2*MENU_FONT_SIZE, l->generic.y + l->generic.parent->y, l->generic.name, alpha); n = l->itemnames; // SCR_DrawFill (l->generic.parent->x + l->generic.x - 112, l->generic.parent->y + l->generic.y + (l->curvalue+1)*MENU_LINE_SIZE, // 128, MENU_LINE_SIZE, ALIGN_CENTER, 16); SCR_DrawFill (l->generic.parent->x + l->generic.x - 112, l->generic.parent->y + l->generic.y + (l->curvalue+1)*MENU_LINE_SIZE, 128, MENU_LINE_SIZE, ALIGN_CENTER, color8red(16), color8green(16), color8blue(16), 255); while (*n) { Menu_DrawStringR2LDark (l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, l->generic.y + l->generic.parent->y + y + MENU_LINE_SIZE, *n, alpha); n++; y += MENU_LINE_SIZE; } }