fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
2efdb91
settings-overhaul
1local memory =require ( "memory" ) 2local color =require ( "util.color" ) 3 4MATCH_NO_RESULT =0x00 5MATCH_GAME =0x02 6MATCH_STAGE_CLEAR =0x03 7MATCH_STAGE_FAILURE =0x04 8MATCH_STAGE_CLEAR3 =0x05 9MATCH_NEW_RECORD =0x06 10MATCH_NO_CONTEST =0x07 11MATCH_RETRY =0x08 12MATCH_GAME_CLEAR =0x09 13 14-- MAJOR FLAGS 15MENU_TITLE_SCREEN =0x00 16MENU_MAIN_MENU =0x01 17MENU_VS_MODE =0x02 18 19-- MINOR FLAGS 20MENU_VS_CSS =0x0 21MENU_VS_SSS =0x1 22MENU_VS_INGAME =0x2 23MENU_VS_POSTGAME =0x4 24 25MENU_CLASSIC_MODE =0x03 26 27MENU_CLASSIC_LEVEL_1_VS =0x00 28MENU_CLASSIC_LEVEL_1 =0x01 29MENU_CLASSIC_LEVEL_2_VS =0x02 30MENU_CLASSIC_LEVEL_2 =0x03 31MENU_CLASSIC_LEVEL_3_VS =0x04 32MENU_CLASSIC_LEVEL_3 =0x05 33MENU_CLASSIC_LEVEL_4_VS =0x06 34MENU_CLASSIC_LEVEL_4 =0x07 35MENU_CLASSIC_LEVEL_5_VS =0x08 36MENU_CLASSIC_LEVEL_5 =0x09 37MENU_CLASSIC_LEVEL_5_VS =0x10 38MENU_CLASSIC_LEVEL_5 =0x09 39 40MENU_CLASSIC_LEVEL_16 =0x20 41MENU_CLASSIC_LEVEL_16_VS =0x21 42 43MENU_CLASSIC_LEVEL_24 =0x30 44MENU_CLASSIC_LEVEL_24_VS =0x31 45 46MENU_CLASSIC_BREAK_THE_TARGETS_INTRO =0x16 47MENU_CLASSIC_BREAK_THE_TARGETS =0x17 48 49MENU_CLASSIC_TROPHY_STAGE_INTRO =0x28 50MENU_CLASSIC_TROPHY_STAGE_TARGETS =0x29 51 52MENU_CLASSIC_RACE_TO_FINISH_INTRO =0x40 53MENU_CLASSIC_RACE_TO_FINISH_TARGETS =0x41 54 55MENU_CLASSIC_LEVEL_56 =0x38 56MENU_CLASSIC_LEVEL_56_VS =0x39 57 58MENU_CLASSIC_MASTER_HAND =0x51 59 60MENU_CLASSIC_CONTINUE =0x69 61MENU_CLASSIC_CSS =0x70 62 63MENU_ADVENTURE_MODE =0x04 64 65MENU_ADVENTURE_MUSHROOM_KINGDOM_INTRO =0x00 66MENU_ADVENTURE_MUSHROOM_KINGDOM =0x01 67MENU_ADVENTURE_MUSHROOM_KINGDOM_LUIGI =0x02 68MENU_ADVENTURE_MUSHROOM_KINGDOM_BATTLE =0x03 69 70MENU_ADVENTURE_MUSHROOM_KONGO_JUNGLE_INTRO =0x08 71MENU_ADVENTURE_MUSHROOM_KONGO_JUNGLE_TINY_BATTLE =0x09 72MENU_ADVENTURE_MUSHROOM_KONGO_JUNGLE_GIANT_BATTLE =0x0A 73 74MENU_ADVENTURE_UNDERGROUND_MAZE_INTRO =0x10 75MENU_ADVENTURE_UNDERGROUND_MAZE =0x11 76MENU_ADVENTURE_HYRULE_TEMPLE_BATTLE =0x12 77 78MENU_ADVENTURE_BRINSTAR_INTRO =0x18 79MENU_ADVENTURE_BRINSTAR =0x19 80 81MENU_ADVENTURE_ESCAPE_ZEBES_INTRO =0x1A 82MENU_ADVENTURE_ESCAPE_ZEBES =0x1B 83MENU_ADVENTURE_ESCAPE_ZEBES_ESCAPE =0x1C 84 85MENU_ADVENTURE_GREEN_GREENS_INTRO =0x20 86MENU_ADVENTURE_GREEN_GREENS_KIRBY_BATTLE =0x21 87MENU_ADVENTURE_GREEN_GREENS_KIRBY_TEAM_INTRO =0x22 88MENU_ADVENTURE_GREEN_GREENS_KIRBY_TEAM_BATTLE =0x23 89MENU_ADVENTURE_GREEN_GREENS_GIANT_KIRBY_INTRO =0x24 90MENU_ADVENTURE_GREEN_GREENS_GIANT_KIRBY_BATTLE =0x25 91 92MENU_ADVENTURE_CORNARIA_INTRO =0x28 93MENU_ADVENTURE_CORNARIA_BATTLE_1 =0x29 94MENU_ADVENTURE_CORNARIA_RAID =0x2A 95MENU_ADVENTURE_CORNARIA_BATTLE_2 =0x2B 96MENU_ADVENTURE_CORNARIA_BATTLE_3 =0x2C 97 98MENU_ADVENTURE_POKEMON_STADIUM_INTRO =0x30 99MENU_ADVENTURE_POKEMON_STADIUM_BATTLE =0x31 100 101MENU_ADVENTURE_FZERO_GRAND_PRIX_CARS =0x38 102MENU_ADVENTURE_FZERO_GRAND_PRIX_INTRO =0x39 103MENU_ADVENTURE_FZERO_GRAND_PRIX_RACE =0x3A 104MENU_ADVENTURE_FZERO_GRAND_PRIX_BATTLE =0x3B 105 106MENU_ADVENTURE_ONETT_INTRO =0x40 107MENU_ADVENTURE_ONETT_BATTLE =0x41 108 109MENU_ADVENTURE_ICICLE_MOUNTAIN_INTRO =0x48 110MENU_ADVENTURE_ICICLE_MOUNTAIN_CLIMB =0x49 111 112MENU_ADVENTURE_BATTLEFIELD_INTRO =0x50 113MENU_ADVENTURE_BATTLEFIELD_BATTLE =0x51 114MENU_ADVENTURE_BATTLEFIELD_METAL_INTRO =0x52 115MENU_ADVENTURE_BATTLEFIELD_METAL_BATTLE =0x53 116 117MENU_ADVENTURE_FINAL_DESTINATION_INTRO =0x58 118MENU_ADVENTURE_FINAL_DESTINATION_BATTLE =0x59 119MENU_ADVENTURE_FINAL_DESTINATION_POSE =0x5A 120MENU_ADVENTURE_FINAL_DESTINATION_WINNER =0x5B 121 122MENU_ADVENTURE_CSS =0x70 123 124MENU_ALL_STAR_MODE =0x05 125MENU_ALL_STAR_LEVEL_1 =0x00 126MENU_ALL_STAR_REST_AREA_1 =0x01 127MENU_ALL_STAR_LEVEL_2 =0x02 128MENU_ALL_STAR_REST_AREA_2 =0x03 129MENU_ALL_STAR_LEVEL_3 =0x04 130MENU_ALL_STAR_REST_AREA_3 =0x05 131MENU_ALL_STAR_LEVEL_4 =0x06 132MENU_ALL_STAR_REST_AREA_4 =0x07 133MENU_ALL_STAR_LEVEL_5 =0x08 134MENU_ALL_STAR_REST_AREA_5 =0x09 135MENU_ALL_STAR_LEVEL_6 =0x10 136MENU_ALL_STAR_REST_AREA_6 =0x11 137MENU_ALL_STAR_LEVEL_7 =0x12 138MENU_ALL_STAR_REST_AREA_7 =0x13 139MENU_ALL_STAR_LEVEL_8 =0x14 140MENU_ALL_STAR_REST_AREA_8 =0x15 141MENU_ALL_STAR_LEVEL_9 =0x16 142MENU_ALL_STAR_REST_AREA_9 =0x17 143MENU_ALL_STAR_LEVEL_10 =0x18 144MENU_ALL_STAR_REST_AREA_10 =0x19 145MENU_ALL_STAR_LEVEL_11 =0x20 146MENU_ALL_STAR_REST_AREA_11 =0x21 147MENU_ALL_STAR_LEVEL_12 =0x22 148MENU_ALL_STAR_REST_AREA_12 =0x23 149MENU_ALL_STAR_LEVEL_13 =0x24 150MENU_ALL_STAR_REST_AREA_13 =0x25 151MENU_ALL_STAR_LEVEL_14 =0x26 152MENU_ALL_STAR_REST_AREA_14 =0x27 153MENU_ALL_STAR_LEVEL_15 =0x28 154MENU_ALL_STAR_REST_AREA_15 =0x29 155MENU_ALL_STAR_LEVEL_16 =0x30 156MENU_ALL_STAR_REST_AREA_16 =0x31 157MENU_ALL_STAR_LEVEL_17 =0x32 158MENU_ALL_STAR_REST_AREA_17 =0x33 159MENU_ALL_STAR_LEVEL_18 =0x34 160MENU_ALL_STAR_REST_AREA_18 =0x35 161MENU_ALL_STAR_LEVEL_19 =0x36 162MENU_ALL_STAR_REST_AREA_19 =0x37 163MENU_ALL_STAR_LEVEL_20 =0x38 164MENU_ALL_STAR_REST_AREA_20 =0x39 165MENU_ALL_STAR_LEVEL_21 =0x40 166MENU_ALL_STAR_REST_AREA_21 =0x41 167MENU_ALL_STAR_LEVEL_22 =0x42 168MENU_ALL_STAR_REST_AREA_22 =0x43 169MENU_ALL_STAR_LEVEL_23 =0x44 170MENU_ALL_STAR_REST_AREA_23 =0x45 171MENU_ALL_STAR_LEVEL_24 =0x46 172MENU_ALL_STAR_REST_AREA_24 =0x47 173MENU_ALL_STAR_LEVEL_25 =0x48 174MENU_ALL_STAR_REST_AREA_25 =0x49 175MENU_ALL_STAR_LEVEL_26 =0x50 176MENU_ALL_STAR_REST_AREA_26 =0x51 177MENU_ALL_STAR_LEVEL_27 =0x52 178MENU_ALL_STAR_REST_AREA_28 =0x53 179MENU_ALL_STAR_LEVEL_29 =0x54 180MENU_ALL_STAR_REST_AREA_29 =0x55 181MENU_ALL_STAR_LEVEL_30 =0x56 182MENU_ALL_STAR_REST_AREA_30 =0x57 183MENU_ALL_STAR_LEVEL_31 =0x58 184MENU_ALL_STAR_REST_AREA_31 =0x59 185MENU_ALL_STAR_LEVEL_32 =0x60 186MENU_ALL_STAR_REST_AREA_32 =0x61 187 188MENU_ALL_STAR_CSS =0x70 189 190MENU_DEBUG =0x06 191MENU_SOUND_TEST =0x07 192 193MENU_VS_UNKNOWN =0x08 -- SLIPPI ONLINE 194MENU_VS_UNKNOWN_CSS =0x00 195MENU_VS_UNKNOWN_SSS =0x01 196MENU_VS_UNKNOWN_INGAME =0x02 197MENU_VS_UNKNOWN_VERSUS =0x04 198 199MENU_UNKOWN_1 =0x09 200MENU_CAMERA_MODE =0x0A 201MENU_TROPHY_GALLERY =0x0B 202MENU_TROPHY_LOTTERY =0x0C 203MENU_TROPHY_COLLECTION =0x0D 204MENU_START_MATCH =0x0E -- Slippi Replays 205MENU_START_MATCH_INGAME =0x01 -- Set when the replay is actually playing out 206MENU_START_MATCH_UNKNOWN =0x03 -- Seems to be set right before the match loads 207 208MENU_TARGET_TEST =0x0F 209MENU_TARGET_TEST_CSS =0x00 210MENU_TARGET_TEST_INGAME =0x1 211 212MENU_SUPER_SUDDEN_DEATH =0x10 213MENU_SSD_CSS =0x00 214MENU_SSD_SSS =0x01 215MENU_SSD_INGAME =0x02 216MENU_SSD_POSTGAME =0x04 217 218MENU_INVISIBLE_MELEE =0x11 219MENU_INVISIBLE_MELEE_CSS =0x00 220MENU_INVISIBLE_MELEE_SSS =0x01 221MENU_INVISIBLE_MELEE_INGAME =0x02 222MENU_INVISIBLE_MELEE_POSTGAME =0x04 223 224MENU_SLOW_MO_MELEE =0x12 225MENU_SLOW_MO_MELEE_CSS =0x00 226MENU_SLOW_MO_MELEE_SSS =0x01 227MENU_SLOW_MO_MELEE_INGAME =0x02 228MENU_SLOW_MO_MELEE_POSTGAME =0x04 229 230MENU_LIGHTNING_MELEE =0x13 231MENU_LIGHTNING_MELEE_CSS =0x00 232MENU_LIGHTNING_MELEE_SSS =0x01 233MENU_LIGHTNING_MELEE_INGAME =0x02 234MENU_LIGHTNING_MELEE_POSTGAME =0x04 235 236MENU_CHARACTER_APPROACHING =0x14 237 238MENU_CLASSIC_MODE_COMPLETE =0x15 239MENU_CLASSIC_MODE_TROPHY =0x00 240MENU_CLASSIC_MODE_CREDITS =0x01 241MENU_CLASSIC_MODE_CHARACTER_VIDEO =0x02 242MENU_CLASSIC_MODE_CONGRATS =0x03 243 244MENU_ADVENTURE_MODE_COMPLETE =0x16 245MENU_ADVENTURE_MODE_TROPHY =0x00 246MENU_ADVENTURE_MODE_CREDITS =0x01 247MENU_ADVENTURE_MODE_CHARACTER_VIDEO =0x02 248MENU_ADVENTURE_MODE_CONGRATS =0x03 249 250MENU_ALL_STAR_COMPLETE =0x17 251MENU_ALL_STAR_TROPHY =0x00 252MENU_ALL_STAR_CREDITS =0x01 253MENU_ALL_STAR_CHARACTER_VIDEO =0x02 254MENU_ALL_STAR_CONGRATS =0x03 255 256MENU_TITLE_SCREEN_IDLE =0x18 257MENU_TITLE_SCREEN_IDLE_INTRO_VIDEO =0x0 258MENU_TITLE_SCREEN_IDLE_FIGHT_1 =0x1 259MENU_TITLE_SCREEN_IDLE_BETWEEN_FIGHTS =0x2 260MENU_TITLE_SCREEN_IDLE_FIGHT_2 =0x3 261MENU_TITLE_SCREEN_IDLE_HOW_TO_PLAY =0x4 262 263MENU_ADVENTURE_MODE_CINEMEATIC =0x19 264MENU_CHARACTER_UNLOCKED =0x1A 265 266MENU_TOURNAMENT =0x1B 267MENU_TOURNAMENT_CSS =0x0 268MENU_TOURNAMENT_BRACKET =0x1 269MENU_TOURNAMENT_INGAME =0x4 270MENU_TOURNAMENT_POSTGAME =0x6 271 272MENU_TRAINING_MODE =0x1C 273MENU_TRAINING_CSS =0x0 274MENU_TRAINING_SSS =0x1 275MENU_TRAINING_INGAME =0x2 276 277MENU_TINY_MELEE =0x1D 278MENU_TINY_MELEE_CSS =0x0 279MENU_TINY_MELEE_SSS =0x1 280MENU_TINY_MELEE_INGAME =0x2 281MENU_TINY_MELEE_POSTGAME =0x4 282 283MENU_GIANT_MELEE =0x1E 284MENU_GIANT_MELEE_CSS =0x0 285MENU_GIANT_MELEE_SSS =0x1 286MENU_GIANT_MELEE_INGAME =0x2 287MENU_GIANT_MELEE_POSTGAME =0x4 288 289MENU_STAMINA_MODE =0x1F 290MENU_STAMINA_MODE_CSS =0x0 291MENU_STAMINA_MODE_SSS =0x1 292MENU_STAMINA_MODE_INGAME =0x2 293MENU_STAMINA_MODE_POSTGAME =0x4 294 295MENU_HOME_RUN_CONTEST =0x20 296MENU_HOME_RUN_CONTEST_CSS =0x0 297MENU_HOME_RUN_CONTEST_INGAME =0x1 298 299MENU_10_MAN_MELEE =0x21 300MENU_10_MAN_MELEE_CSS =0x00 301MENU_10_MAN_MELEE_INGAME =0x01 302 303MENU_100_MAN_MELEE =0x22 304MENU_100_MAN_MELEE_CSS =0x00 305MENU_100_MAN_MELEE_INGAME =0x01 306 307MENU_3_MINUTE_MELEE =0x23 308MENU_3_MINUTE_MELEE_CSS =0x00 309MENU_3_MINUTE_MELEE_INGAME =0x01 310 311MENU_15_MINUTE_MELEE =0x24 312MENU_15_MINUTE_MELEE_CSS =0x00 313MENU_15_MINUTE_MELEE_INGAME =0x01 314 315MENU_ENDLESS_MELEE =0x25 316MENU_ENDLESS_MELEE_CSS =0x00 317MENU_ENDLESS_MELEE_INGAME =0x01 318 319MENU_CRUEL_MELEE =0x26 320MENU_CRUEL_MELEE_CSS =0x00 321MENU_CRUEL_MELEE_INGAME =0x01 322 323MENU_PROGRESSIVE_SCAN =0x27 324MENU_PLAY_INTRO_VIDEO =0x28 325MENU_MEMORY_CARD_OVERWRITE =0x29 326 327MENU_FIXED_CAMERA_MODE =0x2A 328MENU_FIXED_CAMERA_MODE_CSS =0x0 329MENU_FIXED_CAMERA_MODE_SSS =0x1 330MENU_FIXED_CAMERA_MODE_INGAME =0x2 331MENU_FIXED_CAMERA_MODE_POSTGAME =0x4 332 333MENU_EVENT_MATCH =0x2B 334MENU_EVENT_MATCH_SELECT =0x0 335MENU_EVENT_MATCH_INGAME =0x1 336 337MENU_SINGLE_BUTTON_MODE =0x2C 338 339local character_selections ={ 340[ 0x00 ] ={ 341name ="captain" , 342skin ={ "original" , "black" , "red" , "white" , "green" , "blue" , "teal" } , 343team_skin ={ 3 , 6 , 5 } , 344series ="fzero" 345} , 346[ 0x01 ] ={ 347name ="donkey" , 348skin ={ "original" , "black" , "red" , "blue" , "green" , "gold" } , 349team_skin ={ 3 , 4 , 5 } , 350series ="donkey_kong" 351} , 352[ 0x02 ] ={ 353name ="fox" , 354skin ={ "original" , "red" , "blue" , "green" , "gold" } , 355team_skin ={ 2 , 3 , 4 } , 356series ="star_fox" 357} , 358[ 0x03 ] ={ 359name ="gamewatch" , 360skin ={ "original" , "red" , "blue" , "green" , "white" } , 361team_skin ={ 2 , 3 , 4 } , 362series ="game_and_watch" 363} , 364[ 0x04 ] ={ 365name ="kirby" , 366skin ={ "original" , "yellow" , "blue" , "red" , "green" , "white" , "purple" } , 367team_skin ={ 4 , 3 , 5 } , 368series ="kirby" 369} , 370[ 0x05 ] ={ 371name ="koopa" , 372skin ={ "green" , "red" , "blue" , "black" , "orange" } , 373team_skin ={ 2 , 3 , 1 } , 374series ="mario" 375} , 376[ 0x06 ] ={ 377name ="link" , 378skin ={ "green" , "red" , "blue" , "black" , "white" , "gold" } , 379team_skin ={ 2 , 3 , 1 } , 380series ="zelda" 381} , 382[ 0x07 ] ={ 383name ="luigi" , 384skin ={ "green" , "white" , "blue" , "red" , "purple" } , 385team_skin ={ 4 , 3 , 1 } , 386series ="mario" 387} , 388[ 0x08 ] ={ 389name ="mario" , 390skin ={ "red" , "yellow" , "black" , "blue" , "green" , "teal" } , 391team_skin ={ 1 , 4 , 5 } , 392series ="mario" 393} , 394[ 0x09 ] ={ 395name ="marth" , 396skin ={ "original" , "red" , "green" , "black" , "white" , "gold" } , 397team_skin ={ 2 , 1 , 3 } , 398series ="fire_emblem" 399} , 400[ 0x10 ] ={ 401name ="samus" , 402skin ={ "red" , "pink" , "black" , "green" , "blue" , "teal" } , 403team_skin ={ 1 , 5 , 4 } , 404series ="metroid" 405} , 406[ 0x11 ] ={ 407name ="yoshi" , 408skin ={ "green" , "red" , "blue" , "yellow" , "pink" , "light_blue" , "black" } , 409team_skin ={ 2 , 3 , 1 } , 410series ="yoshi" 411} , 412[ 0x12 ] ={ 413name ="zelda" , 414skin ={ "original" , "red" , "blue" , "green" , "white" , "gold" } , 415team_skin ={ 2 , 3 , 4 } , 416series ="zelda" 417} , 418[ 0x13 ] ={ 419name ="sheik" , 420skin ={ "original" , "red" , "blue" , "green" , "white" , "gold" } , 421team_skin ={ 2 , 3 , 4 } , 422series ="zelda" 423} , 424[ 0x14 ] ={ 425name ="falco" , 426skin ={ "original" , "red" , "blue" , "green" , "pink" } , 427team_skin ={ 2 , 3 , 4 } , 428series ="star_fox" 429} , 430[ 0x15 ] ={ 431name ="younglink" , 432skin ={ "green" , "red" , "blue" , "white" , "black" , "purple" } , 433team_skin ={ 2 , 3 , 1 } , 434series ="zelda" 435} , 436[ 0x16 ] ={ 437name ="mariod" , 438skin ={ "white" , "red" , "blue" , "green" , "black" , "purple" } , 439team_skin ={ 2 , 3 , 4 } , 440series ="mario" 441} , 442[ 0x17 ] ={ 443name ="roy" , 444skin ={ "original" , "red" , "blue" , "green" , "yellow" , "purple" } , 445team_skin ={ 2 , 3 , 4 } , 446series ="fire_emblem" 447} , 448[ 0x18 ] ={ 449name ="pichu" , 450skin ={ "original" , "red" , "blue" , "green" , "hat" } , 451team_skin ={ 2 , 3 , 4 } , 452series ="pokemon" 453} , 454[ 0x19 ] ={ 455name ="ganon" , 456skin ={ "original" , "red" , "blue" , "green" , "purple" , "gold" } , 457team_skin ={ 2 , 3 , 4 } , 458series ="zelda" 459} , 460[ 0x0A ] ={ 461name ="mewtwo" , 462skin ={ "original" , "red" , "blue" , "green" , "black" } , 463team_skin ={ 2 , 3 , 4 } , 464series ="pokemon" 465} , 466[ 0x0B ] ={ 467name ="ness" , 468skin ={ "original" , "yellow" , "blue" , "green" , "pink" } , 469team_skin ={ 1 , 3 , 4 } , 470series ="earthbound" 471} , 472[ 0x0C ] ={ 473name ="peach" , 474skin ={ "original" , "daisy" , "white" , "blue" , "green" , "red" } , 475team_skin ={ 1 , 4 , 5 } , 476series ="mario" 477} , 478[ 0x0D ] ={ 479name ="pikachu" , 480skin ={ "original" , "red" , "blue" , "green" , "detective" } , 481team_skin ={ 2 , 3 , 4 } , 482series ="pokemon" 483} , 484[ 0x0E ] ={ 485name ="ice_climber" , 486skin ={ "original" , "green" , "orange" , "red" , "blue" } , 487team_skin ={ 4 , 1 , 2 } , 488series ="ice_climbers" 489} , 490[ 0x0F ] ={ 491name ="purin" , 492skin ={ "original" , "red" , "blue" , "green" , "crown" , "pink" } , 493team_skin ={ 2 , 3 , 4 } , 494series ="pokemon" 495} , 496[ 0x1A ] ={ 497name ="master_hand" , 498skinless =true , 499series ="smash" 500} , 501[ 0x1E ] ={ 502name ="crazy_hand" , 503skinless =true , 504series ="smash" 505} , 506[ 0x1D ] ={ 507name ="giga_bowser" , 508skinless =true , 509series ="smash" 510} , 511[ 0x21 ] ={ 512name ="wireframe" , 513skinless =true , 514series ="smash" 515} , 516} 517 518local beyondmelee_selection ={ 519[ 0x00 ] ={ 520name ="captain" , 521skin ={ "original" , "black" , "red" , "white" , "green" , "blue" , "maskless" } , 522team_skin ={ 3 , 6 , 5 } , 523series ="fzero" 524} , 525[ 0x05 ] ={ 526name ="koopa" , 527skin ={ "green" , "red" , "blue" , "black" , "bones" } , 528team_skin ={ 2 , 3 , 1 } , 529series ="mario" 530} , 531[ 0x06 ] ={ 532name ="link" , 533skin ={ "green" , "red" , "blue" , "black" , "white" , "fierce" } , 534team_skin ={ 2 , 3 , 1 } , 535series ="zelda" 536} , 537[ 0x08 ] ={ 538name ="mario" , 539skin ={ "red" , "yellow" , "black" , "blue" , "green" , "builder" } , 540team_skin ={ 1 , 4 , 5 } , 541series ="mario" 542} , 543[ 0x0D ] ={ 544name ="pikachu" , 545skin ={ "original" , "red" , "blue" , "green" , "luchador" } , 546team_skin ={ 2 , 3 , 4 } , 547series ="pokemon" 548} , 549[ 0x10 ] ={ 550name ="samus" , 551skin ={ "red" , "pink" , "black" , "green" , "blue" , "white" } , 552team_skin ={ 1 , 5 , 4 } , 553series ="metroid" 554} , 555[ 0x16 ] ={ 556name ="mariod" , 557skin ={ "white" , "red" , "blue" , "green" , "black" , "hazmat" } , 558team_skin ={ 2 , 3 , 4 } , 559series ="mario" 560} , 561[ 0x18 ] ={ 562name ="pichu" , 563skin ={ "original" , "red" , "blue" , "green" , "hat" } , 564team_skin ={ 2 , 3 , 4 } , 565series ="pokemon" 566} , 567[ 0x19 ] ={ 568name ="ganon" , 569skin ={ "original" , "red" , "blue" , "green" , "purple" , "spirit" } , 570team_skin ={ 2 , 3 , 4 } , 571series ="zelda" 572} , 573[ 0x1A ] ={ 574name ="wolf" , 575skin ={ "neutral" , "red" , "blue" , "green" } , 576team_skin ={ 2 , 3 , 4 } , 577series ="star_fox" 578} , 579[ 0x1B ] ={ 580name ="raichu" , 581skin ={ "neutral" , "king" , "beach" , "vomit" , "warlock" } , 582team_skin ={ 2 , 3 , 4 } , 583series ="pokemon" 584} , 585[ 0x1C ] ={ 586name ="shadowm2" , 587skin ={ "black" , "red" , "blue" , "green" , "purple" } , 588team_skin ={ 2 , 3 , 4 } , 589series ="pokemon" 590} , 591[ 0x1D ] ={ 592name ="fay" , 593skin ={ "neutral" , "red" , "blue" , "green" } , 594team_skin ={ 2 , 3 , 4 } , 595series ="star_fox" 596} , 597[ 0x1E ] ={ 598name ="skullkid" , 599skin ={ "neutral" , "blue" , "green" , "black" } , 600team_skin ={ 1 , 2 , 3 } , 601series ="zelda" 602} , 603} 604 605local akaneia_selection ={ 606[ 0x1A ] ={ 607name ="wolf" , 608skin ={ "neutral" , "pink" , "blue" , "green" , "brown" } , 609team_skin ={ 2 , 3 , 4 } , 610series ="star_fox" 611} , 612} 613 614local textures ={ 615series ={} , 616stocks ={} , 617skinless ={} 618} 619 620local graphics =love . graphics 621local newImage =graphics . newImage 622 623local melee ={} 624 625function melee . isAkaneia () 626return memory . romstring and memory . romstring . akaneia == "Akaneia" 627end 628 629function melee . isBeyondMelee () 630return memory . romstring and memory . romstring . beyondmelee == "Beyond Melee" 631end 632 633do 634local function doload ( tbl ) 635for cid , info in pairs ( tbl ) do 636if textures . series [ cid ] then textures . series [ cid ]: release () end 637textures . series [ cid ] =newImage (( "textures/series/%s.png" ): format ( info . series )) 638 639if textures . stocks [ cid ] then 640for skin , text in pairs ( textures . stocks [ cid ]) do 641text : release () 642end 643end 644 645textures . stocks [ cid ] ={} 646textures . skinless [ cid ] =info . skinless 647 648if info . skin then 649for sid , skin in ipairs ( info . skin ) do 650local stockf =( "textures/stocks/%s-%s.png" ): format ( info . name , skin ) 651local stockakf =( "textures/stocks/ak/%s-%s.png" ): format ( info . name , skin ) 652local stockbmf =( "textures/stocks/bm/%s-%s.png" ): format ( info . name , skin ) 653 654if melee . isAkaneia () and love . filesystem . getInfo ( stockakf ) then 655-- Akaneia icon override 656textures . stocks [ cid ][ sid - 1 ] =newImage ( stockakf ) 657elseif melee . isBeyondMelee () and love . filesystem . getInfo ( stockbmf ) then 658-- Beyond Melee icon override 659textures . stocks [ cid ][ sid - 1 ] =newImage ( stockbmf ) 660elseif love . filesystem . getInfo ( stockf ) then 661textures . stocks [ cid ][ sid - 1 ] =newImage ( stockf ) 662end 663end 664else 665if textures . stocks [ cid ][ 1 ] then textures . stocks [ cid ][ 1 ]: release () end 666textures . stocks [ cid ][ 1 ] =newImage (( "textures/stocks/%s.png" ): format ( info . name )) 667end 668end 669end 670 671function melee . loadTextures () 672doload ( character_selections ) 673end 674 675function melee . loadRomSpecificTextures () 676doload ( character_selections ) 677if melee . isAkaneia () then 678( "LOADED AKANEIA TEXTURES" ) 679doload ( akaneia_selection ) 680elseif melee . isBeyondMelee () then 681( "LOADED BEYOND MELEE TEXTURES" ) 682doload ( beyondmelee_selection ) 683end 684end 685end 686 687function melee . getPlayer ( port ) 688if not memory . player then return end 689 690if melee . isSinglePlayerGame () and not melee . isNetplayGame () and port == memory . menu . player_one_port + 1 then 691-- Single player games in CSS screen always use PORT 1 character info no matter what port is controlling the menus 692return memory . player [ 1 ]. select 693elseif not melee . isInGame () then 694return memory . player [ port ]. select 695end 696 697return memory . player [ port ] 698end 699 700function melee . getCharacterID ( port ) 701if not memory . player then return end 702 703local player =melee . getPlayer ( port ) 704 705if not player then return end 706 707local character =player . character 708 709if melee . isInGame () then 710local transformed =player . transformed == 256 711 712-- Handle and detect Zelda/Sheik transformations 713if character == 0x13 then 714character =transformed and 0x12 or 0x13 715elseif character == 0x12 then 716character =transformed and 0x13 or 0x12 717end 718end 719 720return character 721end 722 723function melee . getStockTexture ( id , skin ) 724if textures . skinless [ id ] == true then 725skin =1 726end 727if not textures . stocks [ id ] or not textures . stocks [ id ][ skin ] then 728return textures . stocks [ id ] and textures . stocks [ id ][ 0 ] or textures . stocks [ 0x21 ][ 1 ] 729end 730return textures . stocks [ id ][ skin ] 731end 732 733function melee . getSeriesTexture ( id ) 734if not textures . series [ id ] then 735return textures . series [ 0x21 ] 736end 737return textures . series [ id ] 738end 739 740function melee . drawSeries ( port , ... ) 741local id =melee . getCharacterID ( port ) 742if not id then return end 743local series =melee . getSeriesTexture ( melee . isPortEnabled ( port ) and id or 0x21 ) 744if not series then return end 745graphics . easyDraw ( series , ... ) 746end 747 748function melee . getSinglePlayerPort () 749if melee . isSinglePlayerGame () and not melee . isNetplayGame () then 750return 1 751else 752return memory . menu . player_one_port + 1 753end 754end 755 756function melee . drawStock ( port , ... ) 757if not melee . isPortEnabled ( port ) then return end 758local id =melee . getCharacterID ( port ) 759if id == 0x21 or not memory . player then return end 760local player =melee . getPlayer ( port ) 761if not player or not id then return end 762local stock =melee . getStockTexture ( id , player . skin ) 763if not stock then return end 764graphics . easyDraw ( stock , ... ) 765end 766 767local TEAM_COLORS ={ 768[ 0x00 ] =color ( 245 , 46 , 46 , 255 ), -- Red 769[ 0x01 ] =color ( 84 , 99 , 255 , 255 ), -- Blue 770[ 0x02 ] =color ( 31 , 158 , 64 , 255 ), -- Green 771[ 0x04 ] =color ( 200 , 200 , 200 , 255 ), -- CPU/Disabled 772} 773 774function melee . getPlayerTeamColor ( port ) 775if not melee . isPortEnabled ( port ) then return TEAM_COLORS [ 0x04 ] end 776local player =melee . isInGame () and melee . getPlayer ( port ) or memory . player [ port ]. card 777if not player then return TEAM_COLORS [ 0x04 ] end 778return TEAM_COLORS [ player . team ] or color_white 779end 780 781local PLAYER_COLORS ={ 782[ 1 ] =color ( 245 , 46 , 46 , 255 ), 783[ 2 ] =color ( 84 , 99 , 255 , 255 ), 784[ 3 ] =color ( 255 , 199 , 23 , 255 ), 785[ 4 ] =color ( 31 , 158 , 64 , 255 ), 786} 787 788local PORT_PLAYER =0x0 789local PORT_CPU =0x1 790local PORT_DISABLED =0x3 791 792function melee . isPortEnabled ( port ) 793if not port then return false end 794if melee . isInMenus () and melee . isSinglePlayerGame () and port ~= ( memory . menu . player_one_port + 1 ) then return false end 795return memory . player [ port ]. card . mode ~= PORT_DISABLED 796end 797 798function melee . isPortCPU ( port ) 799return memory . player [ port ]. card . mode == PORT_CPU 800end 801 802function melee . getPlayerColor ( port ) 803return melee . isPortEnabled ( port ) and ( PLAYER_COLORS [ port ] or color_white ) or TEAM_COLORS [ 0x04 ] 804end 805 806local char_replacement_map ={ 807[ 0x8149 ] ="!" , [ 0x8168 ] ="\"" , [ 0x8194 ] ="#" , [ 0x8190 ] ="$" , 808[ 0x8193 ] ="%" , [ 0x8195 ] ="&" , [ 0x8166 ] ="'" , [ 0x8169 ] ="(" , 809[ 0x816A ] =")" , [ 0x8196 ] ="*" , [ 0x817B ] ="+" , [ 0x8143 ] ="," , 810[ 0x817C ] ="-" , [ 0x8144 ] ="." , [ 0x815E ] ="/" , [ 0x8146 ] =":" , 811[ 0x8147 ] =";" , [ 0x8183 ] ="<" , [ 0x8181 ] ="=" , [ 0x8184 ] =">" , 812[ 0x8148 ] ="?" , [ 0x8197 ] ="@" , [ 0x816D ] ="[" , [ 0x815F ] ="\\" , 813[ 0x816E ] ="]" , [ 0x814F ] ="^" , [ 0x8151 ] ="_" , [ 0x814D ] ="`" , 814[ 0x816F ] ="{" , [ 0x8162 ] ="|" , [ 0x8170 ] ="}" , [ 0x8160 ] ="~" , 815} 816 817function melee . convertStr ( str ) 818local niceStr ="" 819local i =1 820while i <= # str do 821local c1 =string . sub ( str , i , i ) 822local b1 =string . byte ( c1 ) 823 824if bit . band ( b1 , 0x80 ) == 0x80 then 825local c2 =string . sub ( str , i + 1 , i + 1 ) 826local b2 =string . byte ( c2 ) 827 828local b16 =bit . bor ( bit . lshift ( b1 , 8 ), bit . lshift ( b2 , 0 )) 829 830if char_replacement_map [ b16 ] then 831niceStr =niceStr .. char_replacement_map [ b16 ] 832end 833 834i =i + 2 835else 836niceStr =niceStr .. c1 837i =i + 1 838end 839end 840return niceStr 841end 842 843local STAGE_SERIES ={ 844[ 0x02 ] ="Super Mario" , -- Princess Peach's Castle 845[ 0x03 ] ="Super Mario" , -- Rainbow Cruise 846[ 0x04 ] ="Donkey Kong" , -- Kongo Jungle 847[ 0x05 ] ="Donkey Kong" , -- Jungle Japes 848[ 0x06 ] ="The Legend of Zelda" , -- Great Bay 849[ 0x07 ] ="The Legend of Zelda" , -- Hyrule Temple 850[ 0x08 ] ="Metroid" , -- Brinstar 851[ 0x09 ] ="Metroid" , -- Brinstar Depths 852[ 0x0A ] ="Yoshi" , -- Yoshi's Story 853[ 0x0B ] ="Yoshi" , -- Yoshi's Island 854[ 0x0C ] ="Kirby" , -- Fountain of Dreams 855[ 0x0D ] ="Kirby" , -- Green Greens 856[ 0x0E ] ="Star Fox" , -- Corneria 857[ 0x0F ] ="Star Fox" , -- Venom 858[ 0x10 ] ="Pokémon" , -- Pokémon Stadium 859[ 0x11 ] ="Pokémon" , -- Poké Floats 860[ 0x12 ] ="F-Zero" , -- Mute City 861[ 0x13 ] ="F-Zero" , -- Big Blue 862[ 0x14 ] ="Earthbound" , -- Onett 863[ 0x15 ] ="Earthbound" , -- Fourside 864[ 0x16 ] ="Ice Climbers" , -- Icicle Mountain 865[ 0x18 ] ="Super Mario" , -- Mushroom Kingdom 866[ 0x19 ] ="Super Mario" , -- Mushroom Kingdom 2 867[ 0x1B ] ="Game & Watch" , -- Flat Zone 868[ 0x1C ] ="Kirby" , -- Dream Land N64 869[ 0x1D ] ="Yoshi" , -- Yoshi's Island N64 870[ 0x1E ] ="Donkey Kong" , -- Kongo Jungle N64 871[ 0x24 ] ="Super Smash Bros" , -- Battlefield 872[ 0x25 ] ="Super Smash Bros" , -- Final Destination 873[ 0x26 ] ="Super Smash Bros" , -- Trophy Collection 874 875-- Singleplayer stages 876[ 0x1F ] ="Super Mario" , -- Mushroom Kingdom 877[ 0x20 ] ="The Legend of Zelda" , -- Underground Maze 878[ 0x21 ] ="Metroid" , -- Escape Zebes 879[ 0x22 ] ="F-Zero" , -- F-Zero Grand Prix 880[ 0x26 ] ="Super Smash Bros" , -- Trophy Collection 881[ 0x27 ] ="Super Smash Bros" , -- Race to the Finish 882[ 0x42 ] ="Super Smash Bros" , -- All-Star Rest Area 883[ 0x43 ] ="Super Smash Bros" , -- Home-Run Contest 884[ 0x44 ] ="Super Mario" , -- Trophy Tussel - Goomba 885[ 0x45 ] ="Pokémon" , -- Trophy Tussel - Entei 886[ 0x46 ] ="The Legend of Zelda" , -- Trophy Tussel - Majora's Mask 887 888 889} 890 891local STAGE_NAMES ={ 892[ 0x02 ] ="Princess Peach's Castle" , 893[ 0x03 ] ="Rainbow Cruise" , 894[ 0x04 ] ="Kongo Jungle" , 895[ 0x05 ] ="Jungle Japes" , 896[ 0x06 ] ="Great Bay" , 897[ 0x07 ] ="Hyrule Temple" , 898[ 0x08 ] ="Brinstar" , 899[ 0x09 ] ="Brinstar Depths" , 900[ 0x0A ] ="Yoshi's Story" , 901[ 0x0B ] ="Yoshi's Island" , 902[ 0x0C ] ="Fountain of Dreams" , 903[ 0x0D ] ="Green Greens" , 904[ 0x0E ] ="Corneria" , 905[ 0x0F ] ="Venom" , 906[ 0x10 ] ="Pokémon Stadium" , 907[ 0x11 ] ="Poké Floats" , 908[ 0x12 ] ="Mute City" , 909[ 0x13 ] ="Big Blue" , 910[ 0x14 ] ="Onett" , 911[ 0x15 ] ="Fourside" , 912[ 0x16 ] ="Icicle Mountain" , 913[ 0x18 ] ="Mushroom Kingdom" , 914[ 0x19 ] ="Mushroom Kingdom 2" , 915[ 0x1B ] ="Flat Zone" , 916[ 0x1C ] ="Dream Land N64" , 917[ 0x1D ] ="Yoshi's Island N64" , 918[ 0x1E ] ="Kongo Jungle N64" , 919[ 0x24 ] ="Battlefield" , 920[ 0x25 ] ="Final Destination" , 921} 922 923local BREAK_THE_TARGETS_STAGES ={ 924[ 0x28 ] ="Mario Target Test" , 925[ 0x29 ] ="Captain Falcon Target Test" , 926[ 0x2A ] ="Young Link Target Test" , 927[ 0x2B ] ="Donkey Kong Target Test" , 928[ 0x2C ] ="Dr. Mario Target Test" , 929[ 0x2D ] ="Falco Target Test" , 930[ 0x2E ] ="Fox Target Test" , 931[ 0x2F ] ="Ice Climbers Target Test" , 932[ 0x30 ] ="Kirby Target Test" , 933[ 0x31 ] ="Bowser Target Test" , 934[ 0x32 ] ="Link Target Test" , 935[ 0x33 ] ="Luigi Target Test" , 936[ 0x34 ] ="Marth Target Test" , 937[ 0x35 ] ="Mewtwo Target Test" , 938[ 0x36 ] ="Ness Target Test" , 939[ 0x37 ] ="Peach Target Test" , 940[ 0x38 ] ="Pichu Target Test" , 941[ 0x39 ] ="Pikachu Target Test" , 942[ 0x3A ] ="Jigglypuff Target Test" , 943[ 0x3B ] ="Samus Target Test" , 944[ 0x3C ] ="Sheik Target Test" , 945[ 0x3D ] ="Yoshi Target Test" , 946[ 0x3E ] ="Zelda Target Test" , 947[ 0x3F ] ="Mr. G&W Target Test" , 948[ 0x40 ] ="Roy Target Test" , 949[ 0x41 ] ="Ganondorf Target Test" , 950 951-- Akaneia 952[ 0x4E ] ="Wolf Target Test" , 953} 954 955local SINGLEPLAYER_STAGES ={ 956[ 0x1F ] ="Mushroom Kingdom" , 957[ 0x20 ] ="Underground Maze" , 958[ 0x21 ] ="Escape Zebes" , 959[ 0x22 ] ="F-Zero Grand Prix" , 960[ 0x26 ] ="Trophy Collection" , 961[ 0x27 ] ="Race to the Finish" , 962[ 0x42 ] ="All-Star Rest Area" , 963[ 0x43 ] ="Home-Run Contest" , 964[ 0x44 ] ="Trophy Tussle - Goomba" , 965[ 0x45 ] ="Trophy Tussle - Entei" , 966[ 0x46 ] ="Trophy Tussle - Majora's Mask" , 967} 968 969local AKANEIA_STAGES ={ 970[ 0x47 ] ="Peach's Castle 64" , 971[ 0x48 ] ="Hyrule Castle 64" , 972[ 0x49 ] ="Saffron City 64" , 973[ 0x4A ] ="Planet Zebes 64" , 974[ 0x4B ] ="Mushroom Kingdom 64" , 975[ 0x4C ] ="Metal Cavern" , 976[ 0x4D ] ="Volleyball" , 977} 978 979local AKANEIA_SERIES ={ 980[ 0x47 ] ="Super Mario" , 981[ 0x48 ] ="The Legend of Zelda" , 982[ 0x49 ] ="Pokémon" , 983[ 0x4A ] ="Metroid" , 984[ 0x4B ] ="Super Mario" , 985[ 0x4C ] ="Super Mario" , 986[ 0x4D ] ="Super Smash Bros" , 987} 988 989local BEYOND_MELEE_STAGES ={ 990[ 0x47 ] ="Volleyball" , 991[ 0x48 ] ="Smashville" , 992[ 0x49 ] ="Sprout Tower" , 993[ 0x4A ] ="Fountain of Dreams" , 994[ 0x4B ] ="Flipper Field" , 995[ 0x4C ] ="Brinstar Lab" , 996[ 0x4D ] ="Metal Cavern" , -- Metal Cavern? (Currently broken in BM-1.0) 997[ 0x4E ] ="Mute Circuit" , 998[ 0x4F ] ="Kongo Falls" , 999[ 0x50 ] ="Town Greens" , 1000[ 0x51 ] ="Kongle Jungle 64" , 1001[ 0x52 ] ="Poké Float Stadium 2" , 1002[ 0x53 ] ="Rainbow Ride" , 1003[ 0x54 ] ="Island Zone" , 1004[ 0x55 ] ="Wasteland" , 1005[ 0x56 ] ="Baby Bowser's Castle" , 1006[ 0x57 ] ="Midnight Destination" , 1007[ 0x58 ] ="Midnight Battlefield" , 1008[ 0x59 ] ="Dual Zone" , 1009[ 0x5A ] ="Fountain of Dreams" , -- Diet (Currently broken in BM-1.0) 1010[ 0x5B ] ="Stadium-ville" , -- Diet (Currently broken in BM-1.0) 1011[ 0x5C ] ="Yoshi's Story" , -- Diet 1012[ 0x5D ] ="Treasure Hunt" , 1013[ 0x5E ] ="Realgam Colosseum" , 1014[ 0x5F ] ="Vapor Story" , 1015[ 0x60 ] ="Final Destination" , -- Diet 1016[ 0x61 ] ="Battlefield" , -- Diet 1017[ 0x62 ] ="Pokémon Stadium" , -- Diet 1018[ 0x63 ] ="Galacta Battleground" , 1019} 1020 1021local BEYOND_MELEE_SERIES ={ 1022[ 0x47 ] ="Super Smash Bros" , -- Volleyball 1023[ 0x48 ] ="Animal Crossing" , -- Smashville 1024[ 0x49 ] ="Pokémon" , -- Sprout Tower 1025[ 0x4A ] ="Kirby" , -- Fountain of Dreams 1026[ 0x4B ] ="Super Smash Bros" , -- Flipper Field 1027[ 0x4C ] ="Metroid" , -- Brinstar Lab 1028[ 0x4D ] ="Super Mario" , -- Metal Cavern? (Currently broken in BM-1.0) 1029[ 0x4E ] ="F-Zero" , -- Mute Circuit 1030[ 0x4F ] ="Donkey Kong" , -- Kongo Falls 1031[ 0x50 ] ="Kirby" , -- Town Greens 1032[ 0x51 ] ="Donkey Kong" , -- Kongle Jungle 64 1033[ 0x52 ] ="Pokémon" , -- Poké Float Stadium 2 1034[ 0x53 ] ="Super Mario" , -- Rainbow Ride 1035[ 0x54 ] ="Yoshi" , -- Island Zone 1036[ 0x55 ] ="Kirby" , -- Wasteland 1037[ 0x56 ] ="Yoshi" , -- Baby Bowser's Castle 1038[ 0x57 ] ="Super Smash Bros" , -- Midnight Destination 1039[ 0x58 ] ="Super Smash Bros" , -- Midnight Battlefield 1040[ 0x59 ] ="Super Smash Bros" , -- Dual Zone 1041[ 0x5A ] ="Kirby" , -- Fountain of Dreams (Diet) (Currently broken in BM-1.0) 1042[ 0x5B ] ="Pokémon" , -- Stadium-ville (Diet) (Currently broken in BM-1.0) 1043[ 0x5C ] ="Yoshi" , -- Yoshi's Story (Diet) 1044[ 0x5D ] ="Yoshi" , -- Treasure Hunt 1045[ 0x5E ] ="Pokémon" , -- Realgam Colosseum 1046[ 0x5F ] ="Yoshi" , -- Vapor Story 1047[ 0x60 ] ="Super Smash Bros" , -- Final Destination (Diet) 1048[ 0x61 ] ="Super Smash Bros" , -- Battlefield (Diet) 1049[ 0x62 ] ="Pokémon" , -- Pokémon Stadium (Diet) 1050[ 0x63 ] ="Kirby" , -- Galacta Battleground 1051} 1052 1053function melee . isNetplayGame () 1054return memory . menu . major == MENU_VS_UNKNOWN and ( memory . menu . minor == MENU_VS_UNKNOWN_INGAME or memory . menu . minor == MENU_VS_UNKNOWN_VERSUS ) 1055end 1056 1057function melee . isTeams () 1058if melee . isSinglePlayerGame () and not melee . isNetplayGame () then 1059return false 1060elseif melee . isInGame () then 1061return memory . match . teams 1062else 1063return memory . menu . teams 1064end 1065end 1066 1067function melee . isSinglePlayerGame () 1068local major =memory . menu . major 1069return major == MENU_ALL_STAR_MODE or major == MENU_TRAINING_MODE or 1070major == MENU_EVENT_MATCH or major == MENU_CLASSIC_MODE or 1071major == MENU_ADVENTURE_MODE or major == MENU_TARGET_TEST or 1072( major >= MENU_HOME_RUN_CONTEST and major <= MENU_CRUEL_MELEE ) or 1073major == MENU_VS_UNKNOWN 1074end 1075 1076function melee . isBTTStage ( id ) 1077return BREAK_THE_TARGETS_STAGES [ id ] ~= nil 1078end 1079 1080function melee . isSinglePlayerStage ( id ) 1081return SINGLEPLAYER_STAGES [ id ] ~= nil 1082end 1083 1084function melee . getSinglePlayerStages () 1085return SINGLEPLAYER_STAGES 1086end 1087 1088function melee . getAllStages () 1089return STAGE_NAMES 1090end 1091 1092function melee . getAkaneiaStages () 1093return AKANEIA_STAGES 1094end 1095 1096function melee . getAkaneiaSeries () 1097return AKANEIA_SERIES 1098end 1099 1100function melee . isAkaneiaStage ( id ) 1101if melee . isAkaneia () then 1102return AKANEIA_STAGES [ id ] ~= nil 1103end 1104return false 1105end 1106 1107function melee . getBeyondMeleeStages () 1108return BEYOND_MELEE_STAGES 1109end 1110 1111function melee . getBeyondMeleeSeries () 1112return BEYOND_MELEE_SERIES 1113end 1114 1115function melee . isBeyondMeleeStage ( id ) 1116if melee . isBeyondMelee () then 1117return BEYOND_MELEE_STAGES [ id ] ~= nil 1118end 1119return false 1120end 1121 1122function melee . getStageName ( id ) 1123if melee . isAkaneia () and AKANEIA_STAGES [ id ] then 1124return AKANEIA_STAGES [ id ] 1125elseif melee . isBeyondMelee () and BEYOND_MELEE_STAGES [ id ] then 1126return BEYOND_MELEE_STAGES [ id ] 1127end 1128return STAGE_NAMES [ id ] or SINGLEPLAYER_STAGES [ id ] or BREAK_THE_TARGETS_STAGES [ id ] 1129end 1130 1131function melee . getAllStageSeries () 1132return STAGE_SERIES 1133end 1134 1135function melee . getStageSeries ( id ) 1136if melee . isAkaneia () and AKANEIA_SERIES [ id ] then 1137return AKANEIA_SERIES [ id ] 1138elseif melee . isBeyondMelee () and BEYOND_MELEE_SERIES [ id ] then 1139return BEYOND_MELEE_SERIES [ id ] 1140end 1141return STAGE_SERIES [ id ] 1142end 1143 1144function melee . matchFinsihed () 1145return memory . match . finished == true 1146end 1147 1148function melee . isInGame () 1149if not memory . menu then return false end 1150 1151if memory . menu . major == MENU_ALL_STAR_MODE and memory . menu . minor < MENU_ALL_STAR_CSS then 1152-- Even = playing the match 1153-- Odd = in the rest area 1154--return memory.menu.minor % 2 == 0 1155return true 1156end 1157if PANEL_SETTINGS : IsSlippiReplay () and memory . menu . major == MENU_START_MATCH then 1158return memory . menu . minor == MENU_START_MATCH_INGAME 1159end 1160if memory . menu . major == MENU_VS_MODE or memory . menu . major == MENU_VS_UNKNOWN then 1161return memory . menu . minor == MENU_VS_INGAME 1162end 1163if memory . menu . major >= MENU_TRAINING_MODE and memory . menu . major <= MENU_STAMINA_MODE or memory . menu . major == MENU_FIXED_CAMERA_MODE then 1164return memory . menu . minor == MENU_TRAINING_INGAME 1165end 1166if memory . menu . major == MENU_EVENT_MATCH then 1167return memory . menu . minor == MENU_EVENT_MATCH_INGAME 1168end 1169if memory . menu . major == MENU_CLASSIC_MODE and memory . menu . minor < MENU_CLASSIC_CONTINUE then 1170-- Even = Verus screen 1171-- Odd = playing the match 1172return memory . menu . minor % 2 == 1 1173end 1174if memory . menu . major == MENU_ADVENTURE_MODE then 1175return 1176memory . menu . minor == MENU_ADVENTURE_MUSHROOM_KINGDOM or 1177memory . menu . minor == MENU_ADVENTURE_MUSHROOM_KINGDOM_BATTLE or 1178memory . menu . minor == MENU_ADVENTURE_MUSHROOM_KONGO_JUNGLE_TINY_BATTLE or 1179memory . menu . minor == MENU_ADVENTURE_MUSHROOM_KONGO_JUNGLE_GIANT_BATTLE or 1180memory . menu . minor == MENU_ADVENTURE_UNDERGROUND_MAZE or 1181memory . menu . minor == MENU_ADVENTURE_HYRULE_TEMPLE_BATTLE or 1182memory . menu . minor == MENU_ADVENTURE_BRINSTAR or 1183memory . menu . minor == MENU_ADVENTURE_ESCAPE_ZEBES or 1184memory . menu . minor == MENU_ADVENTURE_GREEN_GREENS_KIRBY_BATTLE or 1185memory . menu . minor == MENU_ADVENTURE_GREEN_GREENS_KIRBY_TEAM_BATTLE or 1186memory . menu . minor == MENU_ADVENTURE_GREEN_GREENS_GIANT_KIRBY_BATTLE or 1187memory . menu . minor == MENU_ADVENTURE_CORNARIA_BATTLE_1 or 1188memory . menu . minor == MENU_ADVENTURE_CORNARIA_BATTLE_2 or 1189memory . menu . minor == MENU_ADVENTURE_CORNARIA_BATTLE_3 or 1190memory . menu . minor == MENU_ADVENTURE_POKEMON_STADIUM_BATTLE or 1191memory . menu . minor == MENU_ADVENTURE_FZERO_GRAND_PRIX_RACE or 1192memory . menu . minor == MENU_ADVENTURE_FZERO_GRAND_PRIX_BATTLE or 1193memory . menu . minor == MENU_ADVENTURE_ONETT_BATTLE or 1194memory . menu . minor == MENU_ADVENTURE_ICICLE_MOUNTAIN_CLIMB or 1195memory . menu . minor == MENU_ADVENTURE_BATTLEFIELD_BATTLE or 1196memory . menu . minor == MENU_ADVENTURE_BATTLEFIELD_METAL_BATTLE or 1197memory . menu . minor == MENU_ADVENTURE_FINAL_DESTINATION_BATTLE 1198end 1199if memory . menu . major == MENU_TARGET_TEST then 1200return memory . menu . minor == MENU_TARGET_TEST_INGAME 1201end 1202if memory . menu . major >= MENU_SUPER_SUDDEN_DEATH and memory . menu . major <= MENU_LIGHTNING_MELEE then 1203return memory . menu . minor == MENU_SSD_INGAME 1204end 1205if memory . menu . major >= MENU_HOME_RUN_CONTEST and memory . menu . major <= MENU_CRUEL_MELEE then 1206return memory . menu . minor == MENU_HOME_RUN_CONTEST_INGAME 1207end 1208if memory . menu . major == MENU_TITLE_SCREEN_IDLE then 1209return memory . menu . minor == MENU_TITLE_SCREEN_IDLE_FIGHT_1 or memory . menu . minor == MENU_TITLE_SCREEN_IDLE_FIGHT_2 1210end 1211return false 1212end 1213 1214function melee . isInMenus () 1215if not memory . menu then return false end 1216 1217if memory . menu . major == MENU_MAIN_MENU then 1218return true 1219end 1220if memory . menu . major == MENU_VS_MODE or memory . menu . major == MENU_VS_UNKNOWN then 1221return memory . menu . minor == MENU_VS_CSS or memory . menu . minor == MENU_VS_SSS 1222end 1223if memory . menu . major >= MENU_TRAINING_MODE and memory . menu . major <= MENU_STAMINA_MODE or memory . menu . major == MENU_FIXED_CAMERA_MODE then 1224return memory . menu . minor == MENU_TRAINING_CSS or memory . menu . minor == MENU_TRAINING_SSS 1225end 1226if memory . menu . major == MENU_EVENT_MATCH then 1227return memory . menu . minor == MENU_EVENT_MATCH_SELECT 1228end 1229if memory . menu . major == MENU_CLASSIC_MODE or memory . menu . major == MENU_ADVENTURE_MODE or memory . menu . major == MENU_ALL_STAR_MODE then 1230-- All the menu_mior values all match in these three modes, so just use the MENU_CLASSIC_CSS value for simplicity 1231return memory . menu . minor == MENU_CLASSIC_CSS 1232end 1233if memory . menu . major == MENU_TARGET_TEST then 1234return memory . menu . minor == MENU_TARGET_TEST_CSS 1235end 1236if memory . menu . major >= MENU_SUPER_SUDDEN_DEATH and memory . menu . major <= MENU_LIGHTNING_MELEE then 1237return memory . menu . minor == MENU_SSD_CSS or memory . menu . minor == MENU_SSD_SSS 1238end 1239if memory . menu . major >= MENU_HOME_RUN_CONTEST and memory . menu . major <= MENU_CRUEL_MELEE then 1240return memory . menu . minor == MENU_HOME_RUN_CONTEST_CSS 1241end 1242return false 1243end 1244 1245return melee