Path: blob/main/Scripts/Menu/MenuButton.txt
1319 views
//----------------Sonic CD Menu Button Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer6#alias Object.Value1 : Object.ButtonXOffSet7#alias Object.Value2 : Object.ButtonYOffSet8#alias Object.Value3 : Object.ButtonLeaveXPos9#alias Object.Value4 : Object.ButtonLeaveYPos10#alias Object.Value5 : Object.ButtonYPos1112// Object[1] is a blank object just to share values13#alias Object[1].Value1 : Object.RecenterValue14#alias Object[1].Value2 : Object.ButtonCount15#alias Object[1].Value3 : Object.DragLimit1617// MenuHeading Aliases18#alias Object[33].State : MenuHeading.State19#alias Object[33].PropertyValue : MenuHeading.Header2021// Object[-1] and [+1] are MenuButton's22#alias Object[-1].State : PrevMenuButton.State23#alias Object[+1].State : NextMenuButton.State2425// MenuControl Aliases26#alias Object[0].State : MenuControl.State27#alias Object[0].Value0 : MenuControl.Fade28#alias Object[0].Value1 : MenuControl.ButtonYOffset29#alias Object[0].Value2 : MenuControl.CurrentDrag30#alias Object[0].Value3 : MenuControl.CurrentSelection31#alias Object[0].Value7 : MenuControl.SmoothDrag3233// MenuWindow Aliases34#alias Object[61].State : MenuWindow.State35#alias Object[61].XPos : MenuWindow.XPos36#alias Object[61].YPos : MenuWindow.YPos37#alias Object[61].Value1 : MenuWindow.BaseWidth38#alias Object[61].Value2 : MenuWindow.BaseHeight39#alias Object[61].Value3 : MenuWindow.BaseXOffset40#alias Object[61].Value4 : MenuWindow.BaseYOffset41#alias Object[61].Value5 : MenuWindow.EntityPos4243// Object[62] is whatever next menu is this object going to be set into44#alias Object[62].InkEffect : Object.NextMenuInkEffect45#alias Object[62].Alpha : Object.NextMenuAlpha4647// States48#alias 0 : MENUBUTTON_DELAY49#alias 1 : MENUBUTTON_BUTTONS_IN50#alias 2 : MENUBUTTON_CONFIRM_SELECTION51#alias 3 : MENUBUTTON_MENU_SELECTED52#alias 4 : MENUBUTTON_BUTTONS_OUT53#alias 5 : MENUBUTTON_BLANK54#alias 6 : MENUBUTTON_BLANK255#alias 7 : MENUBUTTON_RESET5657// Menu Control States58#alias 2 : MENUCONTROL_CONTROLS59#alias 3 : MENUCONTROL_BLANK60#alias 4 : MENUCONTROL_ENTER_TIMEATTACK61#alias 5 : MENUCONTROL_ENTER_DEMO62#alias 7 : MENUCONTROL_ENTER_TROPHIES63#alias 8 : MENUCONTROL_ENTER_LEADERBOARDS6465// Menu Window States66#alias 5 : MENUWINDOW_SOUNDTRACK_EXPAND6768// Menu Heading States69#alias 0 : MENUHEADING_IDLE70#alias 1 : MENUHEADING_LEAVE_SCREEN71#alias 2 : MENUHEADING_ENTER_SCREEN7273// Menu Heading Property Values74#alias 5 : MAINMENU_HEADER75#alias 6 : SAVESELECT_HEADER76#alias 7 : HELP&OPTIONS_HEADER77#alias 8 : EXTRAS_HEADER78#alias 9 : SOUNDTRACK_HEADER79#alias 10 : STAGESELECT_HEADER8081// Menus82#alias 1 : Menu_LoadSaveMenu83#alias 2 : Menu_TimeAttack84#alias 3 : Menu_Achievements85#alias 4 : Menu_LeaderBoards86#alias 5 : Menu_Help&Options87#alias 6 : Menu_Extras88#alias 7 : Menu_UnlockFullGame89#alias 8 : Menu_Store90#alias 9 : Menu_Exit91#alias 10 : Menu_Soundtrack92#alias 11 : Menu_MoreGames9394// Ink Effects95#alias 2 : INK_ALPHA9697// Priority98#alias 1 : PRIORITY_ACTIVE99100// Game Mode Aliases101#alias 0 : MODE_NOSAVE102103// Languages104#alias 0 : LANG_ENGLISH105#alias 1 : LANG_FRENCH106#alias 2 : LANG_ITALIAN107#alias 3 : LANG_DEUTSCH108#alias 4 : LANG_SPANISH109#alias 5 : LANG_JAPANESE110111// Global SFX112#alias 27 : SFX_G_SELECT113114// Engine & Callbacks115#alias 3 : ENGINE_EXITGAME116#alias 5 : CALLBACK_RETURNSTORE_SELECTED117#alias 7 : CALLBACK_EXIT_SELECTED118#alias 8 : CALLBACK_BUY_FULL_GAME_SELECTED119#alias 14 : CALLBACK_FULL_VERSION_ONLY120#alias 16 : CALLBACK_MOREGAMES121122// Online Menus123#alias 0 : ONLINEMENU_ACHIEVEMENTS124#alias 1 : ONLINEMENU_LEADERBOARDS125126// game.mainMenuMode Aliases127#alias 0 : MAINMENUMODE_NONE // Starts with this, but gets swapped on MenuButton128129130// Function declarations131#function MenuButton_SetupMenuWindow132133function MenuButton_SetupMenuWindow134ResetObjectEntity(61, TypeName[Menu Window], 0, Object.XPos, Object.YPos)135MenuWindow.XPos += 0x480000136MenuWindow.BaseWidth = 144137MenuWindow.BaseHeight = 21138MenuWindow.BaseXOffset = MenuWindow.XPos139MenuWindow.BaseYOffset = MenuWindow.YPos140MenuWindow.EntityPos = Object.EntityNo141end function142143144sub ObjectMain145Object.ButtonYOffSet = Object.ButtonYPos146Object.ButtonYOffSet--147Object.ButtonYOffSet *= 60148Object.ButtonYOffSet += MenuControl.ButtonYOffset149150TempValue0 = Screen.CenterX151TempValue0 -= 160152153Object.ButtonXOffSet = Object.ButtonYOffSet154Object.ButtonXOffSet *= 54155Object.ButtonXOffSet /= 60156Object.ButtonXOffSet -= 16157Object.ButtonXOffSet += TempValue0158159switch Object.State160case MENUBUTTON_DELAY161if Object.Timer < 60162Object.Timer++163else164Object.Timer = 0165Object.State++166end if167break168169case MENUBUTTON_BUTTONS_IN170TempValue0 = Object.ButtonXOffSet171TempValue0 <<= 16172TempValue0 -= Object.XPos173TempValue0 >>= 4174Object.XPos += TempValue0175176TempValue0 = Object.ButtonYOffSet177TempValue0 <<= 16178TempValue0 -= Object.YPos179TempValue0 >>= 4180Object.YPos += TempValue0181182if Object.Timer < 80183Object.Timer++184else185Object.Timer = 0186Object.State++187end if188break189190case MENUBUTTON_CONFIRM_SELECTION191Object.XPos = Object.ButtonXOffSet192Object.XPos <<= 16193194Object.YPos = Object.ButtonYOffSet195Object.YPos <<= 16196197// Originally if Options.PhysicalControls == false198// Adapted the code to ensure compatibility with Blit Data files199#platform: Standard200CheckResult = false201#endplatform202203#platform: Mobile204CheckEqual(Options.PhysicalControls, false)205#endplatform206207#platform: Use_Origins208CheckEqual(Options.PhysicalControls, false)209#endplatform210211if CheckResult == true212TempValue0 = Object.ButtonXOffSet213TempValue0 -= 16214TempValue1 = Object.ButtonXOffSet215TempValue1 += 176216TempValue2 = Object.ButtonYOffSet217TempValue2 -= 20218TempValue3 = Object.ButtonYOffSet219TempValue3 += 20220CheckTouchRect(TempValue0, TempValue2, TempValue1, TempValue3)221if CheckResult > -1222TempValue0 = MenuControl.SmoothDrag223TempValue0 >>= 2224if TempValue0 == 0225if Object.RecenterValue == 0226MenuControl.CurrentDrag = Object.ButtonYPos227end if228end if229else230CheckTouchRect(0, 0, Screen.XSize, Screen.YSize)231if CheckResult < 0232if MenuControl.CurrentDrag == Object.ButtonYPos233if Object.RecenterValue == 0234PlaySfx(SFX_G_SELECT, false)235MenuControl.State = MENUCONTROL_BLANK236switch Object.PropertyValue237case Menu_LoadSaveMenu238case Menu_Help&Options239case Menu_Extras240case Menu_Soundtrack //All of this is MenuButton241Object[34].State = MENUBUTTON_BUTTONS_OUT242Object[34].Timer = 0243Object[35].State = MENUBUTTON_BUTTONS_OUT244Object[35].Timer = 0245Object[36].State = MENUBUTTON_BUTTONS_OUT246Object[36].Timer = 0247Object[37].State = MENUBUTTON_BUTTONS_OUT248Object[37].Timer = 0249Object[38].State = MENUBUTTON_BUTTONS_OUT250Object[38].Timer = 0251Object[39].State = MENUBUTTON_BUTTONS_OUT252Object[39].Timer = 0253Object[40].State = MENUBUTTON_BUTTONS_OUT254Object[40].Timer = 0255Object[41].State = MENUBUTTON_BUTTONS_OUT256Object[41].Timer = 0257Object[42].State = MENUBUTTON_BUTTONS_OUT258Object[42].Timer = 0259Object[43].State = MENUBUTTON_BUTTONS_OUT260Object[43].Timer = 0261break262263case Menu_TimeAttack264if Engine.TrialMode == false265StopMusic()266Object[34].State = MENUBUTTON_BUTTONS_OUT267Object[34].Timer = 0268Object[35].State = MENUBUTTON_BUTTONS_OUT269Object[35].Timer = 0270Object[36].State = MENUBUTTON_BUTTONS_OUT271Object[36].Timer = 0272Object[37].State = MENUBUTTON_BUTTONS_OUT273Object[37].Timer = 0274Object[38].State = MENUBUTTON_BUTTONS_OUT275Object[38].Timer = 0276Object[39].State = MENUBUTTON_BUTTONS_OUT277Object[39].Timer = 0278Object[40].State = MENUBUTTON_BUTTONS_OUT279Object[40].Timer = 0280Object[41].State = MENUBUTTON_BUTTONS_OUT281Object[41].Timer = 0282Object[42].State = MENUBUTTON_BUTTONS_OUT283Object[42].Timer = 0284Object[43].State = MENUBUTTON_BUTTONS_OUT285Object[43].Timer = 0286end if287break288289end switch290Object.State = MENUBUTTON_MENU_SELECTED291end if292end if293else294if MenuControl.CurrentDrag == Object.ButtonYPos295MenuControl.CurrentDrag = 0296end if297end if298end if299else300if Object.ButtonYPos == MenuControl.CurrentSelection301CheckResult = false302if KeyPress[0].Start == true303CheckResult = true304end if305306if KeyPress[0].ButtonA == true307CheckResult = true308end if309310if Object.PropertyValue == Menu_Achievements311if Engine.OnlineActive == false312CheckResult = false313end if314end if315316if CheckResult == true317PlaySfx(SFX_G_SELECT, false)318if Engine.TrialMode == true319if Engine.PlatformID != RETRO_ANDROID320if Object.PropertyValue == Menu_LoadSaveMenu321StopMusic()322end if323end if324else325if Object.PropertyValue == Menu_TimeAttack326StopMusic()327end if328end if329330MenuControl.State = MENUCONTROL_BLANK331switch Object.PropertyValue332case Menu_LoadSaveMenu333case Menu_Help&Options334case Menu_Extras335case Menu_Soundtrack336Object[34].State = MENUBUTTON_BUTTONS_OUT337Object[34].Timer = 0338Object[35].State = MENUBUTTON_BUTTONS_OUT339Object[35].Timer = 0340Object[36].State = MENUBUTTON_BUTTONS_OUT341Object[36].Timer = 0342Object[37].State = MENUBUTTON_BUTTONS_OUT343Object[37].Timer = 0344Object[38].State = MENUBUTTON_BUTTONS_OUT345Object[38].Timer = 0346Object[39].State = MENUBUTTON_BUTTONS_OUT347Object[39].Timer = 0348Object[40].State = MENUBUTTON_BUTTONS_OUT349Object[40].Timer = 0350Object[41].State = MENUBUTTON_BUTTONS_OUT351Object[41].Timer = 0352Object[42].State = MENUBUTTON_BUTTONS_OUT353Object[42].Timer = 0354Object[43].State = MENUBUTTON_BUTTONS_OUT355Object[43].Timer = 0356break357358case Menu_TimeAttack359if Engine.TrialMode == false360Object[34].State = MENUBUTTON_BUTTONS_OUT361Object[34].Timer = 0362Object[35].State = MENUBUTTON_BUTTONS_OUT363Object[35].Timer = 0364Object[36].State = MENUBUTTON_BUTTONS_OUT365Object[36].Timer = 0366Object[37].State = MENUBUTTON_BUTTONS_OUT367Object[37].Timer = 0368Object[38].State = MENUBUTTON_BUTTONS_OUT369Object[38].Timer = 0370Object[39].State = MENUBUTTON_BUTTONS_OUT371Object[39].Timer = 0372Object[40].State = MENUBUTTON_BUTTONS_OUT373Object[40].Timer = 0374Object[41].State = MENUBUTTON_BUTTONS_OUT375Object[41].Timer = 0376Object[42].State = MENUBUTTON_BUTTONS_OUT377Object[42].Timer = 0378Object[43].State = MENUBUTTON_BUTTONS_OUT379Object[43].Timer = 0380end if381break382383end switch384Object.State = MENUBUTTON_MENU_SELECTED385end if386end if387end if388389if Engine.PlatformID == RETRO_WP7390if KeyPress[0].ButtonB == true391EngineCallback(CALLBACK_EXIT_SELECTED)392Object.State = MENUBUTTON_CONFIRM_SELECTION393394MenuControl.State = MENUCONTROL_CONTROLS395MenuControl.CurrentDrag = 0396end if397end if398break399400case MENUBUTTON_MENU_SELECTED401if Object.Timer < 30402Object.Timer++403else404Object.Timer = 0405switch Object.PropertyValue406case Menu_LoadSaveMenu407if Engine.TrialMode == false408MenuHeading.State = MENUHEADING_LEAVE_SCREEN409MenuHeading.Header = SAVESELECT_HEADER410411CallFunction(MenuButton_SetupMenuWindow)412ResetObjectEntity(62, TypeName[Load Save Menu], 0, 0, 0)413414Object.NextMenuInkEffect = INK_ALPHA415Object.NextMenuAlpha = 0416417ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)418ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)419ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)420ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)421Object.Type = TypeName[Blank Object]422ReadSaveRAM()423else424#platform: Standard425Object.State = MENUBUTTON_BLANK426MenuControl.State = MENUCONTROL_ENTER_DEMO427MenuControl.Fade = 0428429Options.GameMode = MODE_NOSAVE430Player.Score = 0431Player.Lives = 3432Player.ScoreBonus = 50000433Transporter_Destroyed = false434MetalSonic_Destroyed = false435Good_Future = false436#endplatform437438#platform: Mobile439440MenuHeading.State = MENUHEADING_LEAVE_SCREEN441MenuHeading.Header = STAGESELECT_HEADER442443CallFunction(MenuButton_SetupMenuWindow)444MenuWindow.State = MENUWINDOW_SOUNDTRACK_EXPAND445ResetObjectEntity(62, TypeName[Demo Menu], 0, 0, 0)446447Object.NextMenuInkEffect = INK_ALPHA448Object.NextMenuAlpha = 0449450ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)451ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)452ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)453ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)454Object.Type = TypeName[Blank Object]455ReadSaveRAM()456#endplatform457end if458break459460case Menu_TimeAttack461if Engine.TrialMode == false462Object.State = MENUBUTTON_BLANK463464MenuControl.State = MENUCONTROL_ENTER_TIMEATTACK465MenuControl.Fade = 0466else467Object.State = MENUBUTTON_CONFIRM_SELECTION468469MenuControl.State = MENUCONTROL_CONTROLS470EngineCallback(CALLBACK_FULL_VERSION_ONLY)471#platform: Mobile472MenuControl.CurrentDrag = 0473#endplatform474end if475break476477case Menu_Achievements478if Engine.PlatformID != RETRO_WP7479LoadOnlineMenu(ONLINEMENU_ACHIEVEMENTS)480Object.State = MENUBUTTON_CONFIRM_SELECTION481482MenuControl.State = MENUCONTROL_CONTROLS483#platform: Mobile484MenuControl.CurrentDrag = 0485#endplatform486else487Object.State = MENUBUTTON_BLANK488489MenuControl.State = MENUCONTROL_ENTER_TROPHIES490MenuControl.Fade = 0491end if492break493494case Menu_LeaderBoards495if Engine.PlatformID!=RETRO_WP7496LoadOnlineMenu(ONLINEMENU_LEADERBOARDS)497Object.State = MENUBUTTON_CONFIRM_SELECTION498499MenuControl.State = MENUCONTROL_CONTROLS500#platform: Mobile501MenuControl.CurrentDrag = 0502#endplatform503else504if Engine.TrialMode == false505Object.State = MENUBUTTON_BLANK506507MenuControl.State = MENUCONTROL_ENTER_LEADERBOARDS508MenuControl.Fade = 0509else510Object.State = MENUBUTTON_CONFIRM_SELECTION511512MenuControl.State = MENUCONTROL_CONTROLS513EngineCallback(CALLBACK_FULL_VERSION_ONLY)514end if515end if516break517518case Menu_Help&Options519MenuHeading.State = MENUHEADING_LEAVE_SCREEN520MenuHeading.Header = HELP&OPTIONS_HEADER521522CallFunction(MenuButton_SetupMenuWindow)523#platform: Use_Standalone524#platform: Standard525ResetObjectEntity(62, TypeName[Options Menu C], 0, 0, 0)526#endplatform527528#platform: Mobile529if Options.HapticsMenu == true530ResetObjectEntity(62, TypeName[Options Menu H], 0, 0, 0)531else532ResetObjectEntity(62, TypeName[Options Menu], 0, 0, 0)533end if534#endplatform535#endplatform536537#platform: Use_Origins538if Options.DevMenuFlag == true539ResetObjectEntity(62, TypeName[Options Menu H], 0, 0, 0)540else541ResetObjectEntity(62, TypeName[Options Menu], 0, 0, 0)542end if543#endplatform544545Object.NextMenuInkEffect = INK_ALPHA546Object.NextMenuAlpha = 0547548ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)549ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)550ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)551ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)552Object.Type = TypeName[Blank Object]553break554555case Menu_Extras556MenuHeading.State = MENUHEADING_LEAVE_SCREEN557MenuHeading.Header = EXTRAS_HEADER558559CallFunction(MenuButton_SetupMenuWindow)560ResetObjectEntity(62, TypeName[Extras Menu], 0, 0, 0)561562Object.NextMenuInkEffect = INK_ALPHA563Object.NextMenuAlpha = 0564565ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)566ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)567ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)568ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)569Object.Type = TypeName[Blank Object]570break571572case Menu_UnlockFullGame573EngineCallback(CALLBACK_BUY_FULL_GAME_SELECTED)574Object.State = MENUBUTTON_CONFIRM_SELECTION575576MenuControl.State = MENUCONTROL_CONTROLS577#platform: Mobile578MenuControl.CurrentDrag = 0579#endplatform580break581582case Menu_Store583EngineCallback(CALLBACK_RETURNSTORE_SELECTED)584Object.State = MENUBUTTON_CONFIRM_SELECTION585586MenuControl.State = MENUCONTROL_CONTROLS587#platform: Mobile588MenuControl.CurrentDrag = 0589#endplatform590break591592case Menu_Exit593EngineCallback(CALLBACK_EXIT_SELECTED)594#platform: Use_Decomp595Engine.State = ENGINE_EXITGAME596#endplatform597Object.State = MENUBUTTON_CONFIRM_SELECTION598599MenuControl.State = MENUCONTROL_CONTROLS600#platform: Mobile601MenuControl.CurrentDrag = 0602#endplatform603break604605case Menu_Soundtrack606MenuHeading.State = MENUHEADING_LEAVE_SCREEN607MenuHeading.Header = SOUNDTRACK_HEADER608609CallFunction(MenuButton_SetupMenuWindow)610MenuWindow.State = MENUWINDOW_SOUNDTRACK_EXPAND611ResetObjectEntity(62, TypeName[Soundtrack Menu], 0, 0, 0)612613Object.NextMenuInkEffect = INK_ALPHA614Object.NextMenuAlpha = 0615616ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)617ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)618ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)619ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)620Object.Type = TypeName[Blank Object]621break622623#platform: Mobile624case Menu_MoreGames625EngineCallback(CALLBACK_MOREGAMES)626Object.State = MENUBUTTON_CONFIRM_SELECTION627628MenuControl.State = MENUCONTROL_CONTROLS629MenuControl.CurrentDrag = 0630break631#endplatform632end switch633end if634break635636case MENUBUTTON_BUTTONS_OUT637TempValue0 = Object.ButtonLeaveXPos638TempValue0 -= Object.XPos639TempValue0 >>= 4640Object.XPos += TempValue0641642TempValue0 = Object.ButtonLeaveYPos643TempValue0 -= Object.YPos644TempValue0 >>= 4645Object.YPos += TempValue0646647if Object.Timer < 80648Object.Timer++649else650Object.Timer = 0651Object.State = MENUBUTTON_BLANK2652end if653break654655case MENUBUTTON_BLANK656case MENUBUTTON_BLANK2657//Nothing happens here658break659660case MENUBUTTON_RESET //Used by MenuWindow661if Object.PropertyValue == Menu_Extras662if PrevMenuButton.State == MENUBUTTON_CONFIRM_SELECTION663Object.State = MENUBUTTON_CONFIRM_SELECTION664665MenuControl.State = MENUCONTROL_CONTROLS666#platform: Mobile667MenuControl.CurrentDrag = 0668#endplatform669end if670else671if NextMenuButton.State == MENUBUTTON_CONFIRM_SELECTION672Object.State = MENUBUTTON_CONFIRM_SELECTION673674MenuControl.State = MENUCONTROL_CONTROLS675#platform: Mobile676MenuControl.CurrentDrag = 0677#endplatform678end if679end if680break681682end switch683end sub684685686687sub ObjectDraw688DrawSprite(0)689switch Object.State690case MENUBUTTON_DELAY691case MENUBUTTON_BUTTONS_IN692case MENUBUTTON_CONFIRM_SELECTION693case MENUBUTTON_BUTTONS_OUT694case MENUBUTTON_BLANK695case MENUBUTTON_RESET696if Object.ButtonYPos == MenuControl.CurrentSelection697TempValue0 = Object.PropertyValue698TempValue0 += 11699DrawSprite(TempValue0)700else701DrawSprite(Object.PropertyValue)702end if703break704705case MENUBUTTON_MENU_SELECTED706TempValue0 = Object.Timer707TempValue0 &= 3708TempValue0 >>= 1709if TempValue0 == 0710TempValue0 = Object.PropertyValue711TempValue0 += 11712713DrawSprite(TempValue0)714end if715break716717end switch718end sub719720721sub ObjectStartup722switch Engine.Language723case LANG_ENGLISH724LoadSpriteSheet("Menu/MenuGfx2_EN.gif")725break726case LANG_FRENCH727LoadSpriteSheet("Menu/MenuGfx2_FR.gif")728break729case LANG_ITALIAN730LoadSpriteSheet("Menu/MenuGfx2_IT.gif")731break732case LANG_DEUTSCH733LoadSpriteSheet("Menu/MenuGfx2_DE.gif")734break735case LANG_SPANISH736LoadSpriteSheet("Menu/MenuGfx2_ES.gif")737break738case LANG_JAPANESE739LoadSpriteSheet("Menu/MenuGfx2_JP.gif")740break741end switch742743Object.ButtonCount = 1744ArrayPos0 = 32745while ArrayPos0 < 1056746if Object[ArrayPos0].Type == TypeName[Menu Button]747Object[ArrayPos0].Priority = PRIORITY_ACTIVE748Object[ArrayPos0].ButtonLeaveXPos = Object[ArrayPos0].XPos749Object[ArrayPos0].ButtonLeaveYPos = Object[ArrayPos0].ButtonLeaveYPos750end if751ArrayPos0++752loop753754switch Engine.PlatformID755case RETRO_WIN756case RETRO_OSX757if Options.DevMenuFlag == true758Object[34].PropertyValue = Menu_LoadSaveMenu759Object[35].PropertyValue = Menu_TimeAttack760Object[36].PropertyValue = Menu_Help&Options761Object[37].PropertyValue = Menu_Soundtrack762Object[38].PropertyValue = Menu_Extras763Object[39].PropertyValue = Menu_Exit764Object.ButtonCount = 6765else766if Engine.TrialMode == true767Object[34].PropertyValue = Menu_LoadSaveMenu768Object[35].PropertyValue = Menu_TimeAttack769Object[36].PropertyValue = Menu_Achievements770Object[37].PropertyValue = Menu_LeaderBoards771Object[38].PropertyValue = Menu_Help&Options772Object[39].PropertyValue = Menu_Soundtrack773Object[40].PropertyValue = Menu_UnlockFullGame774Object[41].PropertyValue = Menu_Exit775Object.ButtonCount = 8776else777Object[34].PropertyValue = Menu_LoadSaveMenu778Object[35].PropertyValue = Menu_TimeAttack779Object[36].PropertyValue = Menu_Achievements780Object[37].PropertyValue = Menu_LeaderBoards781Object[38].PropertyValue = Menu_Help&Options782Object[39].PropertyValue = Menu_Soundtrack783Object[40].PropertyValue = Menu_Extras784Object[41].PropertyValue = Menu_Exit785Object.ButtonCount = 8786end if787end if788break789790case RETRO_XBOX_360791if Engine.TrialMode == true792Object[34].PropertyValue = Menu_LoadSaveMenu793Object[35].PropertyValue = Menu_TimeAttack794Object[36].PropertyValue = Menu_Achievements795Object[37].PropertyValue = Menu_LeaderBoards796Object[38].PropertyValue = Menu_Help&Options797Object[39].PropertyValue = Menu_Soundtrack798Object[40].PropertyValue = Menu_UnlockFullGame799Object[41].PropertyValue = Menu_Exit800Object.ButtonCount = 8801else802Object[34].PropertyValue = Menu_LoadSaveMenu803Object[35].PropertyValue = Menu_TimeAttack804Object[36].PropertyValue = Menu_Achievements805Object[37].PropertyValue = Menu_LeaderBoards806Object[38].PropertyValue = Menu_Help&Options807Object[39].PropertyValue = Menu_Soundtrack808Object[40].PropertyValue = Menu_Extras809Object[41].PropertyValue = Menu_Exit810Object.ButtonCount = 8811end if812break813814case RETRO_PS3815if Engine.TrialMode == true816Object[34].PropertyValue = Menu_LoadSaveMenu817Object[35].PropertyValue = Menu_TimeAttack818Object[36].PropertyValue = Menu_Achievements819Object[37].PropertyValue = Menu_LeaderBoards820Object[38].PropertyValue = Menu_Help&Options821Object[39].PropertyValue = Menu_Soundtrack822Object[40].PropertyValue = Menu_UnlockFullGame823Object.ButtonCount = 7824else825Object[34].PropertyValue = Menu_LoadSaveMenu826Object[35].PropertyValue = Menu_TimeAttack827Object[36].PropertyValue = Menu_Achievements828Object[37].PropertyValue = Menu_LeaderBoards829Object[38].PropertyValue = Menu_Help&Options830Object[39].PropertyValue = Menu_Soundtrack831Object[40].PropertyValue = Menu_Extras832Object.ButtonCount = 7833end if834break835836case RETRO_ANDROID837if Engine.TrialMode == true838Object[34].PropertyValue = Menu_LoadSaveMenu839Object[35].PropertyValue = Menu_Help&Options840Object[36].PropertyValue = Menu_Soundtrack841Object[37].PropertyValue = Menu_UnlockFullGame842Object[38].PropertyValue = Menu_Exit843Object.ButtonCount = 5844else845if Engine.OnlineActive == true846Object[34].PropertyValue = Menu_LoadSaveMenu847Object[35].PropertyValue = Menu_TimeAttack848Object[36].PropertyValue = Menu_LeaderBoards849Object[37].PropertyValue = Menu_Achievements850Object[38].PropertyValue = Menu_Help&Options851Object[39].PropertyValue = Menu_Soundtrack852Object[40].PropertyValue = Menu_Extras853Object[41].PropertyValue = Menu_Exit854Object.ButtonCount = 8855else856Object[34].PropertyValue = Menu_LoadSaveMenu857Object[35].PropertyValue = Menu_TimeAttack858Object[36].PropertyValue = Menu_Help&Options859Object[37].PropertyValue = Menu_MoreGames860Object[38].PropertyValue = Menu_Soundtrack861Object[39].PropertyValue = Menu_Extras862Object[40].PropertyValue = Menu_Exit863Object.ButtonCount = 7864Object[37].PropertyValue = Menu_Soundtrack865Object[38].PropertyValue = Menu_Extras866Object[39].PropertyValue = Menu_Exit867Object.ButtonCount = 6868end if869end if870break871872case RETRO_iOS873if Engine.OnlineActive == true874Object[34].PropertyValue = Menu_LoadSaveMenu875Object[35].PropertyValue = Menu_TimeAttack876Object[36].PropertyValue = Menu_LeaderBoards877Object[37].PropertyValue = Menu_Help&Options878Object[38].PropertyValue = Menu_Soundtrack879Object[39].PropertyValue = Menu_Extras880Object.ButtonCount = 6881else882Object[34].PropertyValue = Menu_LoadSaveMenu883Object[35].PropertyValue = Menu_TimeAttack884Object[36].PropertyValue = Menu_Help&Options885Object[37].PropertyValue = Menu_Soundtrack886Object[38].PropertyValue = Menu_Extras887Object.ButtonCount = 5888end if889break890891case RETRO_WP7892if Engine.TrialMode == true893Object[34].PropertyValue = Menu_LoadSaveMenu894Object[35].PropertyValue = Menu_Help&Options895Object[36].PropertyValue = Menu_Soundtrack896Object[37].PropertyValue = Menu_MoreGames897Object[38].PropertyValue = Menu_Exit898Object.ButtonCount = 5899else900if Engine.OnlineActive == true901Object[34].PropertyValue = Menu_LoadSaveMenu902Object[35].PropertyValue = Menu_TimeAttack903Object[36].PropertyValue = Menu_LeaderBoards904Object[37].PropertyValue = Menu_Achievements905Object[38].PropertyValue = Menu_Help&Options906Object[39].PropertyValue = Menu_Soundtrack907Object[40].PropertyValue = Menu_Extras908Object[41].PropertyValue = Menu_Exit909Object.ButtonCount = 8910else911Object[34].PropertyValue = Menu_LoadSaveMenu912Object[35].PropertyValue = Menu_TimeAttack913Object[36].PropertyValue = Menu_Help&Options914Object[37].PropertyValue = Menu_MoreGames915Object[38].PropertyValue = Menu_Soundtrack916Object[39].PropertyValue = Menu_Extras917Object[40].PropertyValue = Menu_Exit918Object.ButtonCount = 7919end if920end if921break922923end switch924925ArrayPos0 = 34926TempValue0 = 0927while TempValue0 < Object.ButtonCount928Object[ArrayPos0].ButtonYPos = TempValue0929Object[ArrayPos0].ButtonYPos++930ArrayPos0++931TempValue0++932loop933934while TempValue0 < 9935Object[ArrayPos0].Type = TypeName[Blank Object]936ArrayPos0++937TempValue0++938loop939940Object.DragLimit = Object.ButtonCount941Object.DragLimit *= -30942Object.DragLimit <<= 8943SpriteFrame(0, -10, 144, 21, 259, 71) // #0 - Button944TempValue0 = 0945TempValue1 = 18946// (#1 - #2) - Start Game, Time Attack947while TempValue0 < 2948SpriteFrame(19, -7, 128, 16, 1, TempValue1)949TempValue1 += 17950TempValue0++951loop952953// #3 - Achievements/Trophies/Game Center954if Engine.PlatformID == RETRO_PS3955SpriteFrame(19, -7, 128, 16, 1, 513)956else957#platform: Use_Standalone958SpriteFrame(19, -7, 128, 16, 1, TempValue1)959#endplatform960#platform: Use_Origins961if Engine.PlatformID != RETRO_IOS962SpriteFrame(19, -7, 128, 16, 1, TempValue1)963else964SpriteFrame(19, -7, 128, 16, 291, 615)965end if966#endplatform967end if968969TempValue1 += 17970TempValue0++971// #4 - Leaderboards972if Engine.OnlineActive == false973SpriteFrame(19, -7, 128, 16, 130, 460)974else975SpriteFrame(19, -7, 128, 16, 1, TempValue1)976end if977TempValue1 += 17978TempValue0++979// (#5 - #6) - Help & Options, Extras980while TempValue0 < 6981SpriteFrame(19, -7, 128, 16, 1, TempValue1)982TempValue1 += 17983TempValue0++984loop985TempValue0 = 0986TempValue1 = 547987// (#7 - #10) - Remove Ads(Mobile)/Unlock Full Game(Console), Unlock Full Game(Mobile)/Return to Arcade(Xbox), Exit Game, Soundtrack988while TempValue0 < 4989SpriteFrame(19, -7, 128, 16, 1, TempValue1)990TempValue1 += 17991TempValue0++992loop993994SpriteFrame(19, -7, 128, 16, 162, 649) // #11 - More Games995// Highlight Text996TempValue0 = 0997TempValue1 = 18998// (#11 - #12 Standard, #12 - #13 Mobile) - Start Game, Time Attack999while TempValue0 < 21000SpriteFrame(19, -7, 128, 16, 130, TempValue1)1001TempValue1 += 171002TempValue0++1003loop10041005// (#13 Standard, #14 Mobile) - Achievements/Trophies/Game Center1006if Engine.PlatformID == RETRO_PS31007SpriteFrame(19, -7, 128, 16, 130, 513)1008else1009#platform: Use_Standalone1010SpriteFrame(19, -7, 128, 16, 130, TempValue1)1011#endplatform1012#platform: Use_Origins1013if Engine.PlatformID != RETRO_IOS1014SpriteFrame(19, -7, 128, 16, 130, TempValue1)1015else1016SpriteFrame(19, -7, 128, 16, 291, 632)1017end if1018#endplatform1019end if10201021TempValue1 += 171022TempValue0++1023// (#14 - #16 Standard, #15 - #17 Mobile) - Leaderboards, Help & Options, Extras1024while TempValue0 < 61025SpriteFrame(19, -7, 128, 16, 130, TempValue1)1026TempValue1 += 171027TempValue0++1028loop1029TempValue0 = 01030TempValue1 = 5471031// (#17 - #20 Standard, #18 - #21 Mobile) - Remove Ads(Mobile)/Unlock Full Game(Console), Unlock Full Game(Mobile)/Return to Arcade(Xbox), Exit Game, Soundtrack1032while TempValue0 < 41033SpriteFrame(19, -7, 128, 16, 130, TempValue1)1034TempValue1 += 171035TempValue0++1036loop10371038SpriteFrame(19, -7, 128, 16, 162, 666) // #22 - More Games10391040#platform: Use_Origins1041if game.mainMenuMode != MAINMENUMODE_NONE1042Object[34].State = MENUBUTTON_BUTTONS_OUT1043Object[34].Timer = 01044Object[35].State = MENUBUTTON_BUTTONS_OUT1045Object[35].Timer = 01046Object[36].State = MENUBUTTON_BUTTONS_OUT1047Object[36].Timer = 01048Object[37].State = MENUBUTTON_BUTTONS_OUT1049Object[37].Timer = 01050Object[38].State = MENUBUTTON_BUTTONS_OUT1051Object[38].Timer = 01052Object[39].State = MENUBUTTON_BUTTONS_OUT1053Object[39].Timer = 01054Object[40].State = MENUBUTTON_BUTTONS_OUT1055Object[40].Timer = 01056Object[41].State = MENUBUTTON_BUTTONS_OUT1057Object[41].Timer = 01058Object[42].State = MENUBUTTON_BUTTONS_OUT1059Object[42].Timer = 01060Object[43].State = MENUBUTTON_BUTTONS_OUT1061Object[43].Timer = 010621063if game.mainMenuMode == MAINMENUMODE_VISUALMODE1064MenuHeading.State = MENUHEADING_IDLE1065MenuHeading.Header = EXTRAS_HEADER10661067CallFunction(MenuButton_SetupMenuWindow)1068ResetObjectEntity(62, TypeName[ExtrasMenu], 0, 0, 0)1069Object.NextMenuInkEffect = INK_ALPHA1070Object.NextMenuAlpha = 010711072ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)1073ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)1074ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)1075ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)1076Object.Type = TypeName[Blank Object]1077else1078if game.mainMenuMode == MAINMENUMODE_SOUNDTRACK1079MenuHeading.State = MENUHEADING_IDLE1080MenuHeading.Header = SOUNDTRACK_HEADER10811082CallFunction(MenuButton_SetupMenuWindow)1083MenuWindow.State = MENUWINDOW_SOUNDTRACK_EXPAND1084ResetObjectEntity(62,TypeName[Soundtrack Menu], 0, 0, 0)10851086Object.NextMenuInkEffect = INK_ALPHA1087Object.NextMenuAlpha = 010881089ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)1090ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)1091ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)1092ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)1093Object.Type = TypeName[Blank Object]1094else1095if game.mainMenuMode == MAINMENUMODE_CHARASELECT1096MenuHeading.State = MENUHEADING_IDLE1097MenuHeading.Header = SAVESELECT_HEADER10981099CallFunction(MenuButton_SetupMenuWindow)1100ResetObjectEntity(62,TypeName[Load Save Menu], 0, 0, 0)11011102Object.NextMenuInkEffect = INK_ALPHA1103Object.NextMenuAlpha = 011041105ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)1106ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)1107ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)1108ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)1109Object.Type = TypeName[Blank Object]1110else1111if game.mainMenuMode == MAINMENUMODE_HELPOPTION1112MenuHeading.State = MENUHEADING_LEAVE_SCREEN1113MenuHeading.Header = HELP&OPTIONS_HEADER11141115CallFunction(MenuButton_SetupMenuWindow)1116if Options.DevMenuFlag == true1117ResetObjectEntity(62,TypeName[Options Menu H], 0, 0, 0)1118else1119ResetObjectEntity(62,TypeName[Options Menu], 0, 0, 0)1120end if11211122Object.NextMenuInkEffect = INK_ALPHA1123Object.NextMenuAlpha = 011241125ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)1126ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)1127ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)1128ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)1129Object.Type = TypeName[Blank Object]1130else1131if game.mainMenuMode == MAINMENUMODE_EXTRAS1132MenuHeading.State = MENUHEADING_LEAVE_SCREEN1133MenuHeading.Header = EXTRAS_HEADER11341135CallFunction(MenuButton_SetupMenuWindow)1136ResetObjectEntity(62,TypeName[Extras Menu], 0, 0, 0)11371138Object.NextMenuInkEffect = INK_ALPHA1139Object.NextMenuAlpha = 011401141ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)1142ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)1143ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)1144ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)1145Object.Type = TypeName[Blank Object]1146else1147if game.mainMenuMode == MAINMENUMODE_SETTINGS1148MenuHeading.State = MENUHEADING_LEAVE_SCREEN1149MenuHeading.Header = HELP&OPTIONS_HEADER11501151CallFunction(MenuButton_SetupMenuWindow)1152ResetObjectEntity(62,TypeName[Options Menu], 0, 0, 0)11531154Object.NextMenuInkEffect = INK_ALPHA1155Object.NextMenuAlpha = 011561157ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)1158ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)1159ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)1160ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)1161Object.Type = TypeName[Blank Object]1162end if1163end if1164end if1165end if1166end if1167end if1168end if1169#endplatform1170end sub117111721173// ========================1174// Editor Subs1175// ========================11761177sub RSDKEdit1178if Editor.ReturnVariable == true1179switch Editor.VariableID1180case EDIT_VAR_PROPVAL // Property Value1181CheckResult = Object.PropertyValue1182break1183case 0 // Type1184CheckResult = Object.PropertyValue1185break1186end switch1187else1188switch Editor.VariableID1189case EDIT_VAR_PROPVAL // Property Value1190Object.PropertyValue = Editor.VariableValue1191break1192case 0 // Type1193Object.PropertyValue = Editor.VariableValue1194break1195end switch1196end if1197end sub119811991200sub RSDKDraw1201DrawSprite(0)1202end sub120312041205sub RSDKLoad1206LoadSpriteSheet("Menu/MenuGfx2_EN.gif")1207SpriteFrame(0, -10, 144, 21, 259, 71) // #0 - Button12081209// These are overwritten in ObjectStartup but its cool to see anyway1210AddEditorVariable("Type")1211SetActiveVariable("Type")1212AddEnumVariable("None", 0)1213AddEnumVariable("Play", 1)1214AddEnumVariable("Time Attack", 2)1215AddEnumVariable("Leaderboards", 3)1216AddEnumVariable("Achievements", 4)1217AddEnumVariable("Help & Options", 5)1218AddEnumVariable("Extras", 6)1219AddEnumVariable("Unlock Full Game", 7)1220AddEnumVariable("Store", 8)1221AddEnumVariable("Exit", 9)1222AddEnumVariable("Soundtrack", 10)1223AddEnumVariable("MoreGames", 11)1224end sub122512261227