//--------------------------------------------------------------------------- void __fastcall TForm1::SAVEClick(TObject *Sender) //Form 5 -- Save game { char c; char buffer[10]; ifstream infile; infile.open("DATA1.RC"); int nunu; while ((c=infile.peek())!=EOF) { infile>>nunu; Label1->Caption=nunu; if (Label1->Caption=="1") {Form5->Image1a->Visible=true;} if (Label1->Caption=="2") {Form5->Image1b->Visible=true;} if (Label1->Caption=="3") {Form5->Image1c->Visible=true;} if (Label1->Caption=="4") {Form5->Image1d->Visible=true;} } infile.close(); infile.open("DATA2.RC"); while ((c=infile.peek())!=EOF) { infile>>nunu; Label1->Caption=nunu; if (Label1->Caption=="1") {Form5->Image2a->Visible=true;} if (Label1->Caption=="2") {Form5->Image2b->Visible=true; } if (Label1->Caption=="3") {Form5->Image2c->Visible=true; } if (Label1->Caption=="4") {Form5->Image2d->Visible=true; } } infile.close(); infile.open("DATA3.RC"); while ((c=infile.peek())!=EOF) { infile>>nunu; Label1->Caption=nunu; if (Label1->Caption=="1") {Form5->Image3a->Visible=true; } if (Label1->Caption=="2") {Form5->Image3b->Visible=true; } if (Label1->Caption=="3") {Form5->Image3c->Visible=true; } if (Label1->Caption=="4") {Form5->Image3d->Visible=true;} } infile.close(); if (itemsword) {Form5->LabelSword->Caption="Yes"; } else{Form5->LabelSword->Caption="No";} if (itemshield) {Form5->LabelShield->Caption="Yes";} else{Form5->LabelShield->Caption="No";} if (itemhelm) {Form5->LabelHelm->Caption="Yes";} else{Form5->LabelHelm->Caption="No";} if (itemarmor) {Form5->LabelArmor->Caption="Yes";} else{Form5->LabelArmor->Caption="No";} Form5->ShowModal(); } //--------------------------------------------------------------------------- void __fastcall TForm1::OPENClick(TObject *Sender) //Form 6 -- Open game { char c; char buffer[10]; ifstream infile; infile.open("DATA1.RC"); int nunu; while ((c=infile.peek())!=EOF) { infile>>nunu; Label1->Caption=nunu; if (Label1->Caption=="1") {Form6->Image1a->Visible=true; } if (Label1->Caption=="2") {Form6->Image1b->Visible=true; } if (Label1->Caption=="3") {Form6->Image1c->Visible=true; } if (Label1->Caption=="4") {Form6->Image1d->Visible=true; } } infile.close(); infile.open("DATA2.RC"); while ((c=infile.peek())!=EOF) { infile>>nunu; Label1->Caption=nunu; if (Label1->Caption=="1") {Form6->Image2a->Visible=true;} if (Label1->Caption=="2") {Form6->Image2b->Visible=true; } if (Label1->Caption=="3") {Form6->Image2c->Visible=true; } if (Label1->Caption=="4") {Form6->Image2d->Visible=true; } } infile.close(); infile.open("DATA3.RC"); while ((c=infile.peek())!=EOF) { infile>>nunu; Label1->Caption=nunu; if (Label1->Caption=="1") {Form6->Image3a->Visible=true; } if (Label1->Caption=="2") {Form6->Image3b->Visible=true; } if (Label1->Caption=="3") {Form6->Image3c->Visible=true; } if (Label1->Caption=="4") {Form6->Image3d->Visible=true;} } infile.close(); if (itemsword) {Form6->LabelSword->Caption="Yes"; } else{Form6->LabelSword->Caption="No";} if (itemshield) {Form6->LabelShield->Caption="Yes";} else{Form6->LabelShield->Caption="No";} if (itemhelm) {Form6->LabelHelm->Caption="Yes";} else{Form6->LabelHelm->Caption="No";} if (itemarmor) {Form6->LabelArmor->Caption="Yes";} else{Form6->LabelArmor->Caption="No";} Form6->ShowModal(); //Form 6 is the Open window if (LabelSwordQuery->Caption=="No") {itemsword=false;} else{itemsword=true;} if (LabelShieldQuery->Caption=="No") {itemshield=false;} else{itemshield=true;} if (LabelHelmQuery->Caption=="No") {itemhelm=false;} else {itemhelm=true;} if (LabelArmorQuery->Caption=="No") {itemarmor=false;} else {itemarmor=true;} //LabelSwordQuery->Caption="No"; //LabelSwordQuery } //--------------------------------------------------------------------------- void TForm1::OpenDoor1(void) //homemaid { Door1->LoadFromResourceName((int)HInstance, "DOOROPENED"); OpenDoor(); } //---------------------------------------------------------- void TForm1::OpenDoor2(void) //homemaid { Door2->LoadFromResourceName((int)HInstance, "DOOROPENED"); OpenDoor(); } //---------------------------------------------------------- void TForm1::OpenDoor3(void) //homemaid { Door3->LoadFromResourceName((int)HInstance, "DOOROPENED"); OpenDoor(); } //---------------------------------------------------------- void TForm1::OpenDoor4(void) //homemaid { Door4->LoadFromResourceName((int)HInstance, "DOOROPENED"); OpenDoor(); } //---------------------------------------------------------- void TForm1::OpenDoor5(void) //homemaid { Door5->LoadFromResourceName((int)HInstance, "DOOROPENED"); OpenDoor(); } //------------------------