bool DbgInitialize() { DbgClearAllTopics(); gfRecordToFile = TRUE; gfRecordToDebugger = TRUE; gubAssertString[0] = '\0'; #ifndef _NO_DEBUG_TXT if (! DbgGetLogFileName( debugLogFileName ) ) { return false; } // clear debug text file out RemoveDebugText( ); #endif return true; }
void AHUD::AddDebugText_Implementation(const FString& DebugText, AActor* SrcActor, float Duration, FVector Offset, FVector DesiredOffset, FColor TextColor, bool bSkipOverwriteCheck, bool bAbsoluteLocation, bool bKeepAttachedToActor, UFont* InFont, float FontScale, bool bDrawShadow ) { // set a default color if (TextColor == FColor::Transparent) { TextColor = FColor::White; } // and a default source actor of our pawn if (SrcActor != NULL) { if (DebugText.Len() == 0) { RemoveDebugText(SrcActor); } else { // search for an existing entry int32 Idx = 0; if (!bSkipOverwriteCheck) { Idx = INDEX_NONE; for (int32 i = 0; i < DebugTextList.Num() && Idx == INDEX_NONE; ++i) { if (DebugTextList[i].SrcActor == SrcActor) { Idx = i; } } if (Idx == INDEX_NONE) { // manually grow the array one struct element Idx = DebugTextList.Add(FDebugTextInfo()); } } else { Idx = DebugTextList.Add(FDebugTextInfo()); } // assign the new text and actor DebugTextList[Idx].SrcActor = SrcActor; DebugTextList[Idx].SrcActorOffset = Offset; DebugTextList[Idx].SrcActorDesiredOffset = DesiredOffset; DebugTextList[Idx].DebugText = DebugText; DebugTextList[Idx].TimeRemaining = Duration; DebugTextList[Idx].Duration = Duration; DebugTextList[Idx].TextColor = TextColor; DebugTextList[Idx].bAbsoluteLocation = bAbsoluteLocation; DebugTextList[Idx].bKeepAttachedToActor = bKeepAttachedToActor; DebugTextList[Idx].OrigActorLocation = SrcActor->GetActorLocation(); DebugTextList[Idx].Font = InFont; DebugTextList[Idx].FontScale = FontScale; DebugTextList[Idx].bDrawShadow = bDrawShadow; } } }