function OpenGroundCharaSelectFlow(selectType)
  local retPokemonIndex
  if selectType == nil then
    selectType = "hero"
  end
  local resumeData = FlowSys:Suspend()
  FlowSys:Start()
  ShopSys:Start()
  function FlowSys.Proc.CharaSelectStart()
    if selectType == "hero" then
      retPokemonIndex = dispHeroSelectMenu()
    elseif selectType == "partner" then
      retPokemonIndex = dispPartnerSelectMenu()
    end
    GROUND:SetJoinedPokemon(retPokemonIndex)
    FlowSys:Next("FlowComplete")
  end
  function FlowSys.Proc.FlowComplete()
    WINDOW:CloseMessage()
    FlowSys:Return()
  end
  FlowSys:Call("CharaSelectStart")
  WINDOW:CloseMessage()
  FlowSys:Finish()
  ShopSys:Finish()
  FlowSys:Resume(resumeData)
  return retPokemonIndex
end
function OpenGroundCharaSelectNameInputFlow(selectType)
  local resumeData = FlowSys:Suspend()
  FlowSys:Start()
  ShopSys:Start()
  function FlowSys.Proc.CharaNameInputStart()
    local defaultName = ""
    local captionId = 695113495
    if selectType == "hero" then
      defaultName = GROUND:GetPokemonNameForPokemonWarehouseDefault(SymAct("HERO"):GetIndex())
      captionId = 1410949970
    elseif selectType == "partner" then
      defaultName = GROUND:GetPokemonNameForPokemonWarehouseDefault(SymAct("PARTNER"):GetIndex())
      captionId = 37995732
    elseif selectType == "team" then
      defaultName = 907005331
      captionId = 458814869
    end
    local nameInputMenu = MENU:CreateNameInputMenu(ScreenType.B)
    nameInputMenu:SetTitleText(captionId)
    nameInputMenu:SetText(defaultName)
    function nameInputMenu:decideAction()
      defaultName = nameInputMenu:GetText()
      self:Close()
    end
    function nameInputMenu:cancelAction()
      defaultName = nameInputMenu:GetText()
      self:Close()
    end
    function nameInputMenu:currentItemChange()
    end
    function nameInputMenu:openedAction()
    end
    function nameInputMenu:closedAction()
    end
    function nameInputMenu:ngAction()
      WINDOW:SetMessageScreenMode(ScreenType.B)
      WINDOW:SysMsg(998639762)
      WINDOW:CloseMessage()
      WINDOW:SetMessageScreenMode(ScreenType.A)
    end
    WINDOW:CloseMessage()
    CommonSys:BeginLowerMenuNavi(nil, nil, false)
    SCREEN_B:FadeIn(TimeSec(0), false)
    SCREEN_B:FadeInAll(TimeSec(0.5), false)
    nameInputMenu:Open()
    MENU:SetFocus(nameInputMenu)
    MENU:WaitClose(nameInputMenu)
    CommonSys:EndLowerMenuNavi(true)
    SCREEN_B:FadeOutAll(TimeSec(0.5), true)
    SCREEN_B:FadeOut(TimeSec(0), false)
    FlowSys.Stat.name = defaultName
    FlowSys:Next("Confirm")
  end
  function FlowSys.Proc.Confirm()
    local msg, yes, no
    if selectType == "hero" then
      msg = 390492974
      yes = -985343595
      no = 1693592328
    elseif selectType == "partner" then
      msg = -1854513717
      yes = -1423248690
      no = 1226420175
    elseif selectType == "team" then
      msg = -1717754978
      yes = 1179124890
      no = 1557528484
    end
    MENU:SetTag_String(0, FlowSys.Stat.name)
    ShopSys:SysMsgAskFlowNoClose(msg, nil, {
      next = "CharaNameInputStart"
    }, {
      text = yes,
      next = "FlowComplete"
    }, {
      text = no,
      next = "CharaNameInputStart"
    })
  end
  function FlowSys.Proc.FlowComplete()
    WINDOW:CloseMessage()
    if selectType == "hero" then
      GROUND:SetPokemonWarehouseHeroName(FlowSys.Stat.name)
    elseif selectType == "partner" then
      GROUND:SetPokemonWarehousePartnerName(FlowSys.Stat.name)
    elseif selectType == "team" then
      GROUND:SetPartyName(FlowSys.Stat.name)
    end
    FlowSys:Return()
  end
  FlowSys:Call("CharaNameInputStart")
  WINDOW:CloseMessage()
  FlowSys:Finish()
  ShopSys:Finish()
  FlowSys:Resume(resumeData)
