Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //FinalSubscreens.zh
- //The Subscreen the player will see in this quest
- //Active Subscreen: Item Selection Menu
- //Passive Subscreen: Display's Health, Magic, Current Buttom Items, Counters
- //Active Menu Pages
- //1. Item Screen
- //2. Status/Equipment Screen
- //3. Quest Collection Screen
- //4. Overworld/Dungeon Map Screen
- //5. Log Book
- // -History/Lore
- // -Journel Entries
- // -Research
- // -Monsters
- // -Items
- dmapdata script FinalActiveSubscreen
- {
- void run()
- {
- //Transition Variables (In and out of the menu)
- bool ActiveMenu_Transition = true; //The trigger that transitions the game into the menu
- bool ActiveMenu_DeTransition = false; //The trigger that transitions the game out the menu
- int ActiveMenu_Transition_Phase = 0; //The stage in the transition the menu is in
- int ActiveMenu_DeTransition_Phase = 0; //The stage in the detransition the menu is in
- //Menu Variables
- int ActiveMenu_Page = 1; //The Page the ActiveSubScreen is On
- int ActiveMenu_Layer = 0; //The Layer the ActiveSubScreen is On
- int ActiveMenu_X1 = 0; //X1 Position of the ActiveSubScreen
- int ActiveMenu_Y1 = 176; //Y1 Position of the ActiveSubScreen
- int ActiveMenu_X2 = 256; //X2 Position of the ActiveSubScreen
- int ActiveMenu_Y2 = 176; //Y2 Position of the ActiveSubScreen
- //Cursor Variables
- int Cursor_position = 0; //The position the cursor is at
- int Item_index = 0; //The item the cursor is on
- do
- {
- //Transite into the menu
- if (ActiveMenu_Transition)
- {
- switch(ActiveMenu_Transition_Phase)
- {
- case 0:
- Audio->PlaySound(SFX_MENU_OPEN);
- ActiveMenu_Transition_Phase = 1;
- break;
- case 1:
- if (ActiveMenu_Y1 > 0)
- {
- ActiveMenu_Y1 -= 4;
- }
- else
- {
- ActiveMenu_Transition_Phase = 2;
- }
- break;
- case 2:
- ActiveMenu_Transition = false;
- break;
- }
- }
- //Transite out of the menu
- if (Input->Press[CB_START] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
- {
- ActiveMenu_DeTransition = true;
- }
- else if (ActiveMenu_DeTransition)
- {
- switch(ActiveMenu_DeTransition_Phase)
- {
- case 0:
- Audio->PlaySound(SFX_MENU_CLOSE);
- ActiveMenu_DeTransition_Phase = 1;
- break;
- case 1:
- if (ActiveMenu_Y1 < 176)
- {
- ActiveMenu_Y1 += 4;
- }
- else
- {
- ActiveMenu_DeTransition_Phase = 2;
- }
- break;
- case 2:
- ActiveMenu_DeTransition = false;
- break;
- }
- }
- //Draw Background
- Screen->Rectangle(ActiveMenu_Layer, ActiveMenu_X1, ActiveMenu_Y1, ActiveMenu_X2, ActiveMenu_Y2, Color_Black, 1, 0, 0, 0, true, OP_OPAQUE); //Background
- if (ActiveMenu_Page == 1) //Item Screen
- {
- //Drawing Text, Cursor, and Menu's
- Screen->DrawString(1, 128, ActiveMenu_Y1 + 10, FONT_LA, Color_White, Color_Black, TF_CENTERED, "Item Screen", OP_OPAQUE); //Item Screen Text
- Screen->DrawTile(1, 10, ActiveMenu_Y1 + 20, 20053, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Left Cornor
- Screen->DrawTile(1, 230, ActiveMenu_Y1 + 20, 20055, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Right Cornor
- Screen->DrawTile(1, 10, ActiveMenu_Y1 + 84, 20093, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Left Cornor
- Screen->DrawTile(1, 230, ActiveMenu_Y1 + 84, 20095, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Right Cornor
- Screen->DrawTile(1, 26, ActiveMenu_Y1 + 20, 20054, 1, 1, 7, 204, 16, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Edge
- Screen->DrawTile(1, 26, ActiveMenu_Y1 + 84, 20094, 1, 1, 7, 204, 16, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Edge
- Screen->DrawTile(1, 10, ActiveMenu_Y1 + 36, 20073, 1, 1, 7, 16, 48, 0, 0, 0, 0, true, OP_OPAQUE); //Left-Edge
- Screen->DrawTile(1, 230, ActiveMenu_Y1 + 36, 20075, 1, 1, 7, 16, 48, 0, 0, 0, 0, true, OP_OPAQUE); //Right-Edge
- Screen->DrawTile(1, 108, ActiveMenu_Y1 + 104, 20053, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Left Cornor (Selected Item)
- Screen->DrawTile(1, 132, ActiveMenu_Y1 + 104, 20055, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Right Cornor (Selected Item)
- Screen->DrawTile(1, 108, ActiveMenu_Y1 + 128, 20093, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Left Cornor (Selected Item)
- Screen->DrawTile(1, 132, ActiveMenu_Y1 + 128, 20095, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Right Cornor (Selected Item)
- Screen->DrawTile(1, 120, ActiveMenu_Y1 + 104, 20054, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Edge Cornor (Selected Item)
- Screen->DrawTile(1, 120, ActiveMenu_Y1 + 136, 20054, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Edge Cornor (Selected Item)
- Screen->DrawTile(1, 108, ActiveMenu_Y1 + 116, 20073, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Left-Edge Cornor (Selected Item)
- Screen->DrawTile(1, 132, ActiveMenu_Y1 + 116, 20075, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Right-Edge Cornor (Selected Item)
- Screen->DrawTile(1, 20 + ((Cursor_position-(Floor(Cursor_position/11)*11))*20), (ActiveMenu_Y1 + 30)+(Floor(Cursor_position/11)*22), 5, 1, 1, 2, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Cursor
- //Drawing Items
- //Sword
- if (Hero->Item[I_SWORD4])
- {
- itemdata Sword = Game->LoadItemData(I_SWORD4);
- Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_SWORD3])
- {
- itemdata Sword = Game->LoadItemData(I_SWORD3);
- Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_SWORD2])
- {
- itemdata Sword = Game->LoadItemData(I_SWORD2);
- Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_SWORD1])
- {
- itemdata Sword = Game->LoadItemData(I_SWORD1);
- Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Bombs
- if (Hero->Item[I_BOMB])
- {
- itemdata Bomb = Game->LoadItemData(I_BOMB);
- Screen->DrawTile(1, 40, ActiveMenu_Y1 + 30, Bomb->Tile, 1, 1, Bomb->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Super Bombs
- if (Hero->Item[I_SBOMB])
- {
- itemdata SuperBomb = Game->LoadItemData(I_SBOMB);
- Screen->DrawTile(1, 60, ActiveMenu_Y1 + 30, SuperBomb->Tile, 1, 1, SuperBomb->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Hammer
- if (Hero->Item[I_HAMMER])
- {
- itemdata Hammer = Game->LoadItemData(I_HAMMER);
- Screen->DrawTile(1, 80, ActiveMenu_Y1 + 30, Hammer->Tile, 1, 1, Hammer->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Hookshot
- if (Hero->Item[I_HOOKSHOT2])
- {
- itemdata Hookshot = Game->LoadItemData(I_HOOKSHOT2);
- Screen->DrawTile(1, 100, ActiveMenu_Y1 + 30, Hookshot->Tile, 1, 1, Hookshot->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_HOOKSHOT1])
- {
- itemdata Hookshot = Game->LoadItemData(I_HOOKSHOT1);
- Screen->DrawTile(1, 100, ActiveMenu_Y1 + 30, Hookshot->Tile, 1, 1, Hookshot->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Bow & Arrow
- if (Hero->Item[I_BOW2])
- {
- itemdata Bow = Game->LoadItemData(I_BOW2);
- Screen->DrawTile(1, 24, ActiveMenu_Y1 + 52, Bow->Tile, 1, 1, Bow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_BOW1])
- {
- itemdata Bow = Game->LoadItemData(I_BOW1);
- Screen->DrawTile(1, 24, ActiveMenu_Y1 + 52, Bow->Tile, 1, 1, Bow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- if (Hero->Item[I_ARROW3])
- {
- itemdata Arrow = Game->LoadItemData(I_ARROW3);
- Screen->DrawTile(1, 16, ActiveMenu_Y1 + 52, Arrow->Tile, 1, 1, Arrow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_ARROW2])
- {
- itemdata Arrow = Game->LoadItemData(I_ARROW2);
- Screen->DrawTile(1, 16, ActiveMenu_Y1 + 52, Arrow->Tile, 1, 1, Arrow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_ARROW1])
- {
- itemdata Arrow = Game->LoadItemData(I_ARROW1);
- Screen->DrawTile(1, 16, ActiveMenu_Y1 + 52, Arrow->Tile, 1, 1, Arrow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Bait
- if (Hero->Item[I_BAIT])
- {
- itemdata Bait = Game->LoadItemData(I_BAIT);
- Screen->DrawTile(1, 40, ActiveMenu_Y1 + 52, Bait->Tile, 1, 1, Bait->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Boomerang
- if (Hero->Item[I_BRANG3])
- {
- itemdata Boomerang = Game->LoadItemData(I_BRANG3);
- Screen->DrawTile(1, 60, ActiveMenu_Y1 + 52, Boomerang->Tile, 1, 1, Boomerang->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_BRANG2])
- {
- itemdata Boomerang = Game->LoadItemData(I_BRANG2);
- Screen->DrawTile(1, 60, ActiveMenu_Y1 + 52, Boomerang->Tile, 1, 1, Boomerang->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_BRANG1])
- {
- itemdata Boomerang = Game->LoadItemData(I_BRANG1);
- Screen->DrawTile(1, 60, ActiveMenu_Y1 + 52, Boomerang->Tile, 1, 1, Boomerang->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Candle
- if (Hero->Item[I_CANDLE2])
- {
- itemdata Candle = Game->LoadItemData(I_CANDLE2);
- Screen->DrawTile(1, 80, ActiveMenu_Y1 + 52, Candle->Tile, 1, 1, Candle->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- else if (Hero->Item[I_CANDLE1])
- {
- itemdata Candle = Game->LoadItemData(I_CANDLE1);
- Screen->DrawTile(1, 80, ActiveMenu_Y1 + 52, Candle->Tile, 1, 1, Candle->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Wand
- if (Hero->Item[I_WAND])
- {
- itemdata Wand = Game->LoadItemData(I_WAND);
- Screen->DrawTile(1, 100, ActiveMenu_Y1 + 52, Wand->Tile, 1, 1, Wand->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- }
- //Cursor Movement and selection
- if (Input->Press[CB_RIGHT] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
- {
- Cursor_position++;
- Audio->PlaySound(SFX_CURSOR);
- }
- else if (Input->Press[CB_LEFT] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
- {
- Cursor_position--;
- Audio->PlaySound(SFX_CURSOR);
- }
- else if (Input->Press[CB_UP] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
- {
- Cursor_position -= 11;
- Audio->PlaySound(SFX_CURSOR);
- }
- else if (Input->Press[CB_DOWN] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
- {
- Cursor_position += 11;
- Audio->PlaySound(SFX_CURSOR);
- }
- if(Cursor_position >= 33)
- {
- Cursor_position -= 33;
- Audio->PlaySound(SFX_CURSOR);
- }
- else if(Cursor_position < 0)
- {
- Cursor_position += 33;
- Audio->PlaySound(SFX_CURSOR);
- }
- //Selected Item
- Item_index = Item_Locations[Cursor_position];
- itemdata id = Game->LoadItemData(Item_index);
- int str[512];
- id->GetName(str);
- if (Item_index == 0)
- {
- Screen->DrawString(1, 128, ActiveMenu_Y1 + 148, FONT_LA, Color_White, Color_Black, TF_CENTERED, "", OP_OPAQUE); //(Selected Item) Item Name
- }
- else
- {
- Screen->DrawTile(1, 120, ActiveMenu_Y1 + 116, id->Tile, 1, 1, id->CSet, -1, -1, 0, 0, 0, 0, true, 128);
- Screen->DrawString(1, 128, ActiveMenu_Y1 + 148, FONT_LA, Color_White, Color_Black, TF_CENTERED, str, OP_OPAQUE); //(Selected Item) Item Name
- }
- if (Input->Press[CB_A] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
- {
- Hero->SetItemSlot(Item_index, 1, 1);
- }
- else if (Input->Press[CB_B] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
- {
- Hero->SetItemSlot(Item_index, 2, 1);
- }
- }
- else if (ActiveMenu_Page == 2)
- {
- //Drawing Text, Cursor, and Menu's
- Screen->DrawString(1, 128, ActiveMenu_Y1 + 10, FONT_LA, Color_White, Color_Black, TF_CENTERED, "Equipment Screen", OP_OPAQUE); //Item Screen Text
- }
- Waitframe();
- }
- until(ActiveMenu_DeTransition_Phase == 2 and ActiveMenu_DeTransition); //Stop running the menu
- }
- }
- dmapdata script FinalPassiveSubscreen
- {
- void run()
- {
- while(true)
- {
- // Passive subscreen draws
- Waitframe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment