Added Folder preview for sounds

This commit is contained in:
Jindra Petřík
2024-01-01 21:16:08 +01:00
parent a9b910511e
commit 101eee2537
6 changed files with 25 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
### Added
- StartSound and StartSound2 show characterId/class in the tag tree
- Folder preview for sounds
### Fixed
- Debugger - getting children of top level variables

View File

@@ -262,6 +262,11 @@ public class SoundStreamHead2Tag extends SoundStreamHeadTypeTag {
public String toString() {
return getName() + " (" + virtualCharacterId + ")";
}
@Override
public String getUniqueId() {
return "" + virtualCharacterId;
}
//getNeededCharacters intentionally not defined
@Override

View File

@@ -272,6 +272,11 @@ public class SoundStreamHeadTag extends SoundStreamHeadTypeTag {
return getName() + " (" + virtualCharacterId + ")";
}
@Override
public String getUniqueId() {
return "" + virtualCharacterId;
}
//getNeededCharacters intentionally not defined
@Override
public void setSoundSize(boolean soundSize) {

View File

@@ -243,6 +243,11 @@ public class DefineExternalStreamSound extends Tag implements CharacterIdTag, So
public String toString() {
return getName() + " (" + virtualCharacterId + ")";
}
@Override
public String getUniqueId() {
return "" + virtualCharacterId;
}
@Override
public void getTagInfo(TagInfo tagInfo) {

View File

@@ -242,10 +242,12 @@ public class FolderListPanel extends JPanel {
icon.paintIcon(l, g, x * CELL_WIDTH + BORDER_SIZE + PREVIEW_SIZE / 2 - icon.getIconWidth() / 2, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE / 2 - icon.getIconHeight() / 2);
String s;
if (treeItem instanceof Tag) {
Tag t = (Tag) treeItem;
String uniqueId = t.getUniqueId();
s = ((Tag) treeItem).getTagName();
if (treeItem instanceof CharacterTag) {
s = s + " (" + ((CharacterTag) treeItem).getCharacterId() + ")";
}
if (uniqueId != null) {
s = s + " (" + uniqueId + ")";
}
} else {
s = treeItem.toString();
}

View File

@@ -6049,7 +6049,10 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
private void showFolderPreview(FolderItem item) {
String folderName = item.getName();
if (TagTreeModel.FOLDER_OTHERS.equals(folderName) || TagTreeModel.FOLDER_SCRIPTS.equals(folderName)) {
if (TagTreeModel.FOLDER_OTHERS.equals(folderName)
|| TagTreeModel.FOLDER_SCRIPTS.equals(folderName)
|| TagTreeModel.FOLDER_SOUNDS.equals(folderName)
) {
showFolderList(tagTree.getFullModel().getTreePath(item));
return;
}