feat: Add switch container functionality

This commit is contained in:
2026-04-15 21:05:17 +08:00
parent c3eb094fdc
commit 19faccd312
57 changed files with 782 additions and 75 deletions
@@ -9,9 +9,12 @@ namespace OCES.Audio
{
public const uint GameState = 1;
public const uint TileMaterial = 2;
public static void RegisterAllGameState()
{
StateGroupRegistry.Register<GameState>(1);
StateGroupRegistry.Register<TileMaterial>(2);
}
}
}
@@ -15,4 +15,11 @@ namespace OCES.Audio
Bass = 6, // 测试用值
}
public enum TileMaterial
{
Normal, // 普通牌
Ice, // 冰
Cloud, // 云
}
}
@@ -98,6 +98,7 @@ public partial class AudioObject : IBinarySerializable
/// 0 = 随机播放
/// 1 = 顺序播放
/// 2 = 混合播放
/// 3 = 切换播放
/// </summary>
public ContainerType ContainerType { get; set; }
@@ -147,6 +148,16 @@ public partial class AudioObject : IBinarySerializable
/// </summary>
public int VolumeStep { get; set; }
/// <summary>
/// 要绑定的 StateGroup ID
/// </summary>
public uint SwitchGroupId { get; set; }
/// <summary>
/// 匹配失败时的备用 AudioObject ID
/// </summary>
public uint DefaultSwitchId { get; set; }
public void DeSerialize(BinaryReader reader)
{
@@ -186,6 +197,8 @@ public partial class AudioObject : IBinarySerializable
VolumeStepThreshold = reader.ReadUInt32();
Volume = reader.ReadInt32();
VolumeStep = reader.ReadInt32();
SwitchGroupId = reader.ReadUInt32();
DefaultSwitchId = reader.ReadUInt32();
}
public void Serialize(BinaryWriter writer)
@@ -225,6 +238,8 @@ public partial class AudioObject : IBinarySerializable
writer.Write(VolumeStepThreshold);
writer.Write(Volume);
writer.Write(VolumeStep);
writer.Write(SwitchGroupId);
writer.Write(DefaultSwitchId);
}
}
@@ -73,53 +73,36 @@ public static class AudioObjectDefinitions
{ "NVHeartbeats", 56 },
{ "au_sfx_notice_level_countDown_edge", 57 },
{ "au_sfx_notice_level_countDown_time", 58 },
{ "sfx_amb_desert", 2000 },
{ "sfx_amb_forest", 2001 },
{ "sfx_anim_common_item_fly", 3000 },
{ "sfx_anim_corePlay_character_footstep_grass", 3001 },
{ "sfx_anim_corePlay_character_footstep_sand", 3002 },
{ "sfx_anim_corePlay_character_footstep_stone", 3003 },
{ "sfx_anim_corePlay_fireBall", 3004 },
{ "sfx_anim_corePlay_freeze", 3005 },
{ "sfx_anim_corePlay_getIn_devil", 3006 },
{ "sfx_anim_corePlay_getIn_dragon", 3007 },
{ "sfx_anim_corePlay_getIn_ghost", 3008 },
{ "sfx_anim_corePlay_newBoxFromStorage", 3009 },
{ "sfx_anim_corePlay_shield_broke_wood", 3010 },
{ "sfx_anim_corePlay_shield_broke_crystal", 3011 },
{ "sfx_anim_corePlay_shield_broke_eggRoll", 3012 },
{ "sfx_anim_corePlay_shield_show_crystal", 3013 },
{ "sfx_anim_corePlay_shield_show_eggRoll", 3014 },
{ "sfx_anim_corePlay_shield_show_wood", 3015 },
{ "sfx_anim_corePlay_shield_underAttack_wood", 3016 },
{ "sfx_anim_corePlay_shield_underAttack_crystal", 3017 },
{ "sfx_anim_corePlay_shield_underAttack_eggRoll", 3018 },
{ "sfx_anim_corePlay_slow", 3019 },
{ "sfx_anim_corePlay_speedUp", 3020 },
{ "sfx_anim_corePlay_useProp_", 3021 },
{ "sfx_anim_cutScene_in", 3022 },
{ "sfx_anim_cutScene_out", 3023 },
{ "sfx_notice_common_negative", 4000 },
{ "sfx_notice_corePlay_losing", 4001 },
{ "sfx_notice_corePlay_restart", 4002 },
{ "sfx_notice_corePlay_warning", 4003 },
{ "sfx_notice_guide", 4004 },
{ "sfx_notice_spinWheel_click", 4005 },
{ "sfx_notice_spinWheel_getReward", 4006 },
{ "sfx_notice_corePlay_levelStart_hard", 4007 },
{ "sfx_ui_labelSwitch_home", 5000 },
{ "sfx_ui_panel_common_close", 5001 },
{ "sfx_ui_panel_common_open", 5002 },
{ "sfx_ui_panel_continue_open", 5003 },
{ "sfx_ui_panel_corePlay_guide_open", 5004 },
{ "sfx_ui_panel_initPack_open", 5005 },
{ "sfx_ui_panel_piggyBank_close", 5006 },
{ "sfx_ui_panel_piggyBank_open", 5007 },
{ "sfx_ui_panel_removeAds_open", 5008 },
{ "0", 5009 },
{ "sfx_ui_panel_summerPack_open", 5010 },
{ "sfx_ui_panel_unlockItem_open", 5011 },
{ "voice_princess_fear", 9000 },
{ "0,62", 59 },
{ "1,65", 59 },
{ "2,68", 59 },
{ "0,63", 60 },
{ "1,66", 60 },
{ "2,69", 60 },
{ "0,64", 61 },
{ "1,67", 61 },
{ "2,70", 61 },
{ "au_coreplay_choose_v120_a", 62 },
{ "au_coreplay_unchoose_v120_a", 63 },
{ "au_coreplay_clear_v120_a", 64 },
{ "au_sfx_ui_button_corePlay_choose_ice1", 65 },
{ "au_sfx_ui_button_corePlay_choose_ice2", 65 },
{ "au_sfx_ui_button_corePlay_choose_ice3", 65 },
{ "au_sfx_ui_button_corePlay_unchoose_ice1", 66 },
{ "au_sfx_ui_button_corePlay_unchoose_ice2", 66 },
{ "au_sfx_ui_button_corePlay_unchoose_ice3", 66 },
{ "au_sfx_ui_button_corePlay_clear_ice1", 67 },
{ "au_sfx_ui_button_corePlay_clear_ice2", 67 },
{ "au_sfx_ui_button_corePlay_clear_ice3", 67 },
{ "au_sfx_ui_button_corePlay_choose_cloud1", 68 },
{ "au_sfx_ui_button_corePlay_choose_cloud2", 68 },
{ "au_sfx_ui_button_corePlay_choose_cloud3", 68 },
{ "au_sfx_ui_button_corePlay_unchoose_cloud1", 69 },
{ "au_sfx_ui_button_corePlay_unchoose_cloud2", 69 },
{ "au_sfx_ui_button_corePlay_unchoose_cloud3", 69 },
{ "au_sfx_ui_button_corePlay_clear_cloud1", 70 },
{ "au_sfx_ui_button_corePlay_clear_cloud2", 70 },
{ "au_sfx_ui_button_corePlay_clear_cloud3", 70 },
};
public static readonly HashSet<string> AmbiguousNames = new()
@@ -147,6 +130,33 @@ public static class AudioObjectDefinitions
"Chinese Number 08",
"Chinese Number 09",
"Chinese Number 10",
"0,62",
"1,65",
"2,68",
"0,63",
"1,66",
"2,69",
"0,64",
"1,67",
"2,70",
"au_sfx_ui_button_corePlay_choose_ice1",
"au_sfx_ui_button_corePlay_choose_ice2",
"au_sfx_ui_button_corePlay_choose_ice3",
"au_sfx_ui_button_corePlay_unchoose_ice1",
"au_sfx_ui_button_corePlay_unchoose_ice2",
"au_sfx_ui_button_corePlay_unchoose_ice3",
"au_sfx_ui_button_corePlay_clear_ice1",
"au_sfx_ui_button_corePlay_clear_ice2",
"au_sfx_ui_button_corePlay_clear_ice3",
"au_sfx_ui_button_corePlay_choose_cloud1",
"au_sfx_ui_button_corePlay_choose_cloud2",
"au_sfx_ui_button_corePlay_choose_cloud3",
"au_sfx_ui_button_corePlay_unchoose_cloud1",
"au_sfx_ui_button_corePlay_unchoose_cloud2",
"au_sfx_ui_button_corePlay_unchoose_cloud3",
"au_sfx_ui_button_corePlay_clear_cloud1",
"au_sfx_ui_button_corePlay_clear_cloud2",
"au_sfx_ui_button_corePlay_clear_cloud3",
};
}
}