Debug menu.

This commit is contained in:
Mari the Deer 2022-03-27 16:35:06 +02:00
commit 45a1099fdd
6 changed files with 181 additions and 19 deletions

View file

@ -253,6 +253,15 @@ SWWM_AC_INCOMPLETE = "Incomplete: ";
SWWM_AC_UNDISCOVERED = "Undiscovered: ";
SWWM_AC_COMPLETE1 = "You've unlocked all achievements!";
SWWM_AC_COMPLETE2 = "You are a true Demolitionist!";
SWWM_DBGTITLE = "Debug Settings";
SWWM_DBGWARN = "WARNING: These options and commands are for experienced users only.";
SWWM_DBG_DEBUGBLAST = "Visualize Explosion Radii";
SWWM_DBG_DEBUGVIEW = "Visualize Actor Info";
SWWM_DBG_FIXITEMCAPS = "Recalculate Item Caps";
SWWM_DBG_UPDATESHADOWS = "Update Simple Shadows";
SWWM_DBG_UPDATEGLOWS = "Update Item Glows";
SWWM_DBG_UPDATEHITBOXES = "Update Extended Hitboxes";
SWWM_DBG_UPDATETRACKERS = "Update Combat Trackers";
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.";
@ -404,6 +413,14 @@ TOOLTIP_SWWM_MM_THINGCOLOR_CITEM = "Color for items that count towards map tally
TOOLTIP_SWWM_MM_THINGCOLOR_VIPITEM = "Color for very important items.";
TOOLTIP_SWWM_MM_THINGCOLOR_SHOOTABLE = "Color for things that can be damaged.";
TOOLTIP_SWWM_MM_THINGCOLOR_MISSILE = "Color for projectiles.";
TOOLTIP_SWWMDEBUGMENU = "Don't touch this unless you know what you're doing.";
TOOLTIP_SWWM_DEBUGBLAST = "Shows radii of DoExplosion calls. Damaging explosions are green, with yellow for the hotspot. Non-damaging explosions are blue, with magenta for the hotspot.";
TOOLTIP_SWWM_DEBUGVIEW = "Shows collision, orientation and velocity of actors, as well as relationship lines to their target/tracer/master pointers (gold/orange/purple respectively).";
TOOLTIP_NETEVENT_SWWMFIXITEMCAPS = "Recomputes carried item capacities. Only needed if loading an old save before the default values were changed.";
TOOLTIP_NETEVENT_SWWMUPDATESHADOWS = "Adds/Removes simple shadows at runtime, without the need to restart the map. Unclear if it causes issues.";
TOOLTIP_NETEVENT_SWWMUPDATEGLOWS = "Adds/Removes item glows at runtime, without the need to restart the map. Unclear if it causes issues.";
TOOLTIP_NETEVENT_SWWMUPDATEHITBOXES = "Removes extended item hitboxes at runtime. Due to implementation quirks, they can't be added without a map restart.";
TOOLTIP_NETEVENT_SWWMUPDATETRACKERS = "Adds/Removes combat trackers at runtime. This command has the potential to cause severe performance issues in certain situations.";
// main menu poses (do not localize)
SWWM_NMENUPOSE = "21";
SWWM_MENUPOSE1 = "graphics/M_DEMOCHAN_DEEPIMPACT.png";

View file

