#include_function "script\Ikareimu\Stage.dnh"
#include_function "lib\ObjectDrawText\text.txt"
let MenuFont = "lib\ObjectDrawText\font.png";
let MenuBGTexture = "script\Ikareimu\img\MainMenuBackground.png";

let MainSelect = 1;
let DifficultySelect = 2;
let PracticeStageSelect = 1;
let PracticeDifficultySelect = 2;
let PracticeSpellStageSelect = 1;
let PracticeSpellSelect = 1;
let OptionSelect = 1;
let CurrentMenu = "main";

let OptionsLivesSelect;
let OptionsControlsSelect;

task MainMenu {
  let sfxSelect = "script\Ikareimu\sfx\ZUN\se_select00.wav";
  let sfxOk = "script\Ikareimu\sfx\ZUN\se_ok00.wav";
  let sfxCancel = "script\Ikareimu\sfx\ZUN\se_cancel00.wav";
  let sfxInvalid = "script\Ikareimu\sfx\ZUN\se_invalid.wav";
  //Load main menu graphics, sounds, and music here.
  LoadGraphic(MenuFont);
  LoadGraphic(MenuBGTexture);
  //Load options.
  OptionsLivesSelect = GetCommonDataDefaultEx("options", "lives", 2);
  OptionsControlsSelect = GetCommonDataDefaultEx("options", "controls", 0);
  yield ;
  DrawMainMenu;
  
  while(GetCommonData("gamestate")=="mainMenu"){
    while(CurrentMenu == "main"){
      if(GetKeyState(VK_UP)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(MainSelect!=1){
          MainSelect--;
        }
        else {
          MainSelect = 6;
        }
      }
      if(GetKeyState(VK_DOWN)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(MainSelect!=6){
          MainSelect++;
        }
        else {
          MainSelect = 1;
        }
      }
      if(GetKeyState(VK_SHOT)==KEY_PUSH){
        if(MainSelect==1){
          PlaySE(sfxOk);
          CurrentMenu = "startDifficulty";
        }
        if(MainSelect==2){
          if(GetCommonDataDefaultEx("unlockables", "extra", false)){
            PlaySE(sfxOk);
            CurrentMenu = "extra";
          }
          else {
            PlaySE(sfxInvalid);
          }
        }
        if(MainSelect==3){
          PlaySE(sfxOk);
          CurrentMenu = "practiceStartDifficulty";
        }
        if(MainSelect==4){
          if(GetCommonDataDefaultEx("unlockables", "spellpractice", false)){
            PlaySE(sfxOk);
            CurrentMenu = "spellcardPracticeStage";
          }
          else {
            PlaySE(sfxInvalid);
          }
        }
        if(MainSelect==5){
          PlaySE(sfxOk);
          CurrentMenu = "options";
        }
        if(MainSelect==6){
          PlaySE(sfxOk);
          SetCommonData("gameevent", "clear");
          return ;
        }
      }
      
      SetPlayerX(GetCenterX);
      SetPlayerY(GetClipMaxY-50);
      yield ;
    }

    while(CurrentMenu == "startDifficulty"){
      if(GetKeyState(VK_UP)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(DifficultySelect!=1){
          DifficultySelect--;
        }
        else {
          DifficultySelect = 5;
        }
      }
      if(GetKeyState(VK_DOWN)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(DifficultySelect!=5){
          DifficultySelect++;
        }
        else {
          DifficultySelect = 1;
        }
      }
      if(GetKeyState(VK_SHOT)==KEY_PUSH){
        PlaySE(sfxOk);
        if(DifficultySelect==1){
          SetCommonData("difficulty", "easy");
        }
        if(DifficultySelect==2){
          SetCommonData("difficulty", "normal");
        }
        if(DifficultySelect==3){
          SetCommonData("difficulty", "hard");
        }
        if(DifficultySelect==4){
          SetCommonData("difficulty", "lunatic");
        }
        if(DifficultySelect==5){
          SetCommonData("difficulty", "fuckingwhat");
        }
        SetCommonData("gameevent", "stage1");
        SetCommonData("gamemode", "start");
        ExtendPlayer(OptionsLivesSelect+1-GetPlayerLife);
        return ;
      }
      if(GetKeyState(VK_BOMB)==KEY_PUSH){
        PlaySE(sfxCancel);
        CurrentMenu = "main";
      }
      
      SetPlayerX(GetCenterX);
      SetPlayerY(GetClipMaxY-50);
      yield ;
      
    }
    
    while(CurrentMenu == "extra"){
      if(GetKeyState(VK_UP)==KEY_PUSH || GetKeyState(VK_DOWN)==KEY_PUSH){
        PlaySE(sfxSelect);
      }
      if(GetKeyState(VK_SHOT)==KEY_PUSH){
        PlaySE(sfxOk);
        SetCommonData("difficulty", "extra");
        SetCommonData("gameevent", "stageExtra");
        SetCommonData("gamemode", "extra");
        ExtendPlayer(3-GetPlayerLife);
        return ;
      }
      if(GetKeyState(VK_BOMB)==KEY_PUSH){
        PlaySE(sfxCancel);
        CurrentMenu = "main";
      }
      
      SetPlayerX(GetCenterX);
      SetPlayerY(GetClipMaxY-50);
      yield ;
    }
    
    while(CurrentMenu == "practiceStartDifficulty"){
      if(GetKeyState(VK_UP)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(PracticeDifficultySelect!=1){
          PracticeDifficultySelect--;
        }
        else {
          PracticeDifficultySelect = 5;
        }
      }
      if(GetKeyState(VK_DOWN)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(PracticeDifficultySelect!=5){
          PracticeDifficultySelect++;
        }
        else {
          PracticeDifficultySelect = 1;
        }
      }
      if(GetKeyState(VK_SHOT)==KEY_PUSH){
        PlaySE(sfxOk);
        if(PracticeDifficultySelect==1){
          SetCommonData("difficulty", "easy");
        }
        if(PracticeDifficultySelect==2){
          SetCommonData("difficulty", "normal");
        }
        if(PracticeDifficultySelect==3){
          SetCommonData("difficulty", "hard");
        }
        if(PracticeDifficultySelect==4){
          SetCommonData("difficulty", "lunatic");
        }
        if(PracticeDifficultySelect==5){
          SetCommonData("difficulty", "fuckingwhat");
        }
        CurrentMenu = "practiceStartStage";
      }
      if(GetKeyState(VK_BOMB)==KEY_PUSH){
        PlaySE(sfxCancel);
        CurrentMenu = "main";
      }
      
      SetPlayerX(GetCenterX);
      SetPlayerY(GetClipMaxY-50);
      yield ;
      
    }

    while(CurrentMenu == "practiceStartStage"){
      if(GetKeyState(VK_UP)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(PracticeStageSelect!=1){
          PracticeStageSelect--;
        }
        else {
          PracticeStageSelect = 6;
        }
      }
      if(GetKeyState(VK_DOWN)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(PracticeStageSelect!=6){
          PracticeStageSelect++;
        }
        else {
          PracticeStageSelect = 1;
        }
      }
      if(GetKeyState(VK_SHOT)==KEY_PUSH){
        if(GetCommonDataDefaultEx("unlockables", GetCommonData("difficulty")~IntString(PracticeStageSelect), false) || PracticeStageSelect==1){
          PlaySE(sfxOk);
          if(PracticeStageSelect == 1){
            SetCommonData("gameevent", "stage1");
          }
          if(PracticeStageSelect == 2){
            SetCommonData("gameevent", "stage2");
          }
          if(PracticeStageSelect == 3){
            SetCommonData("gameevent", "stage3");
          }
          if(PracticeStageSelect == 4){
            SetCommonData("gameevent", "stage4");
          }
          if(PracticeStageSelect == 5){
            SetCommonData("gameevent", "stage5");
          }
          if(PracticeStageSelect == 6){
            SetCommonData("gameevent", "stage6");
          }
          SetCommonData("gamemode", "practiceStart");
          ExtendPlayer(7-GetPlayerLife);
          return ;
        }
        else {
          PlaySE(sfxInvalid);
        }
      }
      if(GetKeyState(VK_BOMB)==KEY_PUSH){
        PlaySE(sfxCancel);
        CurrentMenu = "practiceStartDifficulty";
      }
      
      SetPlayerX(GetCenterX);
      SetPlayerY(GetClipMaxY-50);
      yield ;
    }
    
    while(CurrentMenu == "spellcardPracticeStage"){
      if(GetKeyState(VK_BOMB)==KEY_PUSH){
        PlaySE(sfxCancel);
        CurrentMenu = "main";
      }
      
      SetPlayerX(GetCenterX);
      SetPlayerY(GetClipMaxY-50);
      yield ;
      
    }
    
    while(CurrentMenu == "options"){
      if(GetKeyState(VK_UP)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(OptionSelect!=1){
          OptionSelect--;
        }
        else {
          OptionSelect = 5;
        }
      }
      if(GetKeyState(VK_DOWN)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(OptionSelect!=5){
          OptionSelect++;
        }
        else {
          OptionSelect = 1;
        }
      }
      if(GetKeyState(VK_LEFT)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(OptionSelect==1 && OptionsLivesSelect!=0){
          OptionsLivesSelect--;
        }
        if(OptionSelect==2 && OptionsControlsSelect!=0){
          OptionsControlsSelect--;
        }
      }
      if(GetKeyState(VK_RIGHT)==KEY_PUSH){
        PlaySE(sfxSelect);
        if(OptionSelect==1 && OptionsLivesSelect!=4){
          OptionsLivesSelect++;
        }
        if(OptionSelect==2 && OptionsControlsSelect!=2){
          OptionsControlsSelect++;
        }
      }
      if(GetKeyState(VK_SHOT)==KEY_PUSH){
        if(OptionSelect==3){
          PlaySE(sfxOk);
          OptionsLivesSelect = 2;
          OptionsControlsSelect = 0;
        }
        if(OptionSelect==4){
          PlaySE(sfxOk);
          ClearCommonDataEx("unlockables");
          
          if(!IsReplay){
            SaveCommonDataEx("unlockables", "script\Ikareimu\data\unlockables.dat");
          }
          
          CurrentMenu = "main";
        }
        if(OptionSelect==5){
          PlaySE(sfxOk);
          SetCommonDataEx("options", "lives", OptionsLivesSelect);
          SetCommonDataEx("options", "controls", OptionsControlsSelect);
          
          if(!IsReplay){
            SaveCommonDataEx("options", "script\Ikareimu\data\options.dat");
          }
          
          CurrentMenu = "main";
        }
      }
      if(GetKeyState(VK_BOMB)==KEY_PUSH){
        PlaySE(sfxCancel);
        SetCommonDataEx("options", "lives", OptionsLivesSelect);
        SetCommonDataEx("options", "controls", OptionsControlsSelect);
          
        if(!IsReplay){
            SaveCommonDataEx("options", "script\Ikareimu\data\options.dat");
        }
          
        CurrentMenu = "main";
      }

      SetPlayerX(GetCenterX);
      SetPlayerY(GetClipMaxY-50);
      yield ;
    }
    
    yield ;
  }
}

