diff --git a/UndertaleModLib/Decompiler/GlobalDecompileContext.cs b/UndertaleModLib/Decompiler/GlobalDecompileContext.cs index ef1f51492..4461f292d 100644 --- a/UndertaleModLib/Decompiler/GlobalDecompileContext.cs +++ b/UndertaleModLib/Decompiler/GlobalDecompileContext.cs @@ -406,6 +406,12 @@ public string GetAssetName(AssetType assetType, int assetIndex) return null; } return $"{_instanceIdPrefix}{assetIndex}"; + case AssetType.AudioGroup: + if (assetIndex >= (Data.AudioGroups?.Count ?? 0)) + { + return null; + } + return Data.AudioGroups[assetIndex]?.Name?.Content; } return null; diff --git a/UndertaleModLib/GameSpecificData/Underanalyzer/gamemaker.json b/UndertaleModLib/GameSpecificData/Underanalyzer/gamemaker.json index e3c3ea346..431cd3f8c 100644 --- a/UndertaleModLib/GameSpecificData/Underanalyzer/gamemaker.json +++ b/UndertaleModLib/GameSpecificData/Underanalyzer/gamemaker.json @@ -780,6 +780,15 @@ "audio_sound_get_gain": [ "Asset.Sound" ], "audio_play_sound_on": [ null, "Asset.Sound", "Bool", null ], "audio_play_in_sync_group": [ null, "Asset.Sound" ], + "audio_group_get_assets": [ "Asset.AudioGroup" ], + "audio_group_get_gain": [ "Asset.AudioGroup" ], + "audio_group_is_loaded": [ "Asset.AudioGroup" ], + "audio_group_load": [ "Asset.AudioGroup" ], + "audio_group_load_progress": [ "Asset.AudioGroup" ], + "audio_group_name": [ "Asset.AudioGroup" ], + "audio_group_set_gain": [ "Asset.AudioGroup", null, null ], + "audio_group_stop_all": [ "Asset.AudioGroup" ], + "audio_group_unload": [ "Asset.AudioGroup" ], "sound_exists": [ "Asset.Sound" ], "sound_get_name": [ "Asset.Sound" ], "sound_play": [ "Asset.Sound" ], diff --git a/UndertaleModLib/Models/UndertaleCode.cs b/UndertaleModLib/Models/UndertaleCode.cs index 570f2fd80..ec3ca9596 100644 --- a/UndertaleModLib/Models/UndertaleCode.cs +++ b/UndertaleModLib/Models/UndertaleCode.cs @@ -1323,6 +1323,7 @@ private static int AdaptAssetTypeId(UndertaleData data, AssetType type) AssetType.Object => 0, AssetType.Sprite => 1, AssetType.Sound => 2, + AssetType.AudioGroup => 2, AssetType.Room => 3, AssetType.Path => 4, AssetType.Script => 5, @@ -1343,6 +1344,7 @@ private static int AdaptAssetTypeId(UndertaleData data, AssetType type) AssetType.Object => 0, AssetType.Sprite => 1, AssetType.Sound => 2, + AssetType.AudioGroup => 2, AssetType.Room => 3, AssetType.Background => 4, AssetType.Path => 5,