Update CS

This commit is contained in:
Agent X 2024-12-27 17:22:59 -05:00
parent 261dfe0d76
commit 3fad60f725
2 changed files with 23 additions and 2 deletions

View file

@ -466,7 +466,10 @@ end
local function boot_note() local function boot_note()
if #characterTable > 1 then if #characterTable > 1 then
djui_chat_message_create("Character Select has " .. (#characterTable - 1) .. " character" .. (#characterTable > 2 and "s" or "") .. " available!\nYou can use \\#ffff33\\/char-select \\#ffffff\\to open the menu!") djui_chat_message_create("Character Select has " .. (#characterTable - 1) .. " character" .. (#characterTable > 2 and "s" or "") .." available!\nYou can use \\#ffff33\\/char-select \\#ffffff\\to open the menu!")
if #characterTable > 32 and network_is_server() then
djui_chat_message_create("\\#FFAAAA\\Warning: Having more than 32 Characters\nmay be unstable, For a better experience please\ndisable a few packs!")
end
else else
djui_chat_message_create("Character Select is active!\nYou can use \\#ffff33\\/char-select \\#ffffff\\to open the menu!") djui_chat_message_create("Character Select is active!\nYou can use \\#ffff33\\/char-select \\#ffffff\\to open the menu!")
end end

View file

@ -77,9 +77,14 @@ for i = 0, MAX_PLAYERS - 1 do
playerSample[i] = nil playerSample[i] = nil
end end
local joinSoundPlayed = false
--- @param m MarioState --- @param m MarioState
--- @param sound CharacterSound --- @param sound CharacterSound
local function custom_character_sound(m, sound) local function custom_character_sound(m, sound)
if not joinSoundPlayed then
joinSoundPlayed = true
return NO_SOUND
end
local index = m.playerIndex local index = m.playerIndex
if check_sound_exists(playerSample[index]) and type(playerSample[index]) ~= TYPE_STRING then if check_sound_exists(playerSample[index]) and type(playerSample[index]) ~= TYPE_STRING then
audio_sample_stop(playerSample[index]) audio_sample_stop(playerSample[index])
@ -199,4 +204,17 @@ local function config_character_sounds()
hook_event(HOOK_CHARACTER_SOUND, custom_character_sound) hook_event(HOOK_CHARACTER_SOUND, custom_character_sound)
hook_event(HOOK_MARIO_UPDATE, custom_character_snore) hook_event(HOOK_MARIO_UPDATE, custom_character_snore)
end end
_G.charSelect.config_character_sounds = config_character_sounds _G.charSelect.config_character_sounds = config_character_sounds
-- Join sound
local stallTimer = 0
local function mario_update(m)
if m.playerIndex ~= 0 then return end
if stallTimer == 3 then
play_character_sound(m, CHAR_SOUND_OKEY_DOKEY)
stallTimer = stallTimer + 1
elseif stallTimer < 10 then
stallTimer = stallTimer + 1
end
end
hook_event(HOOK_MARIO_UPDATE, mario_update)