@ -252,6 +252,15 @@ 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
SWWM_DBGTITLE = "Opciones de Depurado";
SWWM_DBGWARN = "ADVERTENCIA: Estas opciones y comandos son solo para usuarios experimentados.";
SWWM_DBG_DEBUGBLAST = "Visualizar Radios de Explosión";
SWWM_DBG_DEBUGVIEW = "Visualizar Información de Actor";
SWWM_DBG_FIXITEMCAPS = "Recalcular Capacidades de Ítem";
SWWM_DBG_UPDATESHADOWS = "Actualizar Sombras Simples";
SWWM_DBG_UPDATEGLOWS = "Actualizar Brillos de Ítem";
SWWM_DBG_UPDATEHITBOXES = "Actualizar Hitboxes Extendidas";
SWWM_DBG_UPDATETRACKERS = "Actualizar Rastreo de Combate";
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.";
@ -408,6 +417,14 @@ TOOLTIP_SWWM_MM_THINGCOLOR_CITEM = "Color para ítems que cuentan para el tanteo
TOOLTIP_SWWM_MM_THINGCOLOR_VIPITEM = "Color para ítems muy importantes.";
TOOLTIP_SWWM_MM_THINGCOLOR_SHOOTABLE = "Color para cosas que pueden ser dañadas.";
TOOLTIP_SWWM_MM_THINGCOLOR_MISSILE = "Color para proyectiles.";
TOOLTIP_SWWMDEBUGMENU = "No toques esto a menos que sepas lo que estás haciendo.";
TOOLTIP_SWWM_DEBUGBLAST = "Muestra el radio de funciones DoExplosion. Las explosiones con daño son verdes, con amarillo para su punto caliente. Las explosiones sin daño son azules, con magenta para su punto caliente.";
TOOLTIP_SWWM_DEBUGVIEW = "Muestra la colisión, orientación y velocidad de actores, junto con lineas de relación hacia sus punteros de objetivo/trazador/maestro (dorado/naranja/púrpura respectivamente).";
TOOLTIP_NETEVENT_SWWMFIXITEMCAPS = "Recomputa las capacidades de los ítems en el inventario. Solo necesario al cargar una partida vieja antes de que se cambiaran los valores por defecto.";
TOOLTIP_NETEVENT_SWWMUPDATESHADOWS = "Añade/Quita sombras simples en tiempo real, sin necesidad de reiniciar el mapa. No está claro si puede causar problemas.";
TOOLTIP_NETEVENT_SWWMUPDATEGLOWS = "Añade/Quite brillos de ítem en tiempo real, sin necesidad de reiniciar el mapa. No está claro si puede causar problemas.";
TOOLTIP_NETEVENT_SWWMUPDATEHITBOXES = "Quita hitboxes extendidas de ítem en tiempo real. Dados los detalles de implementación, no pueden añadirse sin reiniciar el mapa.";
TOOLTIP_NETEVENT_SWWMUPDATETRACKERS = "Añade/Quita rastreos de combate en tiempo real. Este comando tiene el potencial de causar problemas severos de rendimiento en ciertas situaciones.";
// credits
SWWM_MCREDS = "Créditos de DEMOLITIONIST";
SWWM_CLEAD = "Desarrollo Principal:";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r3 \cu(Sun 27 Mar 15:27:03 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r3 \cu(2022-03-27 15:27:03)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r4 \cu(Sun 27 Mar 16:35:06 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r4 \cu(2022-03-27 16:35:06)\c-";

View file

@ -93,6 +93,7 @@ OptionMenu "SWWMOptionMenu"
Submenu "$SWWM_MMTITLE", "SWWMMinimapMenu"
SafeCommand "$SWWM_CRESET", "event swwmresetcvars"
SafeCommand "$SWWM_ARESET", "event swwmresetachievements"
Submenu "$SWWM_DBGTITLE", "SWWMDebugMenu"
StaticText " "
StaticText "$SWWM_PTITLE", 1
@ -254,7 +255,6 @@ OptionValue "SWWMMinimapColorset"
3, "$SWWM_STRIFECOLORS"
4, "$SWWM_RAVENCOLORS"
}
OptionMenu "SWWMMinimapMenu"
{
Class "SWWMOptionMenu"
@ -296,6 +296,22 @@ OptionMenu "SWWMMinimapMenu"
ColorPicker "$SWWM_MM_THINGCOLOR_SHOOTABLE", "swwm_mm_thingcolor_shootable"
ColorPicker "$SWWM_MM_THINGCOLOR_MISSILE", "swwm_mm_thingcolor_missile"
}
OptionMenu "SWWMDebugMenu"
{
Class "SWWMOptionMenu"
Title "$SWWM_DBGTITLE"
StaticText "$SWWM_DBGWARN", "DarkGray"
StaticText " "
Option "$SWWM_DBG_DEBUGBLAST", "swwm_debugblast", "YesNo"
Option "$SWWM_DBG_DEBUGVIEW", "swwm_debugview", "YesNo"
StaticText " "
SafeCommand "$SWWM_DBG_FIXITEMCAPS", "netevent swwmfixitemcaps"
SafeCommand "$SWWM_DBG_UPDATESHADOWS", "netevent swwmupdateshadows"
SafeCommand "$SWWM_DBG_UPDATEGLOWS", "netevent swwmupdateglows"
SafeCommand "$SWWM_DBG_UPDATEHITBOXES", "netevent swwmupdatehitboxes"
SafeCommand "$SWWM_DBG_UPDATETRACKERS", "netevent swwmupdatetrackers"
}
AddOptionMenu "OptionsMenu"
{
Submenu "$SWWM_MTITLE", "SWWMOptionMenu"

View file

@ -142,6 +142,119 @@ extend Class SWWMHandler
}
}
}
else if ( e.Name ~== "swwmupdateshadows" )
{
if ( multiplayer && (e.player != Net_Arbitrator) )
{
if ( e.player == consoleplayer )
Console.Printf("Only the net arbitrator can call this event.");
return;
}
if ( !swwm_shadows )
{
let ti = ThinkerIterator.Create("SWWMShadow");
SWWMShadow s;
int n = 0;
while ( s = SWWMShadow(ti.Next()) )
{
n++;
s.Destroy();
}
Console.Printf("%d shadows removed.",n);
return;
}
// build list of actors that already have shadows
Array<Actor> shaded;
let ti = ThinkerIterator.Create("Actor");
Actor a;
while ( a = Actor(ti.Next()) )
{
if ( !(a is 'SWWMShadow') ) continue;
shaded.Push(a.target);
}
int n = 0;
ti.Reinit();
while ( a = Actor(ti.Next()) )
{
if ( (a is 'LampMoth') || !(a.bSHOOTABLE || a.bISMONSTER || (a is 'Inventory') || (a is 'CompanionLamp')) || !((a is 'Demolitionist') || (a.SpawnState.sprite == a.GetSpriteIndex('XZW1'))) )
continue;
if ( shaded.Find(a) < shaded.Size() ) continue;
if ( !SWWMShadow.Track(a) ) continue;
n++;
}
Console.Printf("%d shadows added.",n);
return;
}
else if ( e.Name ~== "swwmupdateglows" )
{
if ( multiplayer && (e.player != Net_Arbitrator) )
{
if ( e.player == consoleplayer )
Console.Printf("Only the net arbitrator can call this event.");
return;
}
if ( !swwm_itemglows )
{
let ti = ThinkerIterator.Create("SWWMPickupFlash");
SWWMPickupFlash f;
int n = 0;
while ( f = SWWMPickupFlash(ti.Next()) )
{
if ( f.CurState != f.FindState('Pickup') ) continue;
n++;
f.Destroy();
}
Console.Printf("%d glows removed.",n);
return;
}
// build list of items that already have glows
Array<Actor> glowed;
let ti = ThinkerIterator.Create("Actor");
Actor a;
while ( a = Actor(ti.Next()) )
{
if ( !(a is 'SWWMPickupFlash') || (a.CurState != a.FindState('Pickup')) ) continue;
glowed.Push(a.target);
}
int n = 0;
ti.Reinit();
while ( a = Actor(ti.Next()) )
{
if ( !(a is 'Inventory') || Inventory(a).Owner || !(Inventory(a).PickupFlash is 'SWWMPickupFlash') )
continue;
if ( glowed.Find(a) < glowed.Size() ) continue;
let p = Actor.Spawn(Inventory(a).PickupFlash,a.Vec3Offset(0,0,16));
p.target = a;
p.SetStateLabel("Pickup");
n++;
}
Console.Printf("%d glows added.",n);
return;
}
else if ( e.Name ~== "swwmupdatehitboxes" )
{
if ( multiplayer && (e.player != Net_Arbitrator) )
{
if ( e.player == consoleplayer )
Console.Printf("Only the net arbitrator can call this event.");
return;
}
if ( !swwm_extendedpickup )
{
let ti = ThinkerIterator.Create("SWWMExtendedItemHitbox");
SWWMExtendedItemHitbox h;
int n = 0;
while ( h = SWWMExtendedItemHitbox(ti.Next()) )
{
n++;
h.Destroy();
}
Console.Printf("%d hitboxes removed.",n);
return;
}
Console.Printf("Extended hitboxes can't be re-enabled at runtime. Please restart the map.");
return;
}
else if ( e.Name ~== "swwmupdatetrackers" )
{
if ( multiplayer && (e.player != Net_Arbitrator) )
@ -161,21 +274,19 @@ extend Class SWWMHandler
}
trackers_cnt = 0;
Console.Printf("%d trackers removed.",n);
return;
}
else
int n = trackers_cnt;
let ti = ThinkerIterator.Create("Actor");
Actor a;
while ( a = Actor(ti.Next()) )
{
int n = trackers_cnt;
let ti = ThinkerIterator.Create("Actor");
Actor a;
while ( a = Actor(ti.Next()) )
{
if ( (!a.bSHOOTABLE && !a.bISMONSTER) || (a is 'LampMoth') || (a is 'CompanionLamp') ) continue;
let trk = SWWMCombatTracker.Spawn(a,true);
if ( !a.player ) trk.maxhealth = max(a.health,a.GetSpawnHealth());
}
n = (trackers_cnt-n);
Console.Printf("%d trackers added.",n);
if ( (!a.bSHOOTABLE && !a.bISMONSTER) || (a is 'LampMoth') || (a is 'CompanionLamp') ) continue;
let trk = SWWMCombatTracker.Spawn(a,true);
if ( !a.player ) trk.maxhealth = max(a.health,a.GetSpawnHealth());
}
n = (trackers_cnt-n);
Console.Printf("%d trackers added.",n);
return;
}
else if ( e.Name ~== "swwmtrimsuckables" )

View file

@ -1311,17 +1311,18 @@ Class SWWMShadow : Actor
{
Sector oldfloor;
static void Track( Actor other )
static bool Track( Actor other )
{
// prevent infinite recursion
if ( other is 'SWWMShadow' ) return;
if ( other is 'SWWMShadow' ) return false;
// no shadows for overlay actors
if ( other is 'GhostArtifactX' ) return;
if ( other is 'GhostArtifactX' ) return false;
// no shadows for things with zero radius
if ( other.radius <= 0. ) return;
if ( other.radius <= 0. ) return false;
let s = SWWMShadow(Spawn("SWWMShadow",other.pos));
s.target = other;
s.Update(true);
return true;
}
private void Update( bool nointerpolate = false )
{