From: z411 Date: Sat, 27 Aug 2022 00:27:16 +0000 (-0400) Subject: Merge branch 'master' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a59838b95a5f7cafe87514bde81c94f38ea80abc;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into z411/bai-server --- a59838b95a5f7cafe87514bde81c94f38ea80abc diff --cc notifications.cfg index 3b8d8afd3,1919601d5..9722df6af --- a/notifications.cfg +++ b/notifications.cfg @@@ -136,7 -93,7 +136,7 @@@ seta notification_ANNCE_VOTE_ACCEPT "2 seta notification_ANNCE_VOTE_CALL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled" seta notification_ANNCE_VOTE_FAIL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled" - // MSG_INFO notifications (count = 347): -// MSG_INFO notifications (count = 335): ++// MSG_INFO notifications (count = 348): seta notification_INFO_CA_JOIN_LATE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_CA_LEAVE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_CHAT_NOSPECTATORS "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" @@@ -395,7 -343,7 +396,7 @@@ seta notification_INFO_WEAPON_TUBA_SUIC seta notification_INFO_WEAPON_VAPORIZER_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_WEAPON_VORTEX_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" - // MSG_CENTER notifications (count = 255): -// MSG_CENTER notifications (count = 242): ++// MSG_CENTER notifications (count = 256): seta notification_CENTER_ALONE "1" "0 = off, 1 = centerprint" seta notification_CENTER_ASSAULT_ATTACKING "1" "0 = off, 1 = centerprint" seta notification_CENTER_ASSAULT_DEFENDING "1" "0 = off, 1 = centerprint" @@@ -535,16 -481,10 +536,17 @@@ seta notification_CENTER_KEYHUNT_SCAN " seta notification_CENTER_KEYHUNT_START "1" "0 = off, 1 = centerprint" seta notification_CENTER_LMS_NOLIVES "1" "0 = off, 1 = centerprint" seta notification_CENTER_LMS_SPECWARN "1" "0 = off, 1 = centerprint" + seta notification_CENTER_LMS_VISIBLE_LEADER "1" "0 = off, 1 = centerprint" + seta notification_CENTER_LMS_VISIBLE_OTHER "1" "0 = off, 1 = centerprint" seta notification_CENTER_MISSING_PLAYERS "1" "0 = off, 1 = centerprint" +seta notification_CENTER_MISSING_READY "1" "0 = off, 1 = centerprint" seta notification_CENTER_MISSING_TEAMS "1" "0 = off, 1 = centerprint" +seta notification_CENTER_MMM_CIVILIAN "1" "0 = off, 1 = centerprint" +seta notification_CENTER_MMM_CIVILIAN_WIN "1" "0 = off, 1 = centerprint" +seta notification_CENTER_MMM_CORPSEDETECTION "1" "0 = off, 1 = centerprint" +seta notification_CENTER_MMM_DETECTIVE "1" "0 = off, 1 = centerprint" +seta notification_CENTER_MMM_MURDERER "1" "0 = off, 1 = centerprint" +seta notification_CENTER_MMM_MURDERER_WIN "1" "0 = off, 1 = centerprint" - seta notification_CENTER_MOTD "1" "0 = off, 1 = centerprint" seta notification_CENTER_MOVETOSPEC_IDLING "1" "0 = off, 1 = centerprint" seta notification_CENTER_NADE_BONUS "1" "0 = off, 1 = centerprint" seta notification_CENTER_NADE_THROW "1" "0 = off, 1 = centerprint" @@@ -831,4 -749,4 +834,4 @@@ seta notification_show_sprees_info "3" seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself" seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement" - // Notification counts (total = 946): MSG_ANNCE = 141, MSG_INFO = 347, MSG_CENTER = 255, MSG_MULTI = 156, MSG_CHOICE = 28 -// Notification counts (total = 842): MSG_ANNCE = 80, MSG_INFO = 335, MSG_CENTER = 242, MSG_MULTI = 157, MSG_CHOICE = 28 ++// Notification counts (total = 949): MSG_ANNCE = 141, MSG_INFO = 348, MSG_CENTER = 256, MSG_MULTI = 157, MSG_CHOICE = 28 diff --cc qcsrc/client/hud/panel/centerprint.qc index 0b21f1d4e,1e388c4d8..3dd6bdc6a --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@@ -155,26 -151,11 +155,26 @@@ void centerprint_KillAll( } } +void centerprint_Medal(string icon, float times) +{ + if(!autocvar_hud_panel_centerprint_medals) return; + + //LOG_INFOF("centerprint_Medal: icon: %s times: %d", icon, times); + //centerprint_medal_expire_time = time + autocvar_hud_panel_centerprint_time; + centerprint_medal_expire_time = time + MSG_MEDAL_TIME; + centerprint_medal_times = times; + if(centerprint_medal_icon) + strunzone(centerprint_medal_icon); + centerprint_medal_icon = strzone(strcat("gfx/medal/", icon)); + + centerprint_showing = true; +} + - void centerprint_SetDuelTitle(string left, string right, string div) + void centerprint_SetDuelTitle(string left, string right) { - strcpy(centerprint_title_left, left); - strcpy(centerprint_title_right, right); - centerprint_SetTitle(sprintf("^BG%s^BG %s %s", left, div, right)); + float namesize = autocvar_hud_panel_scoreboard_namesize * hud_fontsize.x; + strcpy(centerprint_title_left, textShortenToWidth(left, namesize, hud_fontsize, stringwidth_colors)); + strcpy(centerprint_title_right, textShortenToWidth(right, namesize, hud_fontsize, stringwidth_colors)); } void centerprint_SetTitle(string title) @@@ -285,49 -265,18 +285,54 @@@ void HUD_CenterPrint( if (autocvar_hud_panel_centerprint_flip) pos.y += panel_size.y; align = bound(0, autocvar_hud_panel_centerprint_align, 1); + + // z411 draw medals first + if (autocvar_hud_panel_centerprint_medals && time < centerprint_medal_expire_time) { + float height = vid_conheight/50 * 4; + pos.y -= height; + + if(time < centerprint_medal_expire_time - MSG_MEDAL_FADE_TIME) + a = 1; + else + a = (centerprint_medal_expire_time - time) / MSG_MEDAL_FADE_TIME; + + vector tmp_in = pos; + + vector mysize = draw_getimagesize(centerprint_medal_icon); + vector newsize = vec2(height*(mysize.x/mysize.y), height); + vector fontsize = '1 1 0' * (newsize.y/2); + + tmp_in.x += (panel_size.x - newsize.x) / 2; // center medal icon + + if(centerprint_medal_times < autocvar_hud_panel_centerprint_medals_max) { + tmp_in.x -= ((newsize.x * 1.1) * (centerprint_medal_times - 1) / 2); + for(int t = 0; t < centerprint_medal_times; t++) { + drawpic(tmp_in, centerprint_medal_icon, newsize, '1 1 1', a, DRAWFLAG_NORMAL); + tmp_in.x += newsize.x * 1.1; + } + } else { + drawpic(tmp_in, centerprint_medal_icon, newsize, '1 1 1', a, DRAWFLAG_NORMAL); + tmp_in.x += newsize.x + fontsize.x * 0.25; // draw times next to it + tmp_in.y += (newsize.y - fontsize.y) / 2; + drawstring(tmp_in, ftos(centerprint_medal_times), fontsize, '1 1 1', a, DRAWFLAG_NORMAL); + } + + pos.y += height; + + all_messages_expired = false; + } // Show title if available - if(centerprint_title) { + if(centerprint_title != "" || centerprint_title_left != "") { vector fontsize = cp_fontsize * autocvar_hud_panel_centerprint_fontscale_title; - float width = stringwidth(centerprint_title, true, fontsize); - - pos.x = panel_pos.x + (panel_size.x - width) * align; + float width = 0, right_width = 0, left_width = 0, max_rl_width = 0; + if (centerprint_title != "") + width = stringwidth(centerprint_title, true, fontsize); + else + { + right_width = stringwidth(centerprint_title_right, true, fontsize); + left_width = stringwidth(centerprint_title_left, true, fontsize); + } if (autocvar_hud_panel_centerprint_flip) pos.y -= fontsize.y; diff --cc qcsrc/client/hud/panel/centerprint.qh index a3e419ba8,98f268b34..fca94c89c --- a/qcsrc/client/hud/panel/centerprint.qh +++ b/qcsrc/client/hud/panel/centerprint.qh @@@ -26,7 -23,6 +26,7 @@@ void centerprint_AddStandard(string str void centerprint_Kill(int id); void centerprint_KillAll(); - void centerprint_SetDuelTitle(string left, string right, string div); + void centerprint_SetDuelTitle(string left, string right); void centerprint_SetTitle(string title); void centerprint_ClearTitle(); +void centerprint_Medal(string icon, int times); diff --cc qcsrc/client/hud/panel/scoreboard.qc index 3ddd7c7b9,83c487419..4fd8a65d1 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -118,9 -106,9 +117,11 @@@ float autocvar_hud_panel_scoreboard_min bool autocvar_hud_panel_scoreboard_playerid = false; string autocvar_hud_panel_scoreboard_playerid_prefix = "#"; string autocvar_hud_panel_scoreboard_playerid_suffix = " "; +int average_ping[NUM_TEAMS]; +int total_weapons; + float scoreboard_time; + // mode 0: returns translated label // mode 1: prints name and description of all the labels string Label_getInfo(string label, int mode) @@@ -1177,11 -1407,16 +1514,21 @@@ vector Scoreboard_DrawOthers(vector ite } } + if(flag_name != "") { + drawpic(pos, flag_name, flag_size, sbt_field_icon1_rgb, sbt_fg_alpha, DRAWFLAG_NORMAL); + pos.x += flag_size.x + hud_fontsize.x * 0.5; + } + + if (scoreboard_selected_panel == SB_PANEL_SCOREBOARD && scoreboard_ui_enabled == 1) + { + if (pl == scoreboard_selected_player) + { + h_size.x = column_width + hud_fontsize.x * 0.25; + h_size.y = hud_fontsize.y; + drawfill(pos - hud_fontsize.x * 0.25 * eX, h_size, rgb, 0.44 * panel_fg_alpha, DRAWFLAG_NORMAL); + } + } + vector name_pos = pos; if((this_team == NUM_SPECTATOR) && autocvar_hud_panel_scoreboard_spectators_aligned) name_pos.x += max(fieldsize, min_fieldsize) + 2 * fieldpadding + hud_fontsize.x * 0.25; @@@ -1641,8 -1537,18 +1994,19 @@@ vector Scoreboard_MakeTable(vector pos pos.y += 1.25 * hud_fontsize.y; ++i; } + if(with_ping) average_ping[Team_TeamToIndex(tm.team) - 1] /= with_ping; + if (scoreboard_selected_panel == SB_PANEL_SCOREBOARD) + { + if (scoreboard_ui_enabled == 1 || (tm && scoreboard_selected_team == tm)) + { + float _alpha = (scoreboard_ui_enabled == 2) ? 0.2 : 0.3 * max(0, (1 - (time - scoreboard_selected_panel_time) * 2)); + _alpha *= panel_fg_alpha; + if (_alpha) + drawfill(scoreboard_selected_hl_pos, scoreboard_selected_hl_size, '1 1 1', _alpha, DRAWFLAG_NORMAL); + } + } + panel_size.x += panel_bg_padding * 2; // restore initial width return end_pos; } @@@ -2066,11 -1942,7 +2445,8 @@@ vector Scoreboard_MapStats_Draw(vector panel_size.x += panel_bg_padding * 2; // restore initial width return end_pos; } +*/ - int rankings_rows = 0; - int rankings_columns = 0; - int rankings_cnt = 0; vector Scoreboard_Rankings_Draw(vector pos, string ranktitle, entity pl, vector rgb, vector bg_size) { int i; @@@ -2369,93 -2249,91 +2757,111 @@@ void Scoreboard_Draw( sb_gameinfo_type_fontsize = hud_fontsize * 2.5; sb_gameinfo_detail_fontsize = hud_fontsize * 1.3; + // z411 server name + //drawcolorcodedstring(pos, "bienvenidoainternet.org", sb_gameinfo_type_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + //drawpic_aspect(pos + '1 0 0' * (panel_size.x - 150), "gfx/bai_logo", vec2(150, sb_gameinfo_type_fontsize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + //pos.y += sb_gameinfo_type_fontsize.y; + // Game Info: Game Type - str = MapInfo_Type_ToText(gametype); - + if (scoreboard_ui_enabled == 2) + str = _("Team Selection"); + else + str = MapInfo_Type_ToText(gametype); draw_beginBoldFont(); - drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_type_fontsize)), str, sb_gameinfo_type_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + //drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_type_fontsize)), str, sb_gameinfo_type_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos, str, sb_gameinfo_type_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); draw_endBoldFont(); - + + vector tmp_old_sz = draw_getimagesize("gfx/bai_logo"); + float tmp_aspect = tmp_old_sz.x/tmp_old_sz.y; + vector tmp_new_sz = vec2(sb_gameinfo_type_fontsize.y * tmp_aspect, sb_gameinfo_type_fontsize.y); + ++ // z411 Server logo + drawpic(pos + '1 0 0' * (panel_size.x - tmp_new_sz.x), "gfx/bai_logo", tmp_new_sz, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + pos.y += sb_gameinfo_type_fontsize.y; + + // z411 servername + drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth_colors(hostname_full, sb_gameinfo_detail_fontsize)), hostname_full, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + + pos.y += sb_gameinfo_detail_fontsize.y; + // Game Info: Game Detail - float tl = STAT(TIMELIMIT); - float fl = STAT(FRAGLIMIT); - float ll = STAT(LEADLIMIT); - float ll_and_fl = STAT(LEADLIMIT_AND_FRAGLIMIT); - str = ""; - if(tl > 0) - str = strcat(str, sprintf(_("^3%1.0f minutes"), tl)); - if(!gametype.m_hidelimits) - { - if(fl > 0) - { - if(tl > 0) - str = strcat(str, "^7 / "); // delimiter - if(teamplay) - { - str = strcat(str, sprintf(_("^5%s %s"), ScoreString(teamscores_flags(ts_primary), fl), - (teamscores_label(ts_primary) == "score") ? CTX(_("SCO^points")) : - (teamscores_label(ts_primary) == "fastest") ? "" : - TranslateScoresLabel(teamscores_label(ts_primary)))); - } - else - { - str = strcat(str, sprintf(_("^5%s %s"), ScoreString(scores_flags(ps_primary), fl), - (scores_label(ps_primary) == "score") ? CTX(_("SCO^points")) : - (scores_label(ps_primary) == "fastest") ? "" : - TranslateScoresLabel(scores_label(ps_primary)))); - } - } - if(ll > 0) + if (scoreboard_ui_enabled == 2) + { + if (scoreboard_selected_team) + str = sprintf(_("^7Press ^3%s^7 to join the selected team"), getcommandkey(_("jump"), "+jump")); + else + str = sprintf(_("^7Press ^3%s^7 to auto-select a team and join"), getcommandkey(_("jump"), "+jump")); + drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + + pos.y += sb_gameinfo_detail_fontsize.y + hud_fontsize.y * 0.3; + str = sprintf(_("^7Press ^3%s ^7to select a specific team"), translate_key("TAB")); + drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + } + else + { + float tl = STAT(TIMELIMIT); + float fl = STAT(FRAGLIMIT); + float ll = STAT(LEADLIMIT); + float ll_and_fl = STAT(LEADLIMIT_AND_FRAGLIMIT); + str = ""; + if(tl > 0) + str = strcat(str, sprintf(_("^3%1.0f minutes"), tl)); + if(!gametype.m_hidelimits) { - if(tl > 0 || fl > 0) + if(fl > 0) { - // delimiter - if (ll_and_fl && fl > 0) - str = strcat(str, "^7 & "); + if(tl > 0) + str = strcat(str, "^7 / "); // delimiter + if(teamplay) + { + str = strcat(str, sprintf(_("^5%s %s"), ScoreString(teamscores_flags(ts_primary), fl), + (teamscores_label(ts_primary) == "score") ? CTX(_("SCO^points")) : + (teamscores_label(ts_primary) == "fastest") ? "" : + TranslateScoresLabel(teamscores_label(ts_primary)))); + } else - str = strcat(str, "^7 / "); - } - - if(teamplay) - { - str = strcat(str, sprintf(_("^2+%s %s"), ScoreString(teamscores_flags(ts_primary), ll), - (teamscores_label(ts_primary) == "score") ? CTX(_("SCO^points")) : - (teamscores_label(ts_primary) == "fastest") ? "" : - TranslateScoresLabel(teamscores_label(ts_primary)))); + { + str = strcat(str, sprintf(_("^5%s %s"), ScoreString(scores_flags(ps_primary), fl), + (scores_label(ps_primary) == "score") ? CTX(_("SCO^points")) : + (scores_label(ps_primary) == "fastest") ? "" : + TranslateScoresLabel(scores_label(ps_primary)))); + } } - else + if(ll > 0) { - str = strcat(str, sprintf(_("^2+%s %s"), ScoreString(scores_flags(ps_primary), ll), - (scores_label(ps_primary) == "score") ? CTX(_("SCO^points")) : - (scores_label(ps_primary) == "fastest") ? "" : - TranslateScoresLabel(scores_label(ps_primary)))); + if(tl > 0 || fl > 0) + { + // delimiter + if (ll_and_fl && fl > 0) + str = strcat(str, "^7 & "); + else + str = strcat(str, "^7 / "); + } + + if(teamplay) + { + str = strcat(str, sprintf(_("^2+%s %s"), ScoreString(teamscores_flags(ts_primary), ll), + (teamscores_label(ts_primary) == "score") ? CTX(_("SCO^points")) : + (teamscores_label(ts_primary) == "fastest") ? "" : + TranslateScoresLabel(teamscores_label(ts_primary)))); + } + else + { + str = strcat(str, sprintf(_("^2+%s %s"), ScoreString(scores_flags(ps_primary), ll), + (scores_label(ps_primary) == "score") ? CTX(_("SCO^points")) : + (scores_label(ps_primary) == "fastest") ? "" : + TranslateScoresLabel(scores_label(ps_primary)))); + } } } - } + - drawcolorcodedstring(pos + '1 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align right - // map name - str = sprintf(_("^7Map: ^2%s"), shortmapname); - drawcolorcodedstring(pos, str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align left + drawcolorcodedstring(pos + '1 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align right + // map name + str = sprintf(_("^7Map: ^2%s"), shortmapname); + drawcolorcodedstring(pos, str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align left + } // End of Game Info Section pos.y += sb_gameinfo_detail_fontsize.y + hud_fontsize.y * 0.3; // space between Game Info Section and score table diff --cc qcsrc/common/notifications/all.qh index e84ce6839,74e313dce..aa4ebc32c --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@@ -64,9 -61,7 +64,8 @@@ ENUMCLASS(CPID CASE(CPID, LMS) CASE(CPID, MISSING_TEAMS) CASE(CPID, MISSING_PLAYERS) + CASE(CPID, MISSING_READY) CASE(CPID, INSTAGIB_FINDAMMO) - CASE(CPID, MOTD) CASE(CPID, NIX) CASE(CPID, ONSLAUGHT) CASE(CPID, ONS_CAPSHIELD) diff --cc qcsrc/server/world.qc index e3c05c451,bd713ecd0..2b1f981e8 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@@ -341,9 -313,7 +341,10 @@@ void cvar_changes_init( BADCVAR("g_maplist"); BADCVAR("g_maplist_mostrecent"); BADCVAR("sv_motd"); + BADCVAR("sv_motd_permanent"); + + BADPREFIX("g_teamnames_"); + BADCVAR("sv_termsofservice_url"); v = cvar_string(k); d = cvar_defstring(k);