end
function dispHeroSelectMenu()
  local charaSet = {
    45,
    122,
    39,
    1,
    42
  }
  local selectPokemonIndex = dispCharaSelectMenu({
    charaSet = charaSet,
    charaCenterScale = 1,
    msg_ask = 463952514,
    msg_select_ok = -769240979,
    msg_select_ok_yes = -1258137749,
    msg_select_ok_no = -954358346,
    isPartner = false
  })
  GROUND:SetPokemonWarehouseHero(selectPokemonIndex, "???", 5)
  return selectPokemonIndex
end
function dispPartnerSelectMenu()
  local charaSet = {
    45,
    122,
    39,
    1,
    42
  }
  charaSetNoHero = {}
  for i, v in ipairs(charaSet) do
    if SymAct("HERO"):GetIndex() ~= v then
      table.insert(charaSetNoHero, v)
    end
  end
  local selectPokemonIndex = dispCharaSelectMenu({
    charaSet = charaSetNoHero,
    charaCenterScale = 1,
    msg_ask = 1405772237,
    msg_select_ok = -624321941,
    msg_select_ok_yes = -865960769,
    msg_select_ok_no = 854504967,
    msg_select_sex = 832791183,
    msg_select_sex_girl = -769697820,
    msg_select_sex_boy = -1774124066,
    isPartner = true
  })
  local name = GROUND:GetPokemonNameForPokemonWarehouseDefault(selectPokemonIndex)
  GROUND:SetPokemonWarehousePartner(selectPokemonIndex, name, 5)
  if FLAG.PartnerSexType == CONST.SEX_TYPE_BOY then
    SYSTEM:SetPartnerSex(SEX.MALE)
  else
    SYSTEM:SetPartnerSex(SEX.FEMALE)
  end
  return selectPokemonIndex
