Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int SM_POINTER_TILE = 500;
- const int SM_OPTION_1_Y = 40;
- const int SM_OPTION_2_Y = 40;
- const int SM_OPTION_3_Y = 40;
- const int SM_OPTION_4_Y = 40;
- const int SM_POINTER_X = 35;
- const int SM_TEXT_X = 55;
- const int SM_COST_1 = 10;
- const int SM_COST_2 = 10;
- const int SM_COST_3 = 5;
- const int SM_COST_4 = 5;
- ffc script SimpleMenu
- {
- void run()
- {
- bool done; int choice; int curpos = SM_OPTION_1_Y;
- int curpositions[]={ SM_OPTION_1_Y, SM_OPTION_2_Y, SM_OPTION_3_Y, SM_OPTION_4_Y};
- int costs[]={ SM_COST_1, SM_COST_2, SM_COST_3, SM_COST_4};
- int refills[]={CR_LIFE, CR_MAGIC, CR_ARROWS, CR_BOMBS};
- int ch1[]="Refill Life";
- int ch2[]="Refill Magic";
- int ch3[]="Refill Bombs";
- int ch4[]="Refill Arrows";
- while(!done)
- {
- Screen->Rectangle(6,0,0,256,176, 0x0F, true, OP_OPAQUE);
- Screen->DrawString(6, SM_TEXT_X, SM_OPTION_1_Y,
- ch1, FONT_Z1, 1, -1, OP_OPAQUE);
- Screen->DrawString(6, SM_TEXT_X, SM_OPTION_2_Y,
- ch2, FONT_Z1, 1, -1, OP_OPAQUE);
- Screen->DrawString(6, SM_TEXT_X, SM_OPTION_3_Y,
- ch3, FONT_Z1, 1, -1, OP_OPAQUE);
- Screen->DrawString(6, 1, -1, SM_TEXT_X, SM_OPTION_4_Y,
- ch4, FONT_Z1, OP_OPAQUE);
- Screen->DrawTile(6, SM_POINTER_X, curpos,
- SM_POINTER_TILE, 1,1, -1, -1, 0,0,0, OP_OPAQUE);
- If ( Link->PressDown )
- {
- if ( choice < 3 ) ++choice;
- else choice = 0;
- curpos = curpositions[choice];
- }
- if ( Link->PressUp )
- {
- if ( choice > 0 ) --choice;
- else choice = 3;
- curpos = curpositions[choice];
- }
- if ( Link->PressA )
- {
- if ( Game->Counter[CR_RUPEES] >= costs[choice] )
- {
- Game->DCounter[CR_RUPEES] -= costs[choice];
- Game->Counter[refills[choice]] = Game->MCounter[refills[choice]];
- done = true;
- }
- }
- if ( Link->PressA ) done = true; //cancel
- Waitframe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement