Path: blob/main/Scripts/Secrets/MessageText.txt
1319 views
//----------------Sonic CD Message Text Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value1 : Object.Index67// Text Info type8#alias 0 : TEXTINFO_TEXTDATA9#alias 1 : TEXTINFO_TEXTSIZE101112sub ObjectDraw1314ArrayPos0 = 01516// Get how long the target text line is17GetTextInfo(TempValue1, MENU_1, TEXTINFO_TEXTSIZE, Object.Index, 0)1819// The text should be just about aligned to the center, so do some maths based on the character length to make that happen20TempValue2 = TempValue121TempValue2 <<= 1822FlipSign(TempValue2)23TempValue2 += Object.XPos2425// Loop through all the characters in the message26while TempValue1 > 02728// Get the actual character at the current char pos29GetTextInfo(TempValue0, MENU_1, TEXTINFO_TEXTDATA, Object.Index, ArrayPos0)3031Object.Frame = 03233// Take uppercase letters and turn them into a matching Sprite Frame34if TempValue0 > 6435if TempValue0 < 9136Object.Frame = TempValue037Object.Frame -= 6438end if39end if4041// Take lowercase letters and turn them into a matching Sprite Frame42if TempValue0 > 9643if TempValue0 < 12344Object.Frame = TempValue045Object.Frame -= 9646end if47end if4849// Notably, the space character (32) is skipped over here, as it shouldn't draw anything5051if Object.Frame > 052// The the letter, but only if it's a valid one53DrawSpriteXY(Object.Frame, TempValue2, Object.YPos)54end if5556// Move to the next letter57ArrayPos0++5859// And decrease the remaining letter count, as well60TempValue1--6162// Each letter should be spaced 8 pixels apart63TempValue2 += 0x8000064loop65end sub666768sub ObjectStartup69LoadSpriteSheet("Secrets/SecretMenus.gif")7071SpriteFrame(0, 0, 0, 0, 0, 0) // #0 - Dummy Sprite7273// #1 -> #26 - Alphabet74// (Using loops to automate Sprite Framing)75TempValue1 = 4976while TempValue1 < 10077TempValue0 = 3778while TempValue0 < 13679SpriteFrame(-3, -6, 8, 16, TempValue0, TempValue1)80TempValue0 += 981loop8283TempValue1 += 1784loop8586end sub878889// ========================90// Editor Subs91// ========================9293sub RSDKDraw94TempValue0 = 095while TempValue0 < 496DrawSprite(TempValue0)97TempValue0++98loop99end sub100101102sub RSDKLoad103LoadSpriteSheet("Secrets/SecretMenus.gif")104SpriteFrame(0, -6, 8, 16, 109, 117)105SpriteFrame(9, -6, 8, 16, 73, 100)106SpriteFrame(18, -6, 8, 16, 46, 134)107SpriteFrame(27, -6, 8, 16, 109, 117)108109SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")110end sub111112113