so many bugs i cannot even breathe

This commit is contained in:
bryanthaboi
2026-07-30 07:41:41 -04:00
parent e63fa70700
commit 0f581e2f69
78 changed files with 7729 additions and 523 deletions
+14 -2
View File
@@ -225,11 +225,23 @@ function Commands.give_item(ctx, itemId, count, gotText)
ctx.game.stringBuffer = def and def.name or itemId
-- the jingle rides the box -- Sound.play routes fanfares through
-- Music.duckForFanfare, like PlaySoundWaitForCurrent
require("src.core.Sound").play(ctx.game.data,
(def and def.keyItem) and "Get_Key_Item" or "Get_Item1")
local Sound = require("src.core.Sound")
local jingle = (def and def.keyItem) and "Get_Key_Item" or "Get_Item1"
if gotText ~= false then
-- the gift texts carry the jingle as a trailing text command
-- (sound_get_item_1 / sound_get_key_item -> home/text.asm
-- TextCommand_SOUND), so it only fires once the last page has typed
-- out, blocks on WaitForSoundToFinish, and AfterDisplayingTextID's
-- button wait runs after it (#374)
ctx.textOpts = ctx.textOpts or {}
ctx.textOpts.auto = {
sound = function() return Sound.play(ctx.game.data, jingle) end,
wait = true,
}
Commands.show_text(ctx, gotText
or Strings("{PLAYER} got\n%s!", ctx.game.stringBuffer))
else
Sound.play(ctx.game.data, jingle)
end
end