Path: blob/main/Scripts/LBoards/MenuControl.txt
1319 views
//-----------------Sonic CD Menu Control Script---------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//3//------------------Only exist in WP7 Versions----------------//45// Aliases6#alias Object.Value0 : Object.Timer // Also used for fading7#alias Object[32].State : LEntry.State89// States10#alias 0 : MENUCONTROL_SETUP11#alias 1 : MENUCONTROL_FADEIN12#alias 2 : MENUCONTROL_CONTROLS13#alias 3 : MENUCONTROL_BLANK14#alias 4 : MENUCONTROL_EXIT1516// LEntry States17#alias 1 : LENTRY_MOVE_RIGHT18#alias 4 : LENTRY_MOVE_LEFT19#alias 7 : LENTRY_MOVE_DOWN20#alias 10 : LENTRY_MOVE_UP2122// Presentation Stages23#alias 1 : STAGE_P_MENU2425// Soundtrack26#alias 0 : OST_JP2728// Global SFX29#alias 23 : SFX_G_MENUBUTTON30#alias 27 : SFX_G_SELECT3132// Engine & Callbacks33#alias 3 : CALLBACK_TATTACK_NOTIFY_EXIT343536sub ObjectMain37switch Object.State38case MENUCONTROL_SETUP39Object.State = MENUCONTROL_FADEIN40Object.Timer = 38441SetScreenFade(0, 0, 0, 255)42PlayMusic(0)43break4445case MENUCONTROL_FADEIN46if Object.Timer > 047Object.Timer -= 848Object.Scale -= 409649else50Object.State = MENUCONTROL_CONTROLS51end if52SetScreenFade(0, 0, 0, Object.Timer)53break5455case MENUCONTROL_CONTROLS56if KeyPress[0].Left == true57Object.State = MENUCONTROL_BLANK58LEntry.State = LENTRY_MOVE_LEFT59PlaySfx(SFX_G_MENUBUTTON, false)60end if6162if KeyPress[0].Right == true63Object.State = MENUCONTROL_BLANK64LEntry.State = LENTRY_MOVE_RIGHT65PlaySfx(SFX_G_MENUBUTTON, false)66end if6768if KeyPress[0].Up == true69Object.State = MENUCONTROL_BLANK70LEntry.State = LENTRY_MOVE_UP71PlaySfx(SFX_G_MENUBUTTON, false)72end if7374if KeyPress[0].Down == true75Object.State = MENUCONTROL_BLANK76LEntry.State = LENTRY_MOVE_DOWN77PlaySfx(SFX_G_MENUBUTTON, false)78end if7980if KeyPress[0].ButtonB == true81Object.State = MENUCONTROL_EXIT82StopMusic()83PlaySfx(SFX_G_SELECT, false)84end if85break8687case MENUCONTROL_BLANK88break8990case MENUCONTROL_EXIT91if Object.Timer < 38492Object.Timer += 893Object.Scale += 409694else95Stage.ListPos = STAGE_P_MENU96LoadStage()97end if98SetScreenFade(0, 0, 0, Object.Timer)99EngineCallback(CALLBACK_TATTACK_NOTIFY_EXIT)100break101102end switch103end sub104105106sub ObjectStartup107if Options.Soundtrack == OST_JP108SetMusicTrack("JP/TimeAttack.ogg", 0, 100512)109else110SetMusicTrack("US/DAGarden.ogg", 0, 117382)111end if112Object[0].Type = TypeName[Menu Control]113Object[0].DrawOrder = 1114Options.PhysicalControls = false115end sub116117118// ========================119// Editor Subs120// ========================121122sub RSDKDraw123DrawSprite(0)124end sub125126127sub RSDKLoad128LoadSpriteSheet("Global/Display.gif")129SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon130131SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")132end sub133134135