[EntryPoint]class g:CoroutineScene{Font@Q,W;Image@a,b;array<string>L={"グラフィック","音声","プレイ","ユーザーステータス","AmenoshitaSkin"};
array<array<SettingItem@>>d={{GetSettingItem("Graphic","WaitVSync")},{GetSettingItem("Sound","BufferLatency"),GetSettingItem("Sound","VolumeTap"),GetSettingItem("Sound","VolumeExTap"),GetSettingItem("Sound","VolumeFlick"),GetSettingItem("Sound","VolumeAir"),GetSettingItem("Sound","VolumeAirAction")},{GetSettingItem("Play","EnableAutoPlay"),GetSettingItem("Play","JudgeAdjustSlider"),GetSettingItem("Play","JudgeMultiplierSlider"),GetSettingItem("Play","JudgeAdjustAirString"),GetSettingItem("Play","JudgeMultiplierAirString")},{GetSettingItem("Player","Name"),GetSettingItem("Player","NamePlateID"),GetSettingItem("Player","Profile"),GetSettingItem("Player","ProfileID"),GetSettingItem("Player","EmblemIconID"),GetSettingItem("Player","EmblemFrameID"),GetSettingItem("Player","Level"),GetSettingItem("Player","Rating"),GetSettingItem("Player","HiSpeed")},{GetSettingItem("Skin","OriginalBackGroundEffect"),GetSettingItem("Skin","MaxGauge"),GetSettingItem("Skin","ClearBorder")}};
Sprite@S,I;array<TextSprite@>M(10);array<TextSprite@>J(10);TextSprite@F;array<SettingItem@>@H;int N=0;
bool K=true;int D=0;int E=0;void Initialize(){e();@S=Sprite(a);S.Apply("z:-10");AddSprite(S);@F=TextSprite(W,"");
F.Apply("r:0, g:0, b:0, x:640, y:16, z:1");F.SetAlignment(TextAlign::Center,TextAlign::Top);AddSprite(F);
@I=Sprite(b);I.Apply("x:640, y:108, origX:512, origY:20, z:-1");AddSprite(I);for(int C=0;C<10;C++){int c=108+4+48*C;
@M[C]=TextSprite(Q,"");M[C].Apply("r:0, g:0, b:0, x:384, y:"+c);M[C].SetAlignment(TextAlign::Center,TextAlign::Center);
@J[C]=TextSprite(Q,"");J[C].Apply("r:0, g:0, b:0, x:896, y:"+c);J[C].SetAlignment(TextAlign::Center,TextAlign::Center);
AddSprite(M[C]);AddSprite(J[C]);}}void e(){Skin@O=GetSkin();@Q=O.GetFont("Normal32");@W=O.GetFont("Normal64");
@a=O.GetImage("White");@b=O.GetImage("CursorSetting");}void Draw(){}void Run(){T();U(E);RunCoroutine(Coroutine(f),"Setting:KeyInput");
while(true)YieldTime(1);}void U(int P){@H=@d[P];N=H.length();F.SetText(((P==0)?"":"← ")+L[P]+((P-(L.length()-1)==0)?"":" →"));
for(int C=0;C<10;C++){M[C].SetText((C<N)?H[C].GetDescription():"");J[C].SetText((C<N)?H[C].GetItemText():"");
}if(N==0)M[0].SetText("設定項目なし");}void T(){if(K){I.AddMove("alpha(x:1, y:0, time:0.2)");F.Apply("b:255");
F.SetText(((E==0)?"":"← ")+L[E]+((E-(L.length()-1)==0)?"":" →"));}else{I.AddMove("alpha(x:0, y:1, time:0.2)");
F.Apply("b:0");F.SetText(L[E]);}}void f(){while(true){if(IsKeyTriggered(Key::INPUT_UP)){if(!K&&D<=0){D=0;
K=true;T();}else{D--;int V=108+48*D;I.AddMove("move_to(x:640, y:"+V+", time:0.2, ease:out_sine)");}}if(IsKeyTriggered(Key::INPUT_DOWN)){if(K&&N>0){D=0;
K=false;T();}else{if(++D>=N)D--;int V=108+48*D;I.AddMove("move_to(x:640, y:"+V+", time:0.2, ease:out_sine)");
}}if(IsKeyTriggered(Key::INPUT_LEFT)){if(K){if(--E<0)E++;U(E);}else{H[D].MovePrevious();J[D].SetText(H[D].GetItemText());
}}if(IsKeyTriggered(Key::INPUT_RIGHT)){if(K){if(0>=L.length()-(++E))E--;U(E);}else{H[D].MoveNext();J[D].SetText(H[D].GetItemText());
}}if(IsKeyTriggered(Key::INPUT_ESCAPE)){if(Execute("Title.as"))Disappear();}YieldFrame(1);}}}