diff --git a/cvarinfo.base b/cvarinfo.base index 6f6af95e3..fbe60dc3e 100644 --- a/cvarinfo.base +++ b/cvarinfo.base @@ -1,6 +1,5 @@ // main mod cvars user string swwm_voicetype = "default"; // voice for your demolitionist -//user color swwm_tagcolor = "40 FF 00"; // color of your model tags, not available due to engine dickery nosave float swwm_flashstrength = 1.0; // strength of screen flashes nosave int swwm_hudmargin = 10; // margin around fullscreen hud elements nosave int swwm_maxshown = 4; // max messages to show normally @@ -118,6 +117,8 @@ user bool swwm_autousebarrier = true; // auto-use elemental coating when standi server int swwm_enforceautousebarrier = 0; // enforced auto-use for coating nosave bool swwm_nomapmsg = false; // disables special map dialogue messages nosave bool swwm_weapontooltips = true; // shows a tooltip on weapon operation when first selected +nosave string swwm_tooltipshown = ""; // which weapons have already had their tooltips displayed +nosave noarchive bool swwm_tooltipnote = false; // set if the note on how to disable tooltips was already displayed // minimap settings nosave bool swwm_mm_enable = true; // show a minimap below the score counter diff --git a/language.def_base b/language.def_base index dd77e6552..290100c51 100644 --- a/language.def_base +++ b/language.def_base @@ -718,6 +718,7 @@ SWWM_PLACE1 = "1st"; SWWM_PLACE2 = "2nd"; SWWM_PLACE3 = "3rd"; // weapon tooltips +SWWM_TTNOTE = "Note: Weapon tooltips can be deactivated in SWWM GZ Options."; TT_PUSHER = "\cfFire:\c- Drill.\n" "\cfAltfire:\c- Charged attack."; diff --git a/language.def_menu b/language.def_menu index f5be0162e..650b92e38 100644 --- a/language.def_menu +++ b/language.def_menu @@ -201,6 +201,9 @@ SWWM_BARRIERUSE = "Automatically Use Coating"; SWWM_SVBARRIERUSE = "Enforce Coating Auto-Use"; SWWM_NOMAPMSG = "Map Special Messages"; SWWM_WEAPONTOOLTIPS = "Weapon Tooltips"; +SWWM_RESETTOOLTIPS = "Reset Weapon Tooltips"; +SWWM_CRESET = "Reset to Defaults"; +SWWM_ARESET = "Wipe Achievements"; SWWM_MMTITLE = "Minimap Settings"; SWWM_MM_ENABLE = "Show Minimap"; SWWM_MM_ROTATE = "Rotate Minimap"; @@ -241,6 +244,11 @@ SWWM_MM_THINGCOLOR_CITEM = "Count Items"; SWWM_MM_THINGCOLOR_VIPITEM = "Important Items"; SWWM_MM_THINGCOLOR_SHOOTABLE = "Shootable Actors"; SWWM_MM_THINGCOLOR_MISSILE = "Projectiles"; +SWWM_AC_UNLOCKED = "Unlocked: "; +SWWM_AC_INCOMPLETE = "Incomplete: "; +SWWM_AC_UNDISCOVERED = "Undiscovered: "; +SWWM_AC_COMPLETE1 = "You've unlocked all achievements!"; +SWWM_AC_COMPLETE2 = "You are a true Demolitionist!"; TOOLTIP_SWWM_VOICETYPE = "Sets the voice pack for the player."; TOOLTIP_SWWM_MUTEVOICE = "Control what gets muted, if you'd rather have a more silent protagonist."; TOOLTIP_SWWM_FLASHSTRENGTH = "Screen flashes usually happen when firing some weapons, you can lower this if these effects are harmful for you."; @@ -348,6 +356,11 @@ TOOLTIP_SWWM_AUTOUSEBARRIER = "When enabled, elemental coating will be automatic TOOLTIP_SWWM_ENFORCEAUTOUSEBARRIER = "Enforce a specific coating auto-use setting for all players, or respects per-player settings."; TOOLTIP_SWWM_NOMAPMSG = "Toggles special animated character messages on certain maps (usually vanilla)."; TOOLTIP_SWWM_WEAPONTOOLTIPS = "Shows a summary of controls when a weapon is selected for the first time."; +TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resets weapon tooltips so you can see them all over again."; +TOOLTIP_EVENT_SWWMRESETCVARS = "Resets all the mod's settings to their original values."; +TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Erases all your archievement progress."; +TOOLTIP_SWWMMINIMAPMENU = "Configure the minimap."; +TOOLTIP_SWWMACHIEVEMENTMENU = "View your achievements."; 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_base b/language.es_base index f69cd0c87..4d4d1233d 100644 --- a/language.es_base +++ b/language.es_base @@ -605,6 +605,7 @@ SWWM_PLACE1_GENDER1 = "1ª"; SWWM_PLACE2_GENDER1 = "2ª"; SWWM_PLACE3_GENDER1 = "3ª"; // weapon tooltips +SWWM_TTNOTE = "Nota: La ayuda de armas se puede desactivar en Opciones de SWWM GZ."; TT_PUSHER = "\cfPrimario:\c- Taladrar.\n" "\cfSecundario:\c- Ataque cargado."; diff --git a/language.es_menu b/language.es_menu index 702d6801c..c3bbf458d 100644 --- a/language.es_menu +++ b/language.es_menu @@ -199,7 +199,10 @@ SWWM_NOMAGDROP = "Tirar Cargadores Usados"; SWWM_BARRIERUSE = "Usar Revestimiento Automáticamente"; SWWM_SVBARRIERUSE = "Forzar Auto-Uso de Revestimiento"; SWWM_NOMAPMSG = "Mensajes Especiales de Mapa"; -SWWM_WEAPONTOOLTIPS = "Información de Armas"; +SWWM_WEAPONTOOLTIPS = "Ayuda de Armas"; +SWWM_RESETTOOLTIPS = "Resetear Ayuda de Armas"; +SWWM_CRESET = "Restaurar Predeterminado"; +SWWM_ARESET = "Borrar Logros"; SWWM_MMTITLE = "Opciones de Minimapa"; SWWM_MM_ENABLE = "Mostrar Minimapa"; SWWM_MM_ROTATE = "Rotar Minimapa"; @@ -240,6 +243,11 @@ SWWM_MM_THINGCOLOR_CITEM = "Objetos contados"; SWWM_MM_THINGCOLOR_VIPITEM = "Objetos importantes"; SWWM_MM_THINGCOLOR_SHOOTABLE = "Actores vulnerables"; SWWM_MM_THINGCOLOR_MISSILE = "Proyectiles"; +SWWM_AC_UNLOCKED = "Desbloqueados: "; +SWWM_AC_INCOMPLETE = "Incompletos: "; +SWWM_AC_UNDISCOVERED = "Sin descubrir: "; +SWWM_AC_COMPLETE1 = "¡Has desbloqueado todos los logros!"; +SWWM_AC_COMPLETE2 = "¡Eres un%s verdader@[ao_esp] Demolicionista!"; // has to be hotfixed in zscript for now TOOLTIP_SWWM_VOICETYPE = "Selecciona el pack de voz para el jugador."; TOOLTIP_SWWM_MUTEVOICE = "Controla lo que se mutea, si prefieres tener un protagonista más silencioso."; TOOLTIP_SWWM_FLASHSTRENGTH = "Los destellos en pantalla suelen ocurrir al disparar algunas armas, puedes reducirlo si este tipo de efectos te causan malestar."; @@ -347,6 +355,11 @@ TOOLTIP_SWWM_AUTOUSEBARRIER = "Cuando esto está activado, el revestimiento elem TOOLTIP_SWWM_ENFORCEAUTOUSEBARRIER = "Fuerza una opción específica de auto-uso de revestimiento para todos los jugadores, o respeta la opción de cada uno."; TOOLTIP_SWWM_NOMAPMSG = "Activa mensajes especiales animados de personajes en ciertos mapas (usualmente vanilla)."; TOOLTIP_SWWM_WEAPONTOOLTIPS = "Muestra un resumen de controles cuando se selecciona un arma por primera vez."; +TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resetea la ayuda de armas para que puedas volver a verla de nuevo."; +TOOLTIP_EVENT_SWWMRESETCVARS = "Resetea todas las opciones del mod a sus valores originales."; +TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Borra todo tu progreso de logros."; +TOOLTIP_SWWMMINIMAPMENU = "Configura el minimapa."; +TOOLTIP_SWWMACHIEVEMENTMENU = "Revisa tus logros."; 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 635cc0fca..6a22b92ba 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1pre r21 \cu(Thu 16 Sep 16:31:44 CEST 2021)\c-"; -SWWM_SHORTVER="\cw1.1pre r21 \cu(2021-09-16 16:31:44)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1pre r22 \cu(Thu 16 Sep 18:52:43 CEST 2021)\c-"; +SWWM_SHORTVER="\cw1.1pre r22 \cu(2021-09-16 18:52:43)\c-"; diff --git a/menudef.txt b/menudef.txt index c64ae6ce1..7fa48e48d 100644 --- a/menudef.txt +++ b/menudef.txt @@ -78,6 +78,8 @@ OptionMenu "SWWMOptionMenu" Title "$SWWM_MTITLE" Submenu "$SWWM_MMTITLE", "SWWMMinimapMenu" + SafeCommand "$SWWM_CRESET", "event swwmresetcvars" + SafeCommand "$SWWM_ARESET", "event swwmresetachievements" StaticText " " StaticText "$SWWM_PTITLE", "Blue" @@ -191,6 +193,7 @@ OptionMenu "SWWMOptionMenu" Option "$SWWM_COLLECTANIM", "swwm_collectanim", "YesNo" Option "$SWWM_COLLECTANIMKEY", "swwm_collectanimkey", "YesNo" Option "$SWWM_WEAPONTOOLTIPS", "swwm_weapontooltips", "YesNo" + SafeCommand "$SWWM_RESETTOOLTIPS", "event swwmresettooltips" StaticText " " StaticText "$SWWM_CTITLE", "Blue" Option "$SWWM_SKEYS", "swwm_sharekeys", "YesNo" diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index a1452e9d7..31044bdad 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -59,6 +59,8 @@ Class SWWMStatusBar : BaseStatusBar bool koraxhack, mainframehack; int puzzlecnt, realpuzzlecnt; + SWWMWeaponTooltip ctip; + double minimapzoom, oldminimapzoom; // minimap constants const CLIPDIST = 800; // clip distance for minimap view, with rotation accounted @@ -127,7 +129,19 @@ Class SWWMStatusBar : BaseStatusBar if ( w ) { let tt = new("SWWMWeaponTooltip").Init(w); - AttachMessage(tt,-2910); + bool appended = false; + for ( SWWMWeaponTooltip t=ctip; t; t=t.next ) + { + if ( t.next ) continue; + appended = true; + t.next = tt; + break; + } + if ( !appended ) + { + ctip = tt; + AttachMessage(tt,-2910); + } } return true; } diff --git a/zscript/hud/swwm_hudextra.zsc b/zscript/hud/swwm_hudextra.zsc index 3655f76a9..8ad0f88cf 100644 --- a/zscript/hud/swwm_hudextra.zsc +++ b/zscript/hud/swwm_hudextra.zsc @@ -253,23 +253,26 @@ Class SWWMWeaponTooltip : HUDMessageBase double tics, holdtics, fadeintics, fadeouttics; transient Font tewifont, mplusfont, miniwifont, k6x8font; transient BrokenLines l; + SWWMWeaponTooltip next; SWWMWeaponTooltip Init( Class weapon ) { let def = GetDefaultByType(weapon); icon = def.Icon; wpn = def.GetTag(); - txt = def.tooltip; - holdtics = 90; - fadeintics = 20; - fadeouttics = 30; + txt = StringTable.Localize(def.tooltip); + holdtics = 120; + fadeintics = 5; + fadeouttics = 15; tics = -10; return self; } override bool Tick() { - return (++tics > holdtics+fadeintics+fadeouttics); + bool clearme = (++tics > holdtics+fadeintics+fadeouttics); + if ( clearme && next ) StatusBar.AttachMessage(next,-2910); + return clearme; } override void Draw( int bottom, int visibility ) @@ -294,11 +297,9 @@ Class SWWMWeaponTooltip : HUDMessageBase double alpha = (tics w ) w = lw; } - // underline - int cw = int(ceil((max(w1,w)+8)/6.))*6; + int cw = int(ceil((max(max(w1,w2),w)+8)/6.))*6; + Screen.Dim("Black",.5*alpha,int((pos.x-(cw+4)/2)*hs.x),int((pos.y-(h+6))*hs.y),int((cw+4)*hs.x),int((8+h+4+fnt.GetHeight()+8+fnt2.GetHeight()*l.Count())*hs.y)); + Screen.DrawTexture(icon,false,pos.x,pos.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_CenterBottomOffset,true); + pos.y += 4; + Screen.DrawText(fnt,Font.CR_FIRE,pos.x-w1/2,pos.y,wpn,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha); for ( int i=0; i cvarlist; + SWWMUtility.GetCVars(cvarlist); + for ( int i=0; i cvarlist; + SWWMUtility.GetCVars(cvarlist); + for ( int i=0; i cvarlist; + SWWMUtility.GetCVars(cvarlist); + for ( int i=0; i mstats; Array lstats; Array > alreadygot; - Array > sawtooltip; int favweapon; // these two are used for mission updates Array clustervisit; @@ -61,19 +60,6 @@ Class SWWMStats : Thinker return false; } - void SendTooltip( Class which ) - { - if ( !swwm_weapontooltips ) return; - for ( int i=0; i WeaponFromInflictor( Actor inflictor, Name damagetype ) { Class which = myplayer.ReadyWeapon?myplayer.ReadyWeapon.GetClass():null; diff --git a/zscript/utility/swwm_utility.zsc b/zscript/utility/swwm_utility.zsc index d479a2221..917562fc9 100644 --- a/zscript/utility/swwm_utility.zsc +++ b/zscript/utility/swwm_utility.zsc @@ -161,8 +161,60 @@ Class SWWMUtility cv.SetFloat(cval+inc); } + // gets the names of all mod cvars + static clearscope void GetCVars( out Array cvarlist ) + { + cvarlist.Clear(); + let lmp = Wads.CheckNumForFullname("cvarinfo.base"); + if ( lmp == -1 ) ThrowAbortException("'cvarinfo.base' not found"); + String dat = Wads.ReadLump(lmp); + Array list, ln; + // fucking Windows + dat.Replace("\r",""); + list.Clear(); + dat.Split(list,"\n"); + for ( int i=0; i which ) + { + if ( !swwm_weapontooltips ) return; + CVar v = CVar.FindCVar('swwm_tooltipshown'); + String tt = v.GetString(); + Array wpn; + tt.Split(wpn,","); + for ( int i=0; i dropammotype; Property Tooltip : tooltip; @@ -354,10 +355,14 @@ Class SWWMWeapon : Weapon abstract PlayUpSound(Owner); } if ( !Owner.player || (Owner.player.ReadyWeapon != self) || !(Owner.player.WeaponState&WF_WEAPONSWITCHOK) || (Owner.player.WeaponState&WF_DISABLESWITCH) ) + { + tooltipsent = false; return; - let demo = Demolitionist(Owner); - if ( demo && demo.mystats && tooltip ) - demo.mystats.SendTooltip(GetClass()); + } + if ( tooltipsent ) return; + tooltipsent = true; + if ( Owner.player == players[consoleplayer] ) + SWWMUtility.SendTooltip(GetClass()); } action void A_SWWMFlash( StateLabel flashlabel = null ) {