end
function dispCharaSelectMenu(optTbl)
  local selectPokemonIndex
  local titleBoardMenu = MENU:CreateBoardMenuWindow(ScreenType.A)
  titleBoardMenu:SetLayoutRect(Rectangle(0, 0, 400, 320))
  titleBoardMenu:SetTextOffset(0, 20)
  titleBoardMenu:Open()
  titleBoardMenu:SetOption({font = "FONT_16", showBgFrame = false})
  local charaInfoMenu = MENU:CreateBoardMenuWindow(ScreenType.B)
  charaInfoMenu:SetLayoutRect(Rectangle(24, 40, 272, 172))
  charaInfoMenu:SetTextOffset(0, 0)
  charaInfoMenu:Open()
  charaInfoMenu:SetOption({font = "FONT_12", showBgFrame = true})
  function charaInfoMenu:closedAction()
    if self.faceMenu then
      self.faceMenu:Close()
    end
  end
  local baseFunc = charaInfoMenu.SetVisible
  function charaInfoMenu:SetVisible(flag)
    baseFunc(self, flag)
    self.faceMenu:SetVisible(flag)
  end
  function charaInfoMenu:SetCharaType(pokemonIndex)
    if self.lastPokemonIndex == pokemonIndex then
      return
    end
    self.lastPokemonIndex = pokemonIndex
    if self.faceMenu then
      self.faceMenu:Close()
    end
    self.faceMenu = MENU:CreateFaceMenuWindow(ScreenType.B)
    self.faceMenu:SetFacePos(28, 44)
    self.faceMenu:SetPokemonIndex(pokemonIndex)
    self.faceMenu:SetFaceType(FACE_TYPE.NORMAL)
    self.faceMenu:Open()
    local pokeTbl = {
      [45] = -391927830,
      [122] = -757706441,
      [39] = 446223748,
      [1] = 494718355,
      [42] = 989755712
    }
    local textTbl = {
      1859713781,
      2016741011,
      -1592969662,
      804712554,
      -1346052610,
      -470462443,
      -414923681,
      194943263,
      pokeTbl[pokemonIndex]
    }
    local infTbl = GROUND:GetCharaSelectPokemonInfoTbl(pokemonIndex)
    if infTbl.wazaName[1] then
      table.insert(textTbl, -642297661)
    end
    if infTbl.wazaName[2] then
      table.insert(textTbl, -224787712)
    end
    if infTbl.wazaName[3] then
      table.insert(textTbl, -343854527)
    end
    if infTbl.wazaName[4] then
      table.insert(textTbl, -1530878842)
    end
    MENU:SetTag_Value(0, infTbl.lv)
    MENU:SetTag_Value(1, infTbl.hp)
    MENU:SetTag_Value(2, infTbl.atk)
    MENU:SetTag_Value(3, infTbl.def)
    MENU:SetTag_Value(4, infTbl.exAtk)
    MENU:SetTag_Value(5, infTbl.exDef)
    MENU:SetTag_Value(6, infTbl.wazaPP[1] and infTbl.wazaPP[1] or 0)
    MENU:SetTag_Value(7, infTbl.wazaPP[2] and infTbl.wazaPP[2] or 0)
    MENU:SetTag_Value(8, infTbl.wazaPP[3] and infTbl.wazaPP[3] or 0)
    MENU:SetTag_Value(9, infTbl.wazaPP[4] and infTbl.wazaPP[4] or 0)
    MENU:SetTag_String(0, infTbl.type0)
    MENU:SetTag_String(1, infTbl.type1)
    MENU:SetTag_String(2, infTbl.abiName)
    MENU:SetTag_String(3, infTbl.wazaName[1] and infTbl.wazaName[1] or "")
    MENU:SetTag_String(4, infTbl.wazaName[2] and infTbl.wazaName[2] or "")
    MENU:SetTag_String(5, infTbl.wazaName[3] and infTbl.wazaName[3] or "")
    MENU:SetTag_String(6, infTbl.wazaName[4] and infTbl.wazaName[4] or "")
    local text = ""
    for i, v in ipairs(textTbl) do
      text = text .. MENU:ReplaceTagText(v)
    end
    self:SetText(text)
  end
  local faceImgOffsTbl = {
    [1] = {u = 0, v = 0},
    [39] = {u = 80, v = 0},
    [42] = {u = 160, v = 0},
    [45] = {u = 0, v = 80},
    [122] = {u = 80, v = 80}
  }
  local sprPtnTbl = {}
  for i, pokeIdx in ipairs(optTbl.charaSet) do
    table.insert(sprPtnTbl, {
      name = "face0" .. i,
      img = "FACE_DOUBLE",
      u = faceImgOffsTbl[pokeIdx].u,
      v = faceImgOffsTbl[pokeIdx].v,
      w = 80,
      h = 80,
      cx = 40,
      cy = 40
    })
  end
  table.insert(sprPtnTbl, {
    name = "faceFrame",
    img = "FACE02",
    u = 0,
    v = 0,
    w = 112,
    h = 112,
    cx = 56,
    cy = 56
  })
  table.insert(sprPtnTbl, {
    name = "nameFrame",
    img = "WINDOW_NAME",
    u = 0,
    v = 0,
    w = 128,
    h = 32,
    cx = 64,
    cy = 16
  })
  SPRITE:CreatePatternSetFromTable("faceSet", sprPtnTbl)
  SAJI:CreateSajiPlayer("CursorL", "CURSOR_LEFT")
  SAJI:CreateSajiPlayer("CursorR", "CURSOR_RIGHT")
  SJ("CursorL"):SetPosition(Vector2(144, 112))
  SJ("CursorR"):SetPosition(Vector2(256, 112))
  SJ("CursorL"):Play(LOOP.ON)
  SJ("CursorR"):Play(LOOP.ON)
  SJ("CursorL"):SetVisible(true)
  SJ("CursorR"):SetVisible(true)
  SJ("CursorL"):SetDrawPriority(0)
  SJ("CursorR"):SetDrawPriority(0)
  SJ("CursorL"):SetParallax(-0.2)
  SJ("CursorR"):SetParallax(-0.2)
  local sprtNameFrame = SPRITE:CreateSprite("faceGrp", "sprNameFrame")
  sprtNameFrame:SetOption({
    textureFilter = TEXTURE_FILTER_MODE.LINEAR
  })
  sprtNameFrame:SetPosition(Vector2(200, 28))
  sprtNameFrame:SetPattern({
    setName = "faceSet",
    ptnName = "nameFrame",
    ofsX = 0,
    ofsY = 0,
    ofsPrio = 800,
    ofsParallax = -0.5
  })
  sprtNameFrame:SetVisible(true)
  local ptnNum = #optTbl.charaSet
  local ccScale = optTbl.charaCenterScale
  local pointTbl = {
    {
      pos = Vector2(104, 110),
      alpha = 0,
      scale = 0.13333333333333333,
      prio = 8,
      ofsPara = 2
    },
    {
      pos = Vector2(72, 110),
      alpha = 0.8,
      scale = 0.26666666666666666,
      prio = 4,
      ofsPara = 1
    },
    {
      pos = Vector2(123.2, 110),
      alpha = 1,
      scale = 0.5333333333333333,
      prio = 2,
      ofsPara = -0.5
    },
    {
      pos = Vector2(200, 110),
      alpha = 1,
      scale = ccScale,
      prio = 1,
      ofsPara = -1.4
    },
    {
      pos = Vector2(276.8, 110),
      alpha = 1,
      scale = 0.5333333333333333,
      prio = 2,
      ofsPara = -0.5
    },
    {
      pos = Vector2(328, 110),
      alpha = 0.8,
      scale = 0.26666666666666666,
      prio = 4,
      ofsPara = 1
    },
    {
      pos = Vector2(296, 110),
      alpha = 0,
      scale = 0.13333333333333333,
      prio = 8,
      ofsPara = 2
    }
  }
  local workTbl = {}
  local indexMod = function(idx, num)
    return (idx - 1) % num + 1
  end
  local alphaBlend = function(a, b, alpha)
    return a * alpha + b * (1 - alpha)
  end
  for idx = 1, 6 do
    workTbl[idx] = {}
    workTbl[idx].sprt = SPRITE:CreateSprite("faceGrp", "sprFace0" .. idx)
    workTbl[idx].sprt:SetOption({
      textureFilter = TEXTURE_FILTER_MODE.LINEAR
    })
    workTbl[idx].nowIdx = idx
    workTbl[idx].sprNo = (idx - 1) % ptnNum + 1
    workTbl[idx].nowPoint = pointTbl[workTbl[idx].nowIdx]
    workTbl[idx].Move = function(self, dir)
      if self.nowIdx == 1 and dir < 0 then
        self.nowPoint = pointTbl[7]
        self.nextPoint = pointTbl[6]
        self.sprNo = indexMod(workTbl[indexMod(idx - 1, 6)].sprNo + 1, ptnNum)
        self.nowIdx = 6
      elseif self.nowIdx == 7 and dir > 0 then
        self.nowPoint = pointTbl[1]
        self.nextPoint = pointTbl[2]
        self.sprNo = indexMod(workTbl[indexMod(idx + 1, 6)].sprNo - 1, ptnNum)
        self.nowIdx = 2
      else
        self.nowPoint = pointTbl[self.nowIdx]
        self.nextPoint = pointTbl[self.nowIdx + dir]
        self.nowIdx = self.nowIdx + dir
      end
      self.animRaito = 0
      self.animDelta = 0.2
      self.sprt:SetVisible(true)
    end
    workTbl[idx].Select = function(self)
      self.state = "select"
      self.animRaito = 0
      self.animDelta = 0.12
    end
    workTbl[idx].Continue = function(self)
      self.state = "continue"
      self.animRaito = 0
      self.animDelta = 0.2
    end
    workTbl[idx].Finish = function(self)
      self.state = "finish"
    end
    do
      local ptnTbl0 = {
        setName = "faceSet",
        ptnName = "",
        ofsX = 0,
        ofsY = 0,
        ofsPrio = 0,
        ofsParallax = 0
      }
      local ptnTbl1 = {
        setName = "faceSet",
        ptnName = "faceFrame",
        ofsX = 0,
        ofsY = 0,
        ofsPrio = 0,
        ofsParallax = 0
      }
      workTbl[idx].Tick = function(self)
        local pos = Vector2(self.nowPoint.pos)
        local alpha = self.nowPoint.alpha
        local scale = self.nowPoint.scale
        local prio = self.nowPoint.prio
        local ofsPara = self.nowPoint.ofsPara
        local state = self.state
        if state == "finish" then
          return
        elseif state == "select" then
          self.animRaito = self.animRaito + self.animDelta
          if self.nowIdx ~= 4 then
            alpha = alphaBlend(0, workTbl[idx].nowPoint.alpha, self.animRaito)
          else
            scale = scale + 0.2 * math.sin(self.animRaito * 3.1415)
          end
          if self.animRaito > 1 then
            self.state = "selectWait"
            return
          end
          SJ("CursorL"):SetVisible(false)
          SJ("CursorR"):SetVisible(false)
        elseif state == "selectWait" then
          if self.nowIdx ~= 4 then
            alpha = 0
          end
          SJ("CursorL"):SetVisible(false)
          SJ("CursorR"):SetVisible(false)
        elseif state == "continue" then
          self.animRaito = self.animRaito + self.animDelta
          if self.nowIdx ~= 4 then
            alpha = alphaBlend(workTbl[idx].nowPoint.alpha, 0, self.animRaito)
          end
          if self.animRaito > 1 then
            SJ("CursorL"):SetVisible(true)
            SJ("CursorR"):SetVisible(true)
            self.state = nil
            return
          end
        elseif self.nextPoint then
          pos.x = self.nextPoint.pos.x * self.animRaito + self.nowPoint.pos.x * (1 - self.animRaito)
          pos.y = self.nextPoint.pos.y * self.animRaito + self.nowPoint.pos.y * (1 - self.animRaito)
          alpha = self.nextPoint.alpha * self.animRaito + self.nowPoint.alpha * (1 - self.animRaito)
          scale = self.nextPoint.scale * self.animRaito + self.nowPoint.scale * (1 - self.animRaito)
          prio = self.nextPoint.prio * self.animRaito + self.nowPoint.prio * (1 - self.animRaito)
          ofsPara = self.nextPoint.ofsPara * self.animRaito + self.nowPoint.ofsPara * (1 - self.animRaito)
          self.animRaito = self.animRaito + self.animDelta
          if self.animRaito > 1 then
            self.nowPoint = self.nextPoint
            self.nextPoint = nil
            if self.nowIdx == 0 or self.nowIdx == 7 then
              self.sprt:SetVisible(false)
            else
              self.sprt:SetVisible(true)
            end
          end
        elseif self.nowIdx == 4 then
          selectPokemonIndex = optTbl.charaSet[self.sprNo]
          MENU:SetTag_MonsterIndex(0, selectPokemonIndex)
        end
        titleBoardMenu:SetText("[CN][PB:0]")
        charaInfoMenu:SetCharaType(selectPokemonIndex)
        self.sprt:SetPosition(pos)
        ptnTbl0.ptnName = "face0" .. self.sprNo
        ptnTbl0.ofsPrio = prio + 1
        ptnTbl0.ofsParallax = ofsPara
        ptnTbl1.ofsPrio = prio
        ptnTbl1.ofsParallax = ofsPara + 0.1
        self.sprt:SetPattern(ptnTbl0, ptnTbl1)
        self.sprt:SetOption({
          alpha = alpha * 255,
          scale = Scale(scale)
        })
      end
    end
  end
  local cursorWork = {}
  cursorWork.animRaito = 0
  cursorWork.animDelta = 0
  function cursorWork:Move(dir)
    if dir > 0 then
      SJ("CursorL"):Pause(true)
    else
      SJ("CursorR"):Pause(true)
    end
    SJ("CursorL"):SetVisible(false)
    SJ("CursorR"):SetVisible(false)
    cursorWork.animRaito = 0
    cursorWork.animDelta = 0.1
    cursorWork.nowStat = "move"
  end
  function cursorWork:Tick()
    if self.nowStat == "move" then
      self.animRaito = self.animRaito + self.animDelta
      if self.animRaito > 1 then
        SJ("CursorL"):SetVisible(true)
        SJ("CursorR"):SetVisible(true)
        SJ("CursorL"):SetScale(Scale(1))
        SJ("CursorR"):SetScale(Scale(1))
        SJ("CursorL"):Play(LOOP.ON)
        SJ("CursorR"):Play(LOOP.ON)
        SJ("CursorL"):SetFrameTime(0)
        SJ("CursorR"):SetFrameTime(0)
        self.nowStat = nil
      end
    end
  end
  local function waitWork(judge)
    while true do
      local bAllFinish = true
      for i, work in ipairs(workTbl) do
        if judge(work) == false then
          bAllFinish = false
        end
      end
      if bAllFinish then
        break
      end
      coroutine.yield()
    end
  end
  local stateFuncTbl = {
    start = function()
      coroutine.yield()
      WINDOW:SysMsg(optTbl.msg_ask)
      return "loop"
    end,
    loop = function()
      coroutine.yield()
      while true do
        if PAD:Edge("(LEFT|RIGHT)") then
          if PAD:Edge("RIGHT") then
            for i, work in ipairs(workTbl) do
              work:Move(-1)
            end
            cursorWork:Move(-1)
          else
            for i, work in ipairs(workTbl) do
              work:Move(1)
            end
            cursorWork:Move(1)
          end
          SOUND:PlaySe(SymSnd("SE_SYS_SLIDE"))
        elseif PAD:Edge("A") then
          SOUND:PlaySe(SymSnd("SE_SYS_DECIDE_2"))
          waitWork(function(work)
            return work.nextPoint == nil
          end)
          coroutine.yield()
          WINDOW:ForceCloseMessage()
          titleBoardMenu:SetVisible(false)
          charaInfoMenu:SetVisible(false)
          sprtNameFrame:SetVisible(false)
          for i, work in ipairs(workTbl) do
            work:Select()
          end
          waitWork(function(work)
            return work.state == "selectWait"
          end)
          break
        end
        coroutine.yield()
      end
      return "select"
    end,
    select = function()
      coroutine.yield()
      WINDOW:ForceCloseMessage()
      WINDOW:SysMsg(optTbl.msg_select_ok)
      WINDOW:SelectStart()
      WINDOW:SelectChain(optTbl.msg_select_ok_yes, 1)
      WINDOW:SelectChain(optTbl.msg_select_ok_no, 0)
      local isOk = false
      if WINDOW:SelectEnd(MENU_SELECT_MODE.ENABLE_CANCEL) == 1 then
        if optTbl.isPartner then
          WINDOW:SysMsg(optTbl.msg_select_sex)
          WINDOW:SelectStart()
          WINDOW:SelectChain(optTbl.msg_select_sex_boy, 0)
          WINDOW:SelectChain(optTbl.msg_select_sex_girl, 1)
          local selectSex = WINDOW:SelectEnd(MENU_SELECT_MODE.ENABLE_CANCEL)
          if selectSex == 0 then
            FLAG.PartnerSexType = CONST.SEX_TYPE_BOY
            isOk = true
          elseif selectSex == 1 then
            FLAG.PartnerSexType = CONST.SEX_TYPE_GIRL
            isOk = true
          elseif selectSex < 0 then
          end
        else
          isOk = true
        end
      end
      if isOk then
        for i, work in ipairs(workTbl) do
          work:Finish()
        end
        return "finish"
      else
        WINDOW:SysMsg(optTbl.msg_ask)
        titleBoardMenu:SetVisible(true)
        charaInfoMenu:SetVisible(true)
        sprtNameFrame:SetVisible(true)
        for i, work in ipairs(workTbl) do
          work:Continue()
        end
        waitWork(function(work)
          return work.state == nil
        end)
        return "loop"
      end
    end,
    finish = function()
      waitWork(function(work)
        return work.state == "finish"
      end)
      return "exit"
    end
  }
  SCREEN_B:FadeIn(TimeSec(0), false)
  SCREEN_B:FadeInAll(TimeSec(0.5), false)
  local nowStatFunc = coroutine.wrap(stateFuncTbl.start)
  while true do
    collectgarbage("stop")
    local nextStateName
    while true do
      nextStateName = nowStatFunc()
      if nextStateName == nil or nextStateName == "exit" then
        break
      end
      nowStatFunc = coroutine.wrap(stateFuncTbl[nextStateName])
    end
    if nextStateName == "exit" then
      break
    end
    for i = 1, #workTbl do
      workTbl[i]:Tick()
    end
    cursorWork:Tick()
    collectgarbage("restart")
    TASK:Sleep(TimeSec(0))
  end
  SCREEN_B:FadeOutAll(TimeSec(0.5), false)
  SCREEN_B:FadeOut(TimeSec(0.5), false)
  titleBoardMenu:Close()
  charaInfoMenu:Close()
  WINDOW:ForceCloseMessage()
  SAJI:DestroySajiPlayer("CursorL")
  SAJI:DestroySajiPlayer("CursorR")
  SPRITE:DestroySpriteGroup("faceGrp")
  SPRITE:DestroyPatternSet("faceSet")
  return selectPokemonIndex
end
