private bool HasAudio(SpeechLine line, SpeechManager speechManager) { if (speechManager.autoNameSpeechFiles) { string language = (languageIndex == 0) ? string.Empty : speechManager.languages[languageIndex]; if (KickStarter.settingsManager != null && line.SeparatePlayerAudio()) { bool doDisplay = false; foreach (PlayerPrefab player in KickStarter.settingsManager.players) { if (player != null && player.playerOb != null) { string fullName = line.GetAutoAssetPathAndName(language, false, player.playerOb.name); AudioClip clipObj = Resources.Load(fullName) as AudioClip; if (clipObj == null) { doDisplay = true; } } } if (!doDisplay) { return(false); } return(true); } else { string fullName = line.GetAutoAssetPathAndName(language); AudioClip clipObj = Resources.Load(fullName) as AudioClip; if (clipObj != null) { return(true); } } } else { if (languageIndex == 0 && line.customAudioClip != null) { return(true); } if (speechManager.translateAudio && languageIndex > 0 && line.customTranslationAudioClips.Count > (languageIndex - 1) && line.customTranslationAudioClips[languageIndex - 1] != null) { return(true); } if (!speechManager.translateAudio && line.customAudioClip != null) { return(true); } } return(false); }
public string GetCellText(SpeechLine speechLine) { string cellText = " "; switch (columnType) { case ColumnType.DisplayText: if (language > 0) { int translation = language - 1; if (speechLine.translationText != null && speechLine.translationText.Count > translation) { cellText = speechLine.translationText[translation]; } } else { cellText = speechLine.text; } break; case ColumnType.Type: cellText = speechLine.textType.ToString(); break; case ColumnType.AssociatedObject: if (speechLine.isPlayer && string.IsNullOrEmpty(speechLine.owner) && speechLine.textType == AC_TextType.Speech) { cellText = "Player"; } else { cellText = speechLine.owner; } break; case ColumnType.Scene: cellText = speechLine.scene; break; case ColumnType.Description: cellText = speechLine.description; break; case ColumnType.TagID: cellText = speechLine.tagID.ToString(); break; case ColumnType.TagName: SpeechTag speechTag = KickStarter.speechManager.GetSpeechTag(speechLine.tagID); cellText = (speechTag != null) ? speechTag.label : ""; break; case ColumnType.SpeechOrder: cellText = speechLine.OrderIdentifier; if (cellText == "-0001") { cellText = string.Empty; } break; case ColumnType.AudioFilename: if (speechLine.textType == AC_TextType.Speech) { if (speechLine.SeparatePlayerAudio()) { string result = string.Empty; for (int j = 0; j < KickStarter.settingsManager.players.Count; j++) { if (KickStarter.settingsManager.players[j].playerOb != null) { string overrideName = KickStarter.settingsManager.players[j].playerOb.name; result += speechLine.GetFilename(overrideName) + ";"; } } cellText = result; } else { cellText = speechLine.GetFilename(); } } break; case ColumnType.AudioFilePresence: if (speechLine.textType == AC_TextType.Speech) { bool hasAllAudio = speechLine.HasAllAudio(); if (hasAllAudio) { cellText = "Has all audio"; } else { if (speechLine.HasAudio(0)) { string missingLabel = "Missing "; for (int i = 1; i < KickStarter.speechManager.languages.Count; i++) { if (!speechLine.HasAudio(i)) { missingLabel += KickStarter.speechManager.languages[i] + ", "; } } if (missingLabel.EndsWith(", ")) { missingLabel = missingLabel.Substring(0, missingLabel.Length - 2); } cellText = missingLabel; } else { cellText = "Missing main audio"; } } } break; } if (string.IsNullOrEmpty(cellText)) { cellText = " "; } return(RemoveLineBreaks(cellText)); }