| 277 | } |
| 278 | |
| 279 | void FDlgSystemModule::HandleDialogueRenamed(UDlgDialogue* RenamedDialogue, const FString& OldObjectPath) |
| 280 | { |
| 281 | if (!IsValid(RenamedDialogue)) |
| 282 | { |
| 283 | return; |
| 284 | } |
| 285 | |
| 286 | // Rename text file file to new location |
| 287 | const FString OldTextFilePathName = UDlgDialogue::GetTextFilePathNameFromAssetPathName(OldObjectPath); |
| 288 | if (OldTextFilePathName.IsEmpty()) |
| 289 | { |
| 290 | FDlgLogger::Get().Error(TEXT("OldTextFilePathName is empty. This should never happen")); |
| 291 | return; |
| 292 | } |
| 293 | |
| 294 | // Current PathName |
| 295 | const FString CurrentTextFilePathName = RenamedDialogue->GetTextFilePathName(false); |
| 296 | if (OldTextFilePathName == CurrentTextFilePathName) |
| 297 | { |
| 298 | FDlgLogger::Get().Errorf( |
| 299 | TEXT("Dialogue was renamed but the paths before and after are equal :O | `%s` == `%s`"), |
| 300 | *OldTextFilePathName, *CurrentTextFilePathName |
| 301 | ); |
| 302 | return; |
| 303 | } |
| 304 | |
| 305 | // Iterate over all possible text formats |
| 306 | for (const FString& FileExtension : GetDefault<UDlgSystemSettings>()->GetAllTextFileExtensions()) |
| 307 | { |
| 308 | const FString OldFileName = OldTextFilePathName + FileExtension; |
| 309 | const FString NewFileName = CurrentTextFilePathName + FileExtension; |
| 310 | FDlgHelper::RenameFile(OldFileName, NewFileName, true); |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | void FDlgSystemModule::HandleOnPreLoadMap(const FString& MapName) |
| 315 | { |
nothing calls this directly
no test coverage detected