task DrawMainMenu {
  let MenuBG = Obj_Create(OBJ_EFFECT);
  ObjEffect_SetTexture(MenuBG, MenuBGTexture);
  ObjEffect_SetPrimitiveType(MenuBG, PRIMITIVE_TRIANGLEFAN);
  ObjEffect_SetLayer(MenuBG, 8);
  ObjEffect_CreateVertex(MenuBG, 4);
  ObjEffect_SetRenderState(MenuBG,ALPHA);
  ObjEffect_SetVertexUV(MenuBG, 0, 0, 0);
  ObjEffect_SetVertexUV(MenuBG, 1, 640, 0);
  ObjEffect_SetVertexUV(MenuBG, 2, 640, 480);
  ObjEffect_SetVertexUV(MenuBG, 3, 0, 480);
  ObjEffect_SetVertexXY(MenuBG, 0, 0, 0);
  ObjEffect_SetVertexXY(MenuBG, 1, 640, 0);
  ObjEffect_SetVertexXY(MenuBG, 2, 640, 480);
  ObjEffect_SetVertexXY(MenuBG, 3, 0, 480);
  let xSize = 0.6;
  let ySize = 0.75;
  while(GetCommonData("gamestate")=="mainMenu"){
    DrawMenuText;
  }
  CreateLoadingScreen;
  Wait(30);
  Obj_Delete(MenuBG);
  
  
  
  sub DrawMenuText {
    if(CurrentMenu=="main"){
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      if(MainSelect==1){
        DrawTextNew("Start", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Start", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(GetCommonDataDefault("extraUnlocked", false)){
        SetFontColorNew(255, 255, 255, 0, 0, 255);
      }
      else {
        SetFontColorNew(75, 75, 75, 255, 0, 0);
      }
      if(MainSelect==2){
        DrawTextNew("Extra Start", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Extra Start", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      if(MainSelect==3){
        DrawTextNew("Practice Start", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Practice Start", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(GetCommonDataDefault("spellcardPracticeUnlocked", false)){
        SetFontColorNew(255, 255, 255, 0, 0, 255);
      }
      else {
        SetFontColorNew(75, 75, 75, 255, 0, 0);
      }
      if(MainSelect==4){
        DrawTextNew("Spellcard Practice", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Spellcard Practice", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 128);
      }
      
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      if(MainSelect==5){
        DrawTextNew("Options", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Options", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 128);
      }
      
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      if(MainSelect==6){
        DrawTextNew("Quit", MenuFont, GetClipMinX+50, GetCenterY+50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Quit", MenuFont, GetClipMinX+50, GetCenterY+50, 0, xSize, ySize, 8, 1, 128);
      }
    }
    if(CurrentMenu=="startDifficulty"){
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      DrawTextNew("Select Difficulty", MenuFont, GetClipMinX+20, GetClipMinY+50, 0, xSize, ySize, 8, 1, 255);
      
      if(DifficultySelect==1){
        DrawTextNew("Easy", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Easy", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      if(DifficultySelect==2){
        DrawTextNew("Normal", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Normal", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      if(DifficultySelect==3){
        DrawTextNew("Hard", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Hard", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 128);
      }
      if(DifficultySelect==4){
        DrawTextNew("Lunatic", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Lunatic", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 128);
      }
      if(DifficultySelect==5){
        DrawTextNew("FuckingWhat", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("FuckingWhat", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 128);
      }
    }
    if(CurrentMenu=="extra"){
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      DrawTextNew("Select Difficulty", MenuFont, GetClipMinX+20, GetClipMinY+50, 0, xSize, ySize, 8, 1, 255);
      DrawTextNew("Extra", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
    }
    if(CurrentMenu=="practiceStartDifficulty"){
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      DrawTextNew("Select Difficulty", MenuFont, GetClipMinX+20, GetClipMinY+50, 0, xSize, ySize, 8, 1, 255);
      
      if(PracticeDifficultySelect==1){
        DrawTextNew("Easy", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Easy", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      if(PracticeDifficultySelect==2){
        DrawTextNew("Normal", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Normal", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      if(PracticeDifficultySelect==3){
        DrawTextNew("Hard", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Hard", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 128);
      }
      if(PracticeDifficultySelect==4){
        DrawTextNew("Lunatic", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Lunatic", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 128);
      }
      if(PracticeDifficultySelect==5){
        DrawTextNew("FuckingWhat", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("FuckingWhat", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 128);
      }
    }
    if(CurrentMenu=="practiceStartStage"){
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      DrawTextNew("Select Stage", MenuFont, GetClipMinX+20, GetClipMinY+50, 0, xSize, ySize, 8, 1, 255);
      
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      if(PracticeStageSelect==1){
        DrawTextNew("Stage 1", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Stage 1", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(GetCommonDataDefault(GetCommonData("difficulty")~"Stage"~IntString(2)~"Practice", false)){
        SetFontColorNew(255, 255, 255, 0, 0, 255);
      }
      else {
        SetFontColorNew(75, 75, 75, 255, 0, 0);
      }
      if(PracticeStageSelect==2){
        DrawTextNew("Stage 2", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Stage 2", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(GetCommonDataDefault(GetCommonData("difficulty")~"Stage"~IntString(3)~"Practice", false)){
        SetFontColorNew(255, 255, 255, 0, 0, 255);
      }
      else {
        SetFontColorNew(75, 75, 75, 255, 0, 0);
      }
      if(PracticeStageSelect==3){
        DrawTextNew("Stage 3", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Stage 3", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(GetCommonDataDefault(GetCommonData("difficulty")~"Stage"~IntString(4)~"Practice", false)){
        SetFontColorNew(255, 255, 255, 0, 0, 255);
      }
      else {
        SetFontColorNew(75, 75, 75, 255, 0, 0);
      }
      if(PracticeStageSelect==4){
        DrawTextNew("Stage 4", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Stage 4", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(GetCommonDataDefault(GetCommonData("difficulty")~"Stage"~IntString(5)~"Practice", false)){
        SetFontColorNew(255, 255, 255, 0, 0, 255);
      }
      else {
        SetFontColorNew(75, 75, 75, 255, 0, 0);
      }
      if(PracticeStageSelect==5){
        DrawTextNew("Stage 5", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Stage 5", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(GetCommonDataDefault(GetCommonData("difficulty")~"Stage"~IntString(6)~"Practice", false)){
        SetFontColorNew(255, 255, 255, 0, 0, 255);
      }
      else {
        SetFontColorNew(75, 75, 75, 255, 0, 0);
      }
      if(PracticeStageSelect==6){
        DrawTextNew("Stage 6", MenuFont, GetClipMinX+50, GetCenterY+50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Stage 6", MenuFont, GetClipMinX+50, GetCenterY+50, 0, xSize, ySize, 8, 1, 128);
      }
    }
    if(CurrentMenu=="spellcardPracticeStage"){
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      DrawText("Currently Not Implemented!", GetClipMinX+20, GetClipMinY+50, 24, 255);
      DrawText("In fact, stop editing my script to unlock this!", GetClipMinX+20, GetClipMinY+80, 12, 255);
    }
    if(CurrentMenu=="options"){
      SetFontColorNew(255, 255, 255, 0, 0, 255);
      DrawTextNew("Options", MenuFont, GetClipMinX+20, GetClipMinY+50, 0, xSize, ySize, 8, 1, 255);
      
      if(OptionSelect==1){
        DrawTextNew("Player", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Player", MenuFont, GetClipMinX+50, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsLivesSelect==0){
        DrawTextNew("0", MenuFont, GetClipMinX+200, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("0", MenuFont, GetClipMinX+200, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsLivesSelect==1){
        DrawTextNew("1", MenuFont, GetClipMinX+230, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("1", MenuFont, GetClipMinX+230, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsLivesSelect==2){
        DrawTextNew("2", MenuFont, GetClipMinX+260, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("2", MenuFont, GetClipMinX+260, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsLivesSelect==3){
        DrawTextNew("3", MenuFont, GetClipMinX+290, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("3", MenuFont, GetClipMinX+290, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsLivesSelect==4){
        DrawTextNew("4", MenuFont, GetClipMinX+320, GetCenterY-50, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("4", MenuFont, GetClipMinX+320, GetCenterY-50, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(OptionSelect==2){
        DrawTextNew("Switch", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Switch", MenuFont, GetClipMinX+50, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsControlsSelect==0){
        DrawTextNew("C", MenuFont, GetClipMinX+201, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("C", MenuFont, GetClipMinX+201, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsControlsSelect==1){
        DrawTextNew("Ctrl", MenuFont, GetClipMinX+250, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Ctrl", MenuFont, GetClipMinX+250, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionsControlsSelect==2){
        DrawTextNew("Shift+Z", MenuFont, GetClipMinX+350, GetCenterY-30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Shift+Z", MenuFont, GetClipMinX+350, GetCenterY-30, 0, xSize, ySize, 8, 1, 128);
      }
      
      if(OptionSelect==3){
        DrawTextNew("Default", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Default", MenuFont, GetClipMinX+50, GetCenterY-10, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionSelect==4){
        DrawTextNew("Clear Save Data", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Clear Save Data", MenuFont, GetClipMinX+50, GetCenterY+10, 0, xSize, ySize, 8, 1, 128);
      }
      if(OptionSelect==5){
        DrawTextNew("Back", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 255);
      }
      else {
        DrawTextNew("Back", MenuFont, GetClipMinX+50, GetCenterY+30, 0, xSize, ySize, 8, 1, 128);
      }
      
    }
    yield;
  }
}