diff --git a/cvarinfo.base b/cvarinfo.base index 61fb4a2a0..115217fe7 100644 --- a/cvarinfo.base +++ b/cvarinfo.base @@ -82,6 +82,10 @@ nosave bool swwm_ccmessage = false; // has received the "corruption cards" dial nosave bool swwm_useweaponbar = false; // scroll through weapons using a bar, like with inventory items nosave bool swwm_percentstats = false; // show level stats as percentages, like in intermissions nosave bool swwm_targetvals = false; // show current/max health values above heathbars +nosave int swwm_hudscale = 0; // force the primary scale of the HUD (used by the HUD itself) +nosave int swwm_hudscale0 = 0; // force the "zero minus" scale of the HUD (used by damage numbers) +nosave int swwm_hudscale1 = 0; // force the "one minus" scale of the HUD (used by healthbars, score numbers) +nosave int swwm_hudscale2 = 0; // force the "two minus" scale of the HUD (used by interest points) // 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 05c06af1f..7def3193b 100644 --- a/language.def_menu +++ b/language.def_menu @@ -186,6 +186,11 @@ SWWM_BARDIST = "Healthbar Distance"; SWWM_USEWEAPONBAR = "Alternate Weapon Selection"; SWWM_PERCENTSTATS = "Percentual Stats"; SWWM_TARGETVAL = "Show Health Values"; +SWWM_HUDSCALE = "HUD Scale"; +SWWM_HUDSCALE0 = "Secondary HUD Scale"; +SWWM_HUDSCALE1 = "Tertiary HUD Scale"; +SWWM_HUDSCALE2 = "Quaternary HUD Scale"; +SWWM_HS_AUTO = "Auto"; SWWM_MM_ENABLE = "Show Minimap"; SWWM_MM_MISSILES = "Projectiles In Minimap"; SWWM_MM_USECANVAS = "Fixed Scale Minimap"; @@ -274,6 +279,10 @@ TOOLTIP_SWWM_BARDIST = "Distance in map units at which healthbar visibility will TOOLTIP_SWWM_USEWEAPONBAR = "Enables an alternate method for scrolling through weapons akin to the inventory bar. Use Primary Fire to accept, and Alternate Fire to cancel."; TOOLTIP_SWWM_PERCENTSTATS = "Shows kills/items/secrets in the HUD as percentages, rather than counters."; TOOLTIP_SWWM_TARGETVALS = "Healthbars will show the current and maximum health values of the target."; +TOOLTIP_SWWM_HUDSCALE = "If non-zero, manually set the scale of the HUD. Keep in mind that HUD elements may overlap if set too high."; +TOOLTIP_SWWM_HUDSCALE0 = "If non-zero, manually set the scale of Damage Numbers. Usually, this is equal to the primary HUD scale."; +TOOLTIP_SWWM_HUDSCALE1 = "If non-zero, manually set the scale of Healthbars, Score Numbers and Item Sense. Usually, this is one less than the primary HUD scale."; +TOOLTIP_SWWM_HUDSCALE2 = "If non-zero, manually set the scale of Interest Points. Usually, this is two less than the primary HUD scale."; TOOLTIP_SWWMACHIEVEMENTMENU = "View your achievements."; TOOLTIP_SWWM_MM_ENABLE = "Displays a minimap on the top right corner of the screen."; TOOLTIP_SWWM_MM_MISSILES = "Displays projectiles in the minimap. Can be toggled if this clutters too much."; diff --git a/language.es_menu b/language.es_menu index 33ecd119b..c033616be 100644 --- a/language.es_menu +++ b/language.es_menu @@ -183,6 +183,10 @@ SWWM_BARDIST = "Distancia de Barras de Salud"; SWWM_USEWEAPONBAR = "Selección Alternativa de Armas"; SWWM_PERCENTSTATS = "Estadísticas Percentuales"; SWWM_TARGETVAL = "Mostrar Valores de Salud"; +SWWM_HUDSCALE = "Escala de HUD"; +SWWM_HUDSCALE0 = "Escala Secundaria de HUD"; +SWWM_HUDSCALE1 = "Escala Terciaria de HUD"; +SWWM_HUDSCALE2 = "Escala Cuaternaria de HUD"; SWWM_MM_ENABLE = "Mostrar Minimapa"; SWWM_MM_MISSILES = "Proyectiles en Minimapa"; SWWM_MM_USECANVAS = "Minimapa a Escala Fija"; @@ -272,6 +276,10 @@ TOOLTIP_SWWM_BARDIST = "Distancia en unidades de mapa a la cual la visibilidad d TOOLTIP_SWWM_USEWEAPONBAR = "Habilita un método alternativo para hacer scroll por las armas similar a la barra de inventario. Usa el Fuego Primario para aceptar, y el Fuego Secundario para cancelar."; TOOLTIP_SWWM_PERCENTSTATS = "Muestra las estadísticas de bajas/ítems/secretos en el HUD como porcentajes, en lugar de contadores."; TOOLTIP_SWWM_TARGETVALS = "Las barras de salud mostrarán los valores de salud actual y máximo del objetivo."; +TOOLTIP_SWWM_HUDSCALE = "Si no es cero, especifica manualmente la escala del HUD. Ten en cuenta que los elementos del HUD pueden solaparse si es muy alta."; +TOOLTIP_SWWM_HUDSCALE0 = "Si no es cero, especifica manualmente la escala de los Números de Daño. Normalmente, es igual a la escala primaria del HUD."; +TOOLTIP_SWWM_HUDSCALE1 = "Si no es cero, especifica manualmente la escala de las Barras de Salud, Números de Puntuación y Sensor de Ítems. Normalmente, es igual a dos menos que la escala primaria del HUD."; +TOOLTIP_SWWM_HUDSCALE2 = "Si no es cero, especifica manualmente la escala de los Puntos de Interés. Normalmente, es igual a tres menos que la escala primaria del HUD."; TOOLTIP_SWWMACHIEVEMENTMENU = "Revisa tus logros."; TOOLTIP_SWWM_MM_ENABLE = "Muestra un minimapa en la esquina superior derecha de la pantalla."; TOOLTIP_SWWM_MM_MISSILES = "Muestra proyectiles en el minimapa. Puede ser desactivado si causa problemas de visibilidad."; diff --git a/language.version b/language.version index 8c618a465..fa276ffec 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r933 \cu(Sun 20 Aug 23:28:24 CEST 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r933 \cu(2023-08-20 23:28:24)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r934 \cu(Mon 21 Aug 11:17:43 CEST 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r934 \cu(2023-08-21 11:17:43)\c-"; diff --git a/menudef.txt b/menudef.txt index d3ad5ad0c..9fd4fbb91 100644 --- a/menudef.txt +++ b/menudef.txt @@ -142,6 +142,10 @@ OptionMenu "SWWMOptionMenu" Option "$SWWM_PERCENTSTATS", "swwm_percentstats", "YesNo" Option "$SWWM_UNIQSTATS", "swwm_uniqstats", "YesNo" Slider "$SWWM_HUDMARGIN", "swwm_hudmargin", 0, 20, 1, 0 + SWWMScaleField "$SWWM_HUDSCALE", "swwm_hudscale", "$SWWM_HS_AUTO" + SWWMScaleField "$SWWM_HUDSCALE0", "swwm_hudscale0", "$SWWM_HS_AUTO" + SWWMScaleField "$SWWM_HUDSCALE1", "swwm_hudscale1", "$SWWM_HS_AUTO" + SWWMScaleField "$SWWM_HUDSCALE2", "swwm_hudscale2", "$SWWM_HS_AUTO" Option "$SWWM_HUDALLAMMO", "swwm_hudallammo", "YesNo" Option "$SWWM_MM_ENABLE", "swwm_mm_enable", "YesNo" Option "$SWWM_MM_MISSILES", "swwm_mm_missiles", "YesNo" diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index 19dcfd87a..27b539b66 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -100,11 +100,9 @@ Class SWWMStatusBar : BaseStatusBar // shared stuff double hs; - double hs1; - double hs2; + double hs0, hs1, hs2; Vector2 ss; - Vector2 ss1; - Vector2 ss2; + Vector2 ss0, ss1, ss2; int margin; double FracTic; double FrameTime; @@ -605,10 +603,32 @@ Class SWWMStatusBar : BaseStatusBar hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.); ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); margin = clamp(swwm_hudmargin,0,20); + hs0 = hs; hs1 = max(hs-1.,1.); hs2 = max(hs-2.,1.); + ss0 = ss; ss1 = (Screen.GetWidth()/hs1,Screen.GetHeight()/hs1); ss2 = (Screen.GetWidth()/hs2,Screen.GetHeight()/hs2); + if ( swwm_hudscale > 0 ) + { + hs = swwm_hudscale; + ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); + } + if ( swwm_hudscale0 > 0 ) + { + hs0 = swwm_hudscale0; + ss0 = (Screen.GetWidth()/hs0,Screen.GetHeight()/hs0); + } + if ( swwm_hudscale1 > 0 ) + { + hs1 = swwm_hudscale1; + ss1 = (Screen.GetWidth()/hs1,Screen.GetHeight()/hs1); + } + if ( swwm_hudscale2 > 0 ) + { + hs2 = swwm_hudscale2; + ss2 = (Screen.GetWidth()/hs2,Screen.GetHeight()/hs2); + } FracTic = TicFrac; if ( (players[consoleplayer].Camera is 'Demolitionist') && (state <= HUD_Fullscreen) ) { diff --git a/zscript/hud/swwm_hud_target.zsc b/zscript/hud/swwm_hud_target.zsc index 128811cf6..dc4f5b320 100644 --- a/zscript/hud/swwm_hud_target.zsc +++ b/zscript/hud/swwm_hud_target.zsc @@ -328,7 +328,7 @@ extend Class SWWMStatusBar if ( viewvec dot tdir < 0 ) continue; Vector3 ndc = SWWMUtility.ProjectPoint(projdata,ViewPos+tdir); if ( ndc.z >= 1. ) continue; - Vector2 vpos = SWWMUtility.NDCToViewport(projdata,ndc)/hs; + Vector2 vpos = SWWMUtility.NDCToViewport(projdata,ndc)/hs0; String tag = abs(snum.damage>=Actor.TELEFRAG_DAMAGE)?(snum.damage>0)?"-∞":"+∞":String.Format("%+d",-snum.damage); double alph = clamp((snum.lifespan+fractic)/35.,0.,1.); Vector2 fo; @@ -336,7 +336,7 @@ extend Class SWWMStatusBar int boostup = 64+snum.seed2; fo.x = (.05*initspd)*((snum.initialspan-(snum.lifespan-fractic))**.8); fo.y = -((snum.initialspan-(snum.lifespan-fractic))**1.5)+boostup*sin((90./snum.initialspan)*(level.maptime+fractic-snum.starttic)); - Screen.DrawText(MiniHUDFontOutline,snum.tcolor,(vpos.x-fo.x)-(MiniHUDFontOutline.StringWidth(tag))/2,(vpos.y-fo.y)-(MiniHUDFontOutline.GetHeight())/2,tag,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph); + Screen.DrawText(MiniHUDFontOutline,snum.tcolor,(vpos.x-fo.x)-(MiniHUDFontOutline.StringWidth(tag))/2,(vpos.y-fo.y)-(MiniHUDFontOutline.GetHeight())/2,tag,DTA_VirtualWidthF,ss0.x,DTA_VirtualHeightF,ss0.y,DTA_KeepRatio,true,DTA_Alpha,alph); } while ( snum = snum.next ); } diff --git a/zscript/hud/swwm_hudextra.zsc b/zscript/hud/swwm_hudextra.zsc index ce5807cd7..d7dc86e44 100644 --- a/zscript/hud/swwm_hudextra.zsc +++ b/zscript/hud/swwm_hudextra.zsc @@ -87,8 +87,18 @@ Class SWWMOneLiner : HUDMessageBase override void Draw( int bottom, int visibility ) { int margin = swwm_hudmargin; - double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.); - Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); + double hs; + Vector2 ss; + if ( SWWMStatusBar(StatusBar) ) + { + hs = SWWMStatusBar(StatusBar).hs; + ss = SWWMStatusBar(StatusBar).ss; + } + else + { + hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.); + ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); + } if ( whichline == "" ) return; // don't draw empty strings // split so it can fit if ( !l ) l = mSmallFont.BreakLines(whichline,int(ss.x*.5)); @@ -187,8 +197,18 @@ Class SWWMAchievementNotification : HUDMessageBase override void Draw( int bottom, int visibility ) { double margin = swwm_hudmargin; - double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.); - Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); + double hs; + Vector2 ss; + if ( SWWMStatusBar(StatusBar) ) + { + hs = SWWMStatusBar(StatusBar).hs; + ss = SWWMStatusBar(StatusBar).ss; + } + else + { + hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.); + ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); + } double fractic = System.GetTimeFrac(); double ftics = tics+fractic; double alpha = (ftics seqcnt) ) return; @@ -804,8 +842,18 @@ Class DSMapTitle : HUDMessageBase override void Draw( int bottom, int visibility ) { if ( tics <= 0 ) return; - double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.); - Vector2 ss = (Screen.GetWidth(),Screen.GetHeight())/hs; + double hs; + Vector2 ss; + if ( SWWMStatusBar(StatusBar) ) + { + hs = SWWMStatusBar(StatusBar).hs; + ss = SWWMStatusBar(StatusBar).ss; + } + else + { + hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.); + ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); + } double fractic = System.GetTimeFrac(); double ftics = tics+fractic; double alpha = (ftics