void UI_DrawLoadPanel( qboolean forcerefresh, qboolean ownerdraw, qboolean uihack ) { static qboolean inside = qfalse; if ( inside ) { if ( !uihack && trap_Cvar_VariableValue( "ui_connecting" ) ) { trap_Cvar_Set( "ui_connecting", "0" ); } return; } connect_ownerdraw = ownerdraw; inside = qtrue; if ( !bg_loadscreeninited ) { trap_R_RegisterFont( "ariblk", 27, &bg_loadscreenfont1 ); trap_R_RegisterFont( "courbd", 30, &bg_loadscreenfont2 ); BG_PanelButtonsSetup( loadpanelButtons ); bg_loadscreeninited = qtrue; } BG_PanelButtonsRender( loadpanelButtons ); if ( forcerefresh ) { //trap_UpdateScreen(); } if ( !uihack && trap_Cvar_VariableValue( "ui_connecting" ) ) { trap_Cvar_Set( "ui_connecting", "0" ); } inside = qfalse; }
qboolean CG_LimboPanel_Draw(void) { static panel_button_t *lastHighlight; panel_button_t *hilight; hilight = BG_PanelButtonsGetHighlightButton(limboPanelButtons); if (hilight && hilight != lastHighlight) { lastHighlight = hilight; } BG_PanelButtonsRender(limboPanelButtons); trap_R_SetColor(NULL); CG_DrawPic(cgDC.cursorx, cgDC.cursory, 32, 32, cgs.media.cursorIcon); return qtrue; }
void UI_DrawLoadPanel(qboolean ownerdraw, qboolean uihack) { static qboolean inside = qfalse; // to avoid a flickering screen on widescreens, we erase it before drawing onto it.. if (((float)(DC->glconfig.vidWidth) / DC->glconfig.vidHeight) != RATIO43) { float xoffset = Cui_WideXoffset() * DC->xscale; trap_R_DrawStretchPic(0, 0, xoffset, DC->glconfig.vidHeight, 0, 0, 1, 1, DC->registerShaderNoMip("gfx/2d/backtile")); trap_R_DrawStretchPic(DC->glconfig.vidWidth - xoffset, 0, xoffset, DC->glconfig.vidHeight, 0, 0, 1, 1, DC->registerShaderNoMip("gfx/2d/backtile")); } if (inside) { if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } return; } connect_ownerdraw = ownerdraw; inside = qtrue; if (!bg_loadscreeninited) { trap_R_RegisterFont("ariblk", 27, &bg_loadscreenfont1); trap_R_RegisterFont("courbd", 30, &bg_loadscreenfont2); BG_PanelButtonsSetup(loadpanelButtons); C_PanelButtonsSetup(loadpanelButtons, Cui_WideXoffset()); // convert to possible widescreen coordinates.. bg_loadscreeninited = qtrue; } BG_PanelButtonsRender(loadpanelButtons); if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } inside = qfalse; }
void CG_DrawDemoControls(int x, int y, int w, vec4_t borderColor, vec4_t bgColor, int tSpacing, vec4_t bgColorTitle, vec4_t borderColorTitle, float hScale, float hScaleY, vec4_t hdrColor, int hStyle, fontHelper_t *hFont) { static panel_button_text_t demoControlTxt; int i; demoControlTxt.scalex = hScale; demoControlTxt.scaley = hScaleY; Vector4Copy(hdrColor, demoControlTxt.colour); demoControlTxt.style = ITEM_ALIGN_CENTER; demoControlTxt.align = 0; demoControlTxt.font = hFont; CG_FillRect(x, y, w, 50, bgColor); CG_DrawRect(x, y, w, 50, 1, borderColor); y += 1; // Header CG_FillRect(x + 1, y, w - 2, tSpacing + 4, bgColorTitle); CG_DrawRect(x + 1, y, w - 2, tSpacing + 4, 1, borderColorTitle); CG_Text_Paint_Ext(x + 4, y + tSpacing, hScale, hScaleY, hdrColor, CG_TranslateString("DEMO STATUS"), 0.0f, 0, hStyle, hFont); for (i = 0; i < 4; i++) { if (i) { RectangleSet(demoControlButtons[i]->rect, (x + (i * (w / 4)) - 15), y + 30, 30, 15); } else { RectangleSet(demoControlButtons[i]->rect, x + 2, y + 15, w - 4, 12); } demoControlButtons[i]->font = &demoControlTxt; } BG_PanelButtonsRender(demoControlButtons); if (cg.time < cgs.cursorUpdate) { // render cursor trap_R_SetColor(NULL); CG_DrawPic(cgDC.cursorx, cgDC.cursory, 32, 32, cgs.media.cursorIcon); } }
void UI_DrawLoadPanel(qboolean ownerdraw, qboolean uihack) { static qboolean inside = qfalse; if (inside) { if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } return; } connect_ownerdraw = ownerdraw; inside = qtrue; if (!bg_loadscreeninited) { trap_R_RegisterFont("ariblk", 27, &bg_loadscreenfont1); trap_R_RegisterFont("courbd", 30, &bg_loadscreenfont2); BG_PanelButtonsSetup(loadpanelButtons); C_PanelButtonsSetup(loadpanelButtons, Cui_WideXoffset()); // convert to possible widescreen coordinates.. bg_loadscreeninited = qtrue; } BG_PanelButtonsRender(loadpanelButtons); if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } inside = qfalse; }
void CG_Fireteams_Draw(void) { BG_PanelButtonsRender(fireteamButtons); }
void CG_DrawConnectScreen(qboolean interactive, qboolean forcerefresh) { static qboolean inside = qfalse; char buffer[1024]; if (!DC) { return; } if (inside) { return; } inside = qtrue; if (!bg_loadscreeninited) { trap_Cvar_Set("ui_connecting", "0"); RegisterFont("ariblk", 27, &cgs.media.bg_loadscreenfont1); RegisterFont("courbd", 30, &cgs.media.bg_loadscreenfont2); bg_axispin = DC->registerShaderNoMip("gfx/loading/pin_axis"); bg_alliedpin = DC->registerShaderNoMip("gfx/loading/pin_allied"); bg_neutralpin = DC->registerShaderNoMip("gfx/loading/pin_neutral"); bg_pin = DC->registerShaderNoMip("gfx/loading/pin_shot"); bg_filter_bo = DC->registerShaderNoMip("ui/assets/filter_bots"); bg_filter_ff = DC->registerShaderNoMip("ui/assets/filter_ff"); bg_filter_hw = DC->registerShaderNoMip("ui/assets/filter_weap"); bg_filter_lv = DC->registerShaderNoMip("ui/assets/filter_lives"); bg_filter_al = DC->registerShaderNoMip("ui/assets/filter_antilag"); bg_filter_bt = DC->registerShaderNoMip("ui/assets/filter_balance"); bg_mappic = 0; BG_PanelButtonsSetup(loadpanelButtons); C_PanelButtonsSetup(loadpanelButtons, cgs.wideXoffset); bg_loadscreeninited = qtrue; } BG_PanelButtonsRender(loadpanelButtons); if (interactive) { DC->drawHandlePic(DC->cursorx, DC->cursory, 32, 32, DC->Assets.cursor); } DC->getConfigString(CS_SERVERINFO, buffer, sizeof(buffer)); if (*buffer) { const char *str; float x = 540.0f + cgs.wideXoffset; float y = 322; int i; qboolean enabled = qfalse; CG_Text_Paint_Centred_Ext(x, y, 0.22f, 0.22f, clr3, ("^1" LEGACY_MOD " ^0" ETLEGACY_VERSION), 0, 0, 0, &cgs.media.bg_loadscreenfont1); y = 340; str = Info_ValueForKey(buffer, "sv_hostname"); CG_Text_Paint_Centred_Ext(x, y, 0.2f, 0.2f, colorWhite, str && *str ? str : "ETHost", 0, 26, 0, &cgs.media.bg_loadscreenfont2); y += 14; for (i = 0; i < MAX_MOTDLINES; i++) { str = CG_ConfigString(CS_CUSTMOTD + i); if (!str || !*str) { break; } CG_Text_Paint_Centred_Ext(x, y, 0.2f, 0.2f, colorWhite, str, 0, 26, 0, &cgs.media.bg_loadscreenfont2); y += 10; } y = 417; str = Info_ValueForKey(buffer, "g_friendlyfire"); if (str && *str && atoi(str)) { x = 461 + cgs.wideXoffset; CG_DrawPic(x, y, 16, 16, bg_filter_ff); } if (atoi(Info_ValueForKey(buffer, "g_gametype")) != GT_WOLF_LMS) { str = Info_ValueForKey(buffer, "g_maxlives"); if (str && *str && atoi(str)) { enabled = qtrue; } if (!enabled) { str = Info_ValueForKey(buffer, "g_alliedmaxlives"); if (str && *str && atoi(str)) { enabled = qtrue; } } if (!enabled) { str = Info_ValueForKey(buffer, "g_axismaxlives"); if (str && *str && atoi(str)) { enabled = qtrue; } } } if (enabled) { x = 489 + cgs.wideXoffset; CG_DrawPic(x, y, 16, 16, bg_filter_lv); } str = Info_ValueForKey(buffer, "omnibot_playing"); if (str && *str && atoi(str)) { x = 518 + cgs.wideXoffset; CG_DrawPic(x, y, 16, 16, bg_filter_bo); } str = Info_ValueForKey(buffer, "g_heavyWeaponRestriction"); if (str && *str && atoi(str) != 100) { x = 546 + cgs.wideXoffset; CG_DrawPic(x, y, 16, 16, bg_filter_hw); } str = Info_ValueForKey(buffer, "g_antilag"); if (str && *str && atoi(str)) { x = 575 + cgs.wideXoffset; CG_DrawPic(x, y, 16, 16, bg_filter_al); } str = Info_ValueForKey(buffer, "g_balancedteams"); if (str && *str && atoi(str)) { x = 604 + cgs.wideXoffset; CG_DrawPic(x, y, 16, 16, bg_filter_bt); } } if (*cgs.rawmapname) { float x = 16 + cgs.wideXoffset + 1; if (!bg_mappic) { bg_mappic = DC->registerShaderNoMip(va("levelshots/%s", cgs.rawmapname)); if (!bg_mappic) { bg_mappic = DC->registerShaderNoMip("levelshots/unknownmap"); } } trap_R_SetColor(colorBlack); CG_DrawPic(x, 2 + 1, 192, 144, bg_mappic); trap_R_SetColor(NULL); x = 16 + cgs.wideXoffset; CG_DrawPic(x, 2, 192, 144, bg_mappic); x = 16 + cgs.wideXoffset + 80; CG_DrawPic(x, 2 + 6, 20, 20, bg_pin); } if (forcerefresh) { DC->updateScreen(); } inside = qfalse; }
void CG_DrawConnectScreen(qboolean interactive, qboolean forcerefresh) { static qboolean inside = qfalse; char buffer[1024]; bg_loadscreeninteractive = interactive; if (!DC) { return; } if (inside) { return; } inside = qtrue; if (!bg_loadscreeninited) { trap_Cvar_Set("ui_connecting", "0"); DC->registerFont("ariblk", 27, &bg_loadscreenfont1); DC->registerFont("courbd", 30, &bg_loadscreenfont2); bg_axispin = DC->registerShaderNoMip("gfx/loading/pin_axis"); bg_alliedpin = DC->registerShaderNoMip("gfx/loading/pin_allied"); bg_neutralpin = DC->registerShaderNoMip("gfx/loading/pin_neutral"); bg_pin = DC->registerShaderNoMip("gfx/loading/pin_shot"); bg_filter_pb = DC->registerShaderNoMip("ui/assets/filter_pb"); bg_filter_ff = DC->registerShaderNoMip("ui/assets/filter_ff"); bg_filter_hw = DC->registerShaderNoMip("ui/assets/filter_weap"); bg_filter_lv = DC->registerShaderNoMip("ui/assets/filter_lives"); bg_filter_al = DC->registerShaderNoMip("ui/assets/filter_antilag"); bg_filter_bt = DC->registerShaderNoMip("ui/assets/filter_balance"); bg_mappic = 0; BG_PanelButtonsSetup(loadpanelButtons); bg_loadscreeninited = qtrue; } BG_PanelButtonsRender(loadpanelButtons); if (interactive) { DC->drawHandlePic(DC->cursorx, DC->cursory, 32, 32, DC->Assets.cursor); } DC->getConfigString(CS_SERVERINFO, buffer, sizeof(buffer)); if (*buffer) { const char *str; qboolean enabled = qfalse; float x, y; int i; // vec4_t clr1 = { 41/255.f, 51/255.f, 43/255.f, 204/255.f }; // vec4_t clr2 = { 0.f, 0.f, 0.f, 225/255.f }; vec4_t clr3 = { 1.f, 1.f, 1.f, .6f }; /* CG_FillRect( 8, 8, 230, 16, clr1 ); CG_DrawRect_FixedBorder( 8, 8, 230, 16, 1, colorMdGrey ); CG_FillRect( 8, 23, 230, 210, clr2 ); CG_DrawRect_FixedBorder( 8, 23, 230, 216, 1, colorMdGrey );*/ y = 322; CG_Text_Paint_Centred_Ext(540, y, 0.22f, 0.22f, clr3, "SERVER INFO", 0, 0, 0, &bg_loadscreenfont1); y = 340; str = Info_ValueForKey(buffer, "sv_hostname"); CG_Text_Paint_Centred_Ext(540, y, 0.2f, 0.2f, colorWhite, str && *str ? str : "ETHost", 0, 26, 0, &bg_loadscreenfont2); y += 14; for (i = 0; i < MAX_MOTDLINES; i++) { str = CG_ConfigString(CS_CUSTMOTD + i); if (!str || !*str) { break; } CG_Text_Paint_Centred_Ext(540, y, 0.2f, 0.2f, colorWhite, str, 0, 26, 0, &bg_loadscreenfont2); y += 10; } y = 417; str = Info_ValueForKey(buffer, "g_friendlyfire"); if (str && *str && atoi(str)) { x = 461; CG_DrawPic(x, y, 16, 16, bg_filter_ff); } if (atoi(Info_ValueForKey(buffer, "g_gametype")) != GT_WOLF_LMS) { str = Info_ValueForKey(buffer, "g_alliedmaxlives"); if (str && *str && atoi(str)) { enabled = qtrue; } else { str = Info_ValueForKey(buffer, "g_axismaxlives"); if (str && *str && atoi(str)) { enabled = qtrue; } else { str = Info_ValueForKey(buffer, "g_maxlives"); if (str && *str && atoi(str)) { enabled = qtrue; } } } } if (enabled) { x = 489; CG_DrawPic(x, y, 16, 16, bg_filter_lv); } str = Info_ValueForKey(buffer, "sv_punkbuster"); if (str && *str && atoi(str)) { x = 518; CG_DrawPic(x, y, 16, 16, bg_filter_pb); } str = Info_ValueForKey(buffer, "g_heavyWeaponRestriction"); if (str && *str && atoi(str) != 100) { x = 546; CG_DrawPic(x, y, 16, 16, bg_filter_hw); } str = Info_ValueForKey(buffer, "g_antilag"); if (str && *str && atoi(str)) { x = 575; CG_DrawPic(x, y, 16, 16, bg_filter_al); } str = Info_ValueForKey(buffer, "g_balancedteams"); if (str && *str && atoi(str)) { x = 604; CG_DrawPic(x, y, 16, 16, bg_filter_bt); } } if (*cgs.rawmapname) { if (!bg_mappic) { bg_mappic = DC->registerShaderNoMip(va("levelshots/%s", cgs.rawmapname)); if (!bg_mappic) { bg_mappic = DC->registerShaderNoMip("levelshots/unknownmap"); } } trap_R_SetColor(colorBlack); CG_DrawPic(16 + 1, 2 + 1, 192, 144, bg_mappic); trap_R_SetColor(NULL); CG_DrawPic(16, 2, 192, 144, bg_mappic); CG_DrawPic(16 + 80, 2 + 6, 20, 20, bg_pin); } if (forcerefresh) { DC->updateScreen(); } inside = qfalse; }