From: z411 Date: Sat, 23 Apr 2022 21:04:45 +0000 (-0400) Subject: Merge branch 'master' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0ee3d5ec2de781711d03533aed4276b21240eebd;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into z411/bai-server --- 0ee3d5ec2de781711d03533aed4276b21240eebd diff --cc qcsrc/client/announcer.qc index 5c7a7d589,e86702afa..7ff4602b2 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@@ -154,13 -149,10 +153,13 @@@ void Announcer_Gamestart( if (gametype.m_1v1) Announcer_Duel(); else - centerprint_SetTitle(strcat("^BG", MapInfo_Type_ToText(gametype)), 0); // Show game type as title + centerprint_SetTitle(strcat("^BG", MapInfo_Type_ToText(gametype))); // Show game type as title if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle - Local_Notification(MSG_ANNCE, ANNCE_PREPARE); + if(teamplay) + Local_Notification(MSG_ANNCE, ANNCE_PREPARE_TEAM); + else + Local_Notification(MSG_ANNCE, ANNCE_PREPARE); } announcer_countdown.nextthink = startTime - floor(startTime - time + 0.5); //synchronize nextthink to startTime diff --cc qcsrc/client/hud/panel/centerprint.qc index 391cb5364,1436f2ef6..7688d3b57 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@@ -45,12 -45,9 +45,13 @@@ float centerprint_expire_time[CENTERPRI int centerprint_countdown_num[CENTERPRINT_MAX_MSGS]; bool centerprint_showing; +float centerprint_medal_expire_time; +string centerprint_medal_icon; +float centerprint_medal_times; + string centerprint_title; - float centerprint_title_offset; + string centerprint_title_left; + string centerprint_title_right; void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num) { @@@ -154,33 -151,24 +155,39 @@@ 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_ClearTitle() + void centerprint_SetDuelTitle(string left, string right, string div) { - strfree(centerprint_title); - centerprint_title_offset = 0; + strcpy(centerprint_title_left, left); + strcpy(centerprint_title_right, right); + centerprint_SetTitle(sprintf("^BG%s^BG %s %s", left, div, right)); } - void centerprint_SetTitle(string title, float offset) + void centerprint_SetTitle(string title) { - if(title != centerprint_title) { + if(title != centerprint_title) strcpy(centerprint_title, CCR(title)); - centerprint_title_offset = offset; - } + } + + void centerprint_ClearTitle() + { + strfree(centerprint_title); + strfree(centerprint_title_left); + strfree(centerprint_title_right); } float hud_configure_cp_generation_time; diff --cc qcsrc/client/hud/panel/centerprint.qh index 7a75f45ce,02a046a6a..a3e419ba8 --- a/qcsrc/client/hud/panel/centerprint.qh +++ b/qcsrc/client/hud/panel/centerprint.qh @@@ -26,6 -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_SetTitle(string title); void centerprint_ClearTitle(); - void centerprint_SetTitle(string title, float offset); +void centerprint_Medal(string icon, int times);