From ec3c1222e0853b1ad79379bb14a814323b0b0eaa Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Tue, 16 Mar 2021 13:44:09 +0100 Subject: [PATCH] Tweaks to mission stats listing menu. Show current map stats, add option to merge map revisits. --- cvarinfo.txt | 1 + language.def_menu | 2 + language.es_menu | 2 + language.version | 4 +- menudef.txt | 1 + zscript/kbase/swwm_kbase.zsc | 76 ++++++++++++++++++++++++++++-------- 6 files changed, 67 insertions(+), 19 deletions(-) diff --git a/cvarinfo.txt b/cvarinfo.txt index 4f860e6d2..74046e659 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -102,6 +102,7 @@ nosave int swwm_numcolor_ap = 3; // font color for armor numbers (default: gree server int swwm_drlaskill = 3; // [DRLA Monsters] skill setting for monster spawns nosave bool swwm_itemsparkles = false; // visual aid for low visibility items server bool swwm_singlefirst = false; // single weapons are selected before dual ones, has to be a server cvar due to limitations +nosave bool swwm_uniqstats = false; // only list stats from the same map once, rather than for each single visit // minimap settings nosave bool swwm_mm_enable = true; // show a minimap below the score counter diff --git a/language.def_menu b/language.def_menu index 06de99ea8..e5725acd5 100644 --- a/language.def_menu +++ b/language.def_menu @@ -209,6 +209,7 @@ SWWM_DRLASKILL_ARMAGEDDON = "Armageddon"; SWWM_DRLASKILL_ADAPTIVE = "Adaptive"; SWWM_ITEMSPARKLES = "Item Sparkles"; SWWM_SINGLEFIRST = "Single Weapons Take Priority"; +SWWM_UNIQSTATS = "Omit Repeated Map Stats"; SWWM_MMTITLE = "Minimap Settings"; SWWM_MM_ENABLE = "Show Minimap"; SWWM_MM_ROTATE = "Rotate Minimap"; @@ -339,6 +340,7 @@ TOOLTIP_SWWM_NUMCOLOR_AP = "Select the color for armor numbers."; TOOLTIP_SWWM_DRLASKILL = "[DRLA Monsters] Sets the skill level for enemy spawns."; TOOLTIP_SWWM_ITEMSPARKLES = "Nearby items will have particles around them, as a visual aid."; TOOLTIP_SWWM_SINGLEFIRST = "For weapons that have dual-wield variants, enabling this will always select the single weapon first."; +TOOLTIP_SWWM_UNIQSTATS = "Clears duplicate map entries in the mission stats tab, useful to unclutter the list when moving back and forth in hubs."; TOOLTIP_SWWM_MM_ENABLE = "Displays a minimap under the score counter."; TOOLTIP_SWWM_MM_ROTATE = "Rotates the minimap view."; TOOLTIP_SWWM_MM_GRID = "Shows a 128x128 grid on the minimap."; diff --git a/language.es_menu b/language.es_menu index 7be9d89b1..8948d3843 100644 --- a/language.es_menu +++ b/language.es_menu @@ -206,6 +206,7 @@ SWWM_DRLASKILL_ARMAGEDDON = "Armagedón"; SWWM_DRLASKILL_ADAPTIVE = "Adaptado"; SWWM_ITEMSPARKLES = "Partículas de Ítem"; SWWM_SINGLEFIRST = "Arma Singular con Prioridad"; +SWWM_UNIQSTATS = "Omitir Estadísticas Repetidas de Mapa"; SWWM_MMTITLE = "Opciones de Minimapa"; SWWM_MM_ENABLE = "Mostrar Minimapa"; SWWM_MM_ROTATE = "Rotar Minimapa"; @@ -336,6 +337,7 @@ TOOLTIP_SWWM_NUMCOLOR_AP = "Selecciona el color para los números de armadura."; TOOLTIP_SWWM_DRLASKILL = "[DRLA Monsters] Elige el nivel de dificultad para spawns de enemigos."; TOOLTIP_SWWM_ITEMSPARKLES = "Los ítems cercanos tendrán partículas alrededor, para mejor visibilidad."; TOOLTIP_SWWM_SINGLEFIRST = "Para armas que tienen variantes duales, activando esto selecionará siempre primero el arma singular."; +TOOLTIP_SWWM_UNIQSTATS = "Elimina entradas duplicadas de mapa en la pestaña de estadísticas de misión, útil para despejar la lista al moverse por hubs."; TOOLTIP_SWWM_MM_ENABLE = "Muestra un minimapa bajo el contador de puntuación."; TOOLTIP_SWWM_MM_ROTATE = "Gira la vista del minimapa."; TOOLTIP_SWWM_MM_GRID = "Muestra una cuadrícula de 128x128 en el minimapa."; diff --git a/language.version b/language.version index 25f7403ba..4e1aa9c0d 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r357 \cu(Mon 15 Mar 22:32:26 CET 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r357 \cu(2021-03-15 22:32:26)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r358 \cu(Tue 16 Mar 13:44:09 CET 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r358 \cu(2021-03-16 13:44:09)\c-"; diff --git a/menudef.txt b/menudef.txt index 784b8aaf3..308b8b318 100644 --- a/menudef.txt +++ b/menudef.txt @@ -95,6 +95,7 @@ OptionMenu "SWWMOptionMenu" Slider "$SWWM_FLASH", "swwm_flashstrength", 0.0, 1.0, 0.1, 1 Option "$SWWM_CAMHUD", "swwm_camhud", "YesNo" Option "$SWWM_FORCESTATS", "swwm_forcestats", "SWWMForceStats" + Option "$SWWM_UNIQSTATS", "swwm_uniqstats", "YesNo" Slider "$SWWM_HUDMARGIN", "swwm_hudmargin", 0, 40, 1, 0 Slider "$SWWM_MAXMSG", "swwm_maxshown", 1, 10, 1, 0 Slider "$SWWM_MAXMSGBIG", "swwm_maxshownbig", 1, 20, 1, 0 diff --git a/zscript/kbase/swwm_kbase.zsc b/zscript/kbase/swwm_kbase.zsc index 657012935..adb4d22b5 100644 --- a/zscript/kbase/swwm_kbase.zsc +++ b/zscript/kbase/swwm_kbase.zsc @@ -55,6 +55,8 @@ Class DemolitionistMenu : GenericMenu SWWMStats stats; Array statlist; Array sorted_mstats; // sorted by killcount + Array filtered_lstats; // filtered if necessary + entry for current map + LevelStat curlstat; // inventory lists Array invlist; // lore stuff @@ -620,7 +622,7 @@ Class DemolitionistMenu : GenericMenu else if ( sel1 == STAT_KILLS ) cnt = sorted_mstats.Size(); else if ( sel1 == STAT_LEVEL ) - cnt = stats.lstats.Size(); + cnt = filtered_lstats.Size(); if ( (cnt > 22) && (sel0 < cnt-22) ) { MenuSound("menu/demoscroll"); @@ -1588,7 +1590,7 @@ Class DemolitionistMenu : GenericMenu int cnt = 0; if ( sel1 == STAT_MAIN ) cnt = statlist.Size(); else if ( sel1 == STAT_KILLS ) cnt = stats.mstats.Size(); - else if ( sel1 == STAT_LEVEL ) cnt = stats.lstats.Size(); + else if ( sel1 == STAT_LEVEL ) cnt = filtered_lstats.Size(); if ( cnt <= 28 ) return res; // no scrollbar // calculate offset int szr = cnt-28; @@ -1800,7 +1802,7 @@ Class DemolitionistMenu : GenericMenu int cnt = 0; if ( sel1 == STAT_MAIN ) cnt = statlist.Size(); else if ( sel1 == STAT_KILLS ) cnt = stats.mstats.Size(); - else if ( sel1 == STAT_LEVEL ) cnt = stats.lstats.Size(); + else if ( sel1 == STAT_LEVEL ) cnt = filtered_lstats.Size(); if ( cnt <= 22 ) return res; // no scrollbar // calculate offset int szr = cnt-22; @@ -2437,6 +2439,7 @@ Class DemolitionistMenu : GenericMenu else if ( tabs[curtab] == TAB_TRADING ) { // build player list + int oldnplayers = playerlist.Size(); playerlist.Clear(); for ( int i=0; iplay transaction checks for ( int i=0; i maxlen[0] ) maxlen[0] = len[0]; - str = String.Format("S %d/%d",stats.lstats[i].scount,stats.lstats[i].stotal); + str = String.Format("S %d/%d",filtered_lstats[i].scount,filtered_lstats[i].stotal); len[1] = fnt2.StringWidth(str); if ( len[1] > maxlen[1] ) maxlen[1] = len[1]; - str = String.Format("I %d/%d",stats.lstats[i].icount,stats.lstats[i].itotal); + str = String.Format("I %d/%d",filtered_lstats[i].icount,filtered_lstats[i].itotal); len[2] = fnt2.StringWidth(str); if ( len[2] > maxlen[2] ) maxlen[2] = len[2]; - str = String.Format("K %d/%d",stats.lstats[i].kcount,stats.lstats[i].ktotal); + str = String.Format("K %d/%d",filtered_lstats[i].kcount,filtered_lstats[i].ktotal); len[3] = fnt2.StringWidth(str); if ( len[3] > maxlen[3] ) maxlen[3] = len[3]; } for ( int i=ofs; i= 370 ) break; - str = stats.lstats[i].hub?stats.lstats[i].levelname:String.Format("%s - %s",stats.lstats[i].mapname.MakeUpper(),stats.lstats[i].levelname); + str = filtered_lstats[i].hub?filtered_lstats[i].levelname:String.Format("%s - %s",filtered_lstats[i].mapname.MakeUpper(),filtered_lstats[i].levelname); + if ( filtered_lstats[i] == curlstat ) str = "\cd▸\c- "..str; bool smallname = fnt.StringWidth(str)>(620-(xx+maxlen[3]+maxlen[2]+maxlen[1]+maxlen[0]+24)); if ( smallname ) yy += 2; Screen.DrawText(smallname?fnt2:fnt,Font.CR_FIRE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); if ( !smallname ) yy += 2; int ox = ((cnt>22)?623:631); - int sec = Thinker.Tics2Seconds(stats.lstats[i].time); + int sec = Thinker.Tics2Seconds(filtered_lstats[i].time); str = String.Format("%02d\cu:\c-%02d\cu:\c-%02d",sec/3600,(sec%3600)/60,sec%60); - Screen.DrawText(fnt2,((stats.lstats[i].suck>0)&&(sec>=(stats.lstats[i].suck*3600)))?Font.CR_RED:(sec<=stats.lstats[i].par)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(fnt2,((filtered_lstats[i].suck>0)&&(sec>=(filtered_lstats[i].suck*3600)))?Font.CR_RED:(sec<=filtered_lstats[i].par)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); Screen.DrawText(fnt2,Font.CR_FIRE,origin.x+ox-maxlen[0],origin.y+yy,"T",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); ox -= maxlen[0]+8; - str = String.Format("%d\cu/\c-%d",stats.lstats[i].scount,stats.lstats[i].stotal); - Screen.DrawText(fnt2,(stats.lstats[i].scount>=stats.lstats[i].stotal)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + str = String.Format("%d\cu/\c-%d",filtered_lstats[i].scount,filtered_lstats[i].stotal); + Screen.DrawText(fnt2,(filtered_lstats[i].scount>=filtered_lstats[i].stotal)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); Screen.DrawText(fnt2,Font.CR_FIRE,origin.x+ox-maxlen[1],origin.y+yy,"S",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); ox -= maxlen[1]+8; - str = String.Format("%d\cu/\c-%d",stats.lstats[i].icount,stats.lstats[i].itotal); - Screen.DrawText(fnt2,(stats.lstats[i].icount>=stats.lstats[i].itotal)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + str = String.Format("%d\cu/\c-%d",filtered_lstats[i].icount,filtered_lstats[i].itotal); + Screen.DrawText(fnt2,(filtered_lstats[i].icount>=filtered_lstats[i].itotal)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); Screen.DrawText(fnt2,Font.CR_FIRE,origin.x+ox-maxlen[2],origin.y+yy,"I",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); ox -= maxlen[2]+8; - str = String.Format("%d\cu/\c-%d",stats.lstats[i].kcount,stats.lstats[i].ktotal); - Screen.DrawText(fnt2,(stats.lstats[i].kcount>=stats.lstats[i].ktotal)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + str = String.Format("%d\cu/\c-%d",filtered_lstats[i].kcount,filtered_lstats[i].ktotal); + Screen.DrawText(fnt2,(filtered_lstats[i].kcount>=filtered_lstats[i].ktotal)?Font.CR_GOLD:Font.CR_WHITE,origin.x+ox-fnt2.StringWidth(str),origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); Screen.DrawText(fnt2,Font.CR_FIRE,origin.x+ox-maxlen[3],origin.y+yy,"K",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); yy += 14; }