public boolean titlePartEnd=false;
public boolean dataLoadFlag=false;
public Graphics g;
private GameData gData=null;
public int[][] cursorPos=null;
public int mode=0;
public DataSaveLoad dataSL=null;
private GraphicSet gSet=null;
public TitlePart() { init();
}
public void init() { gData=new GameData(); cursorPos=new int[3][3]; mode=0; titlePartEnd=false; dataLoadFlag=false; for (int i=0;i<=2;i++) { for (int j=0;j<=2;j++) {
public void dataSet(GameData gdt) { init(); gData=gdt;
}
public void graPaint(Graphics gr) { g=gr; String[] word= {"[START]","[LOAD]"}; int stx=300; int sty=400; gSet.rectSet2(gr,stx,sty,150,80,0,0); for (int i=0;i<=word.length-1;i++) { gSet.wordDisp_short(gr,word[i],stx+22,sty+22+i*22); } gSet.wordDisp_short(gr,"→",stx,sty+22+cursorPos[0][0]*22); gSet.wordDisp_short3(gr,"RPG01 (TEST)",100,200,0,60); if (mode==1) { String[] moji= {"FILE0","FILE1","FILE2","FILE3","FILE4"}; gSet.rectSet2(gr,stx+150,sty,144,120,0,220); for (int i=0;i<=moji.length-1;i++) { gSet.wordDisp_short(gr,moji[i],stx+150+22,sty+22+i*22); } gSet.wordDisp_short(gr,"→",stx+150,sty+22+cursorPos[1][0]*22); }
}
public void eventStart(GameData gdt) { //PlayerPlatform pPlatform=gdt.pPlatform; int pushKey=0; int modeChange=999; gData=gdt; if (gData.pPlatform.keyPush[4]) { //space gData.pPlatform.keyPush[4]=false; pushKey=1; } if (gData.pPlatform.keyPush[5]) { //d gData.pPlatform.keyPush[5]=false; pushKey=2; } if (gData.pPlatform.keyPush[0]) { //up gData.pPlatform.keyPush[0]=false; cursorPos[mode][0]--; } if (gData.pPlatform.keyPush[1]) { //down gData.pPlatform.keyPush[1]=false; cursorPos[mode][0]++; }
if (pushKey==1) { if (mode==0) { int cp=cursorPos[0][0]; if (cp==0) {//はじめからスタート titlePartEnd=true; }
if (cp==1) {//ロード modeChange=1; } } //ロードするファイルを選ぶモード if (mode==1) { int cp=cursorPos[1][0]; dataLoad(); } } if (pushKey==2) { if (mode==1) { modeChange=0; } }
if (modeChange<=10) { mode=modeChange; } if (cursorPos[mode][0] > cursorPos[mode][1]) cursorPos[mode][0]=0; if (cursorPos[mode][0] < 0) cursorPos[mode][0]=cursorPos[mode][1];
}
public void dataLoad() { int fileNum=cursorPos[1][0]; dataSL.dataLoad(fileNum,gData); //ロード後はタイトルパートを終了する。 dataLoadFlag=true; titlePartEnd=true;
}