- added a 'brief' mode to linetarget and info.

This commit is contained in:
Christoph Oelckers 2017-02-25 21:48:15 +01:00
parent 35552ce0cb
commit 43e5f035e4
3 changed files with 6 additions and 6 deletions

View file

@ -880,7 +880,7 @@ CCMD(linetarget)
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
C_AimLine(&t, false); C_AimLine(&t, false);
if (t.linetarget) if (t.linetarget)
C_PrintInfo(t.linetarget); C_PrintInfo(t.linetarget, argv.argc() > 1 && atoi(argv[1]) != 0);
else else
Printf("No target found\n"); Printf("No target found\n");
} }
@ -893,7 +893,7 @@ CCMD(info)
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
C_AimLine(&t, true); C_AimLine(&t, true);
if (t.linetarget) if (t.linetarget)
C_PrintInfo(t.linetarget); C_PrintInfo(t.linetarget, !(argv.argc() > 1 && atoi(argv[1]) == 0));
else else
Printf("No target found. Info cannot find actors that have " Printf("No target found. Info cannot find actors that have "
"the NOBLOCKMAP flag or have height/radius of 0.\n"); "the NOBLOCKMAP flag or have height/radius of 0.\n");
@ -902,7 +902,7 @@ CCMD(info)
CCMD(myinfo) CCMD(myinfo)
{ {
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
C_PrintInfo(players[consoleplayer].mo); C_PrintInfo(players[consoleplayer].mo, true);
} }
typedef bool (*ActorTypeChecker) (AActor *); typedef bool (*ActorTypeChecker) (AActor *);

View file

@ -39,7 +39,7 @@
#include "c_functions.h" #include "c_functions.h"
void C_PrintInfo(AActor *target) void C_PrintInfo(AActor *target, bool verbose)
{ {
if (target->player) if (target->player)
Printf("Player=%s, ", target->player->userinfo.GetName()); Printf("Player=%s, ", target->player->userinfo.GetName());
@ -47,7 +47,7 @@ void C_PrintInfo(AActor *target)
target->GetClass()->TypeName.GetChars(), target->GetClass()->TypeName.GetChars(),
target->health, target->health,
target->SpawnHealth()); target->SpawnHealth());
PrintMiscActorInfo(target); if (verbose) PrintMiscActorInfo(target);
} }
void C_AimLine(FTranslatedLineTarget *t, bool nonshootable) void C_AimLine(FTranslatedLineTarget *t, bool nonshootable)

View file

@ -34,6 +34,6 @@
void C_PrintInv(AActor *target); void C_PrintInv(AActor *target);
void C_AimLine(FTranslatedLineTarget *t, bool nonshootable); void C_AimLine(FTranslatedLineTarget *t, bool nonshootable);
void C_PrintInfo(AActor *target); void C_PrintInfo(AActor *target, bool verbose);
struct FTranslatedLineTarget; struct FTranslatedLineTarget;