Пример #1
0
// --------------------------------------------------
Result SavexitViewer::drawBotScreen()
// --------------------------------------------------
{
	if (hasRegularChild()) { if (child->drawBotScreen() == PARENT_STEP); else return CHILD_STEP; }
	// Viewer::drawBotScreen(); // Not useful here!

	// Draw bottom screen here!
	// TODO: Content is missing!

	if (hasOverlayChild()) { child->drawBotScreen(); }
	return SUCCESS_STEP;
}
Пример #2
0
// --------------------------------------------------
Result SavexitViewer::drawTopScreen()
// --------------------------------------------------
{
	if (hasRegularChild()) { if (child->drawTopScreen() == PARENT_STEP); else return CHILD_STEP; }
	// Viewer::drawTopScreen(); // Not useful here!

	sf2d_draw_rectangle(79, 66, 240, 135, RGBA8(0x48, 0xA2, 0x3E, 0xE8));

	uint32_t x, y;

	x = 88;
	y = 67;
	sftd_draw_text_pkm(x, (y+=15), "You are about to exit PHBank");
	sftd_draw_text_pkm(x, (y+=15), "  A - Save and exit");
	sftd_draw_text_pkm(x, (y+=15), "  X - Exit without saving");
	sftd_draw_text_pkm(x, (y+=15), "  Y - Backup the save");
	sftd_draw_text_pkm(x, (y+=15), "  B - Return to PHBank");

	if (hasOverlayChild()) { child->drawTopScreen(); }
	return SUCCESS_STEP;
}
Пример #3
0
// --------------------------------------------------
Result SavexitViewer::updateControls(const u32& kDown, const u32& kHeld, const u32& kUp, const touchPosition* touch)
// --------------------------------------------------
{
	if (hasRegularChild() || hasOverlayChild()) { if (child->updateControls(kDown, kHeld, kUp, touch) == PARENT_STEP); else return CHILD_STEP; }
	// Viewer::updateControls(kDown, kHeld, kUp);
	
	if (kDown & KEY_A)
	{
		parent->setLStateView(StateView::Saving);
		// consoleClear();
		return close();
	}

	if (kDown & (KEY_B | KEY_START))
	{
		parent->setLStateView(StateView::Continuing);
		// consoleClear();
		return close();
	}

	if (kDown & KEY_X)
	{
		parent->setLStateView(StateView::Exiting);
		// consoleClear();
		return close();
	}

	if (kDown & KEY_Y)
	{
		consoleClear();
		PHBank::pKBank()->backupFile();
		
		parent->setLStateView(StateView::Continuing);
		// consoleClear();
		return close();
	}

	return SUCCESS_STEP;
}
Пример #4
0
// --------------------------------------------------
Result BoxViewer::updateControls(const u32& kDown, const u32& kHeld, const u32& kUp, const touchPosition* touch)
// --------------------------------------------------
{
	if (hasRegularChild() || hasOverlayChild()) { if (this->child->updateControls(kDown, kHeld, kUp, touch) == PARENT_STEP); else return CHILD_STEP; }

	// TODO: Detect if mediatype and the cartridge has been removed!
	// Result FSUSER_CardSlotIsInserted(bool* inserted)

	if (kDown & KEY_START)
	{
		// Open the Savexit popup
		new SavexitViewer(ViewType::Overlay, this);
		child->initialize();
		return CHILD_STEP;
	}

	bool bboxMod = false;

	{
		bool boolMod = false;
		s16 boxMod = 0;
		s16 rowMod = 0;
		s16 colMod = 0;

		if (kDown & KEY_L) boxMod--;
		else if (kDown & KEY_R) boxMod++;

		if (kDown & KEY_UP) rowMod--;
		else if (kDown & KEY_DOWN) rowMod++;

		if (kDown & KEY_LEFT) { if (cursorBox.row == BOX_HEADER_SELECTED) boxMod--; else colMod--; }
		else if (kDown & KEY_RIGHT) { if (cursorBox.row == BOX_HEADER_SELECTED) boxMod++; else colMod++; }

		if (kDown & KEY_ZL) { cursorBox.inBank = false; boolMod = true; }
		else if (kDown & KEY_ZR) { cursorBox.inBank = true; boolMod = true; }

		if (kDown & KEY_TOUCH)
		{
			s16 boxShift = cursorBox.inBank ? BK_BOX_SHIFT_USED : PC_BOX_SHIFT_USED;

			// If the box arrows are touched down
			if (touchWithin(touch->px, touch->py, boxShift + 4, 18, 16, 24)) boxMod--;
			else if (touchWithin(touch->px, touch->py, boxShift + 200, 18, 16, 24)) boxMod++;

			boxShift = cursorBox.inBank ? PC_BOX_SHIFT_UNUSED : BK_BOX_SHIFT_UNUSED;

			// If the other box (PC|BK) is touched down
			if (touchWithin(touch->px, touch->py, boxShift, 0, BACKGROUND_WIDTH, BACKGROUND_HEIGHT)) { cursorBox.inBank = !cursorBox.inBank; boolMod = bboxMod = true; }
		}
		else if (kHeld & KEY_TOUCH)
		{
			if (sPkm || isPkmChecking)
			{
				s16 boxShift = cursorBox.inBank ? BK_BOX_SHIFT_USED : PC_BOX_SHIFT_USED;

				// If the box arrows are touched held once
				if (touchWithin(touch->px, touch->py, boxShift + 4, 18, 16, 24) && !touchWithin(this->touch.px, this->touch.py, boxShift + 4, 18, 16, 24)) boxMod--;
				else if (touchWithin(touch->px, touch->py, boxShift + 200, 18, 16, 24) && !touchWithin(this->touch.px, this->touch.py, boxShift + 200, 18, 16, 24)) boxMod++;

				boxShift = cursorBox.inBank ? PC_BOX_SHIFT_UNUSED : BK_BOX_SHIFT_UNUSED;

				// If the other box (PC|BK) is touched held
				if (touchWithin(touch->px, touch->py, boxShift, 0, BACKGROUND_WIDTH, BACKGROUND_HEIGHT)) { cursorBox.inBank = !cursorBox.inBank; boolMod = bboxMod = true; }
			}
		}

		if (boxMod || rowMod || colMod)
		{
			currentBox(&cursorBox);
			*cursorBox.box += boxMod;
			cursorBox.row += rowMod;
			cursorBox.col += colMod;

			if (save->bankdata.bk.wboxUnlocked)
			{
				if (*cursorBox.box < 0) *cursorBox.box = (cursorBox.inBank ? save->bankdata.bk.boxUnlocked+1 : save->savedata.pc.boxUnlocked)-1;
				else if (*cursorBox.box > (cursorBox.inBank ? save->bankdata.bk.boxUnlocked+1 : save->savedata.pc.boxUnlocked)-1) *cursorBox.box = 0;
			}
			else
			{
				if (*cursorBox.box < 0) *cursorBox.box = (cursorBox.inBank ? save->bankdata.bk.boxUnlocked : save->savedata.pc.boxUnlocked)-1;
				else if (*cursorBox.box > (cursorBox.inBank ? save->bankdata.bk.boxUnlocked : save->savedata.pc.boxUnlocked)-1) *cursorBox.box = 0;
			}
			
			if (cursorBox.row < BOX_HEADER_SELECTED) cursorBox.row = BOX_ROW_PKM_COUNT-1;
			else if (cursorBox.row > BOX_ROW_PKM_COUNT-1) cursorBox.row = BOX_HEADER_SELECTED;

			if (cursorBox.col < 0) { cursorBox.col = BOX_COL_PKM_COUNT-1; cursorBox.inBank = !cursorBox.inBank; }
			else if (cursorBox.col > BOX_COL_PKM_COUNT-1) { cursorBox.col = 0; cursorBox.inBank = !cursorBox.inBank; }

			boolMod = true;
		}

		if (boolMod)
		{
			// Update the current Box/Pokémon displayed
			currentBox(&cursorBox);
			selectViewBox();
			selectViewPokemon();
		}
	}

	if (kDown & KEY_SELECT)
	{
		switchCursorType();
	}

	if (cursorType == CursorType::SingleSelect)
	{
		if (kDown & KEY_A && !isPkmDragged)
		{
			// Move a Pokémon (grab and drop)
			selectMovePokemon();
		}

		if (kDown & KEY_B && !isPkmDragged)
		{
			// Drop a Pokémon
			cancelMovePokemon();
		}
	}
	else if (cursorType == CursorType::QuickSelect)
	{
		if (kDown & KEY_A && !isPkmDragged)
		{
			// Move a Pokémon (grab and drop)
			selectMovePokemon();
		}

		if (kDown & KEY_B && !isPkmDragged)
		{
			// Drop a Pokémon
			cancelMovePokemon();
		}

		if (kDown & KEY_Y && !sPkm)
		{
			// Swap the two boxes (PC|BK)
			save->moveBox(cursorBox.boxPC, false, cursorBox.boxBK, true);
		}
	}
	else if (cursorType == CursorType::MultiSelect)
	{
		if (kDown & KEY_A)
		{
			// Toggle a Pokémon (check & move)
			selectMultiMovePokemon(true);

			if (vPkm.pkm)
			{
				checkToggle = vPkm.pkm->checked;
				isPkmChecking = true;
			}
		}
		else if (kHeld & KEY_A)
		{
			if (vPkm.pkm && vPkm.pkm->checked != checkToggle)
			{
				// Toggle a Pokémon (check & move)
				selectMultiMovePokemon(true);
			}
		}

		if (kDown & KEY_B)
		{
			// Cancel the checked
			cancelMovePokemon();
		}

		if (kDown & KEY_X)
		{
			// Move the checked Pokémon to the current box
			selectMultiMovePokemon(false);
		}

		if (kDown & KEY_Y)
		{
			// Open the UltraBox viewer
			UltraBoxViewer* ultraBoxViewer = new UltraBoxViewer(ViewType::Regular, this);
			ultraBoxViewer->selectViewBox(*cursorBox.box, cursorBox.inBank);
			child->initialize();
			return CHILD_STEP;
		}
	}

	{
		if (bboxMod); // Cancel selection if the (PC|BK) changed
		else if (kDown & KEY_TOUCH)
		{
			s16 boxShift = cursorBox.inBank ? BK_BOX_SHIFT_USED : PC_BOX_SHIFT_USED;
			s16 middleBoxShift = (cursorBox.inBank ? PC_BOX_SHIFT_UNUSED : PC_BOX_SHIFT_USED) + BACKGROUND_WIDTH;
			u16 px = touch->px;
			u16 py = touch->py;
			this->touch = *touch;

			if (!sPkm && sPkmCount == 0)
			{
				// If the TouchArea is within the SingleSelect CursorType button area
				if (touchWithin(px, py, boxShift + 22, 0, 59, 16))
				{
					selectCursorType(CursorType::SingleSelect);
				}
				// If the TouchArea is within the QuickSelect CursorType button area
				else if (touchWithin(px, py, boxShift + 86, 0, 59, 16))
				{
					selectCursorType(CursorType::QuickSelect);
				}
				// If the TouchArea is within the MultiSelect CursorType button area
				else if (touchWithin(px, py, boxShift + 150, 0, 59, 16))
				{
					selectCursorType(CursorType::MultiSelect);
				}
				// If the TouchArea is within the SwapBox button area
				else if (touchWithin(px, py, middleBoxShift + 10, 215, 20, 20))
				{
					// Swap the two boxes (PC|BK)
					save->moveBox(cursorBox.boxPC, false, cursorBox.boxBK, true);
				}
			}
			else
			{
				if (cursorType == CursorType::MultiSelect)
				{
					// If the TouchArea is within the MultiSelect CursorType button area
					if (touchWithin(px, py, boxShift + 150, 0, 59, 16))
					{
						cancelMovePokemon();
					}
					// If the TouchArea is within the MiddleArea
					else if (touchWithin(px, py, middleBoxShift, 0, BACKGROUND_SHIFT, BACKGROUND_HEIGHT))
					{
						// Trigger the end of the selection
						selectMultiMovePokemon(false);
					}
				}
			}

			// If the TouchArea is within the Pokémon icons area of the box
			if (touchWithin(px, py, boxShift, PKM_BOX_MARGIN_TOP, BACKGROUND_WIDTH - PKM_BOX_MARGIN_RIGHT, BACKGROUND_HEIGHT - PKM_BOX_MARGIN_TOP))
			{
				// If no Pokémon is currently selected or dragged
				if (!sPkm && !isPkmDragged)
				{
					// Move the cursor to the new slot
					cursorBox.row = (py - PKM_BOX_MARGIN_TOP) / PKM_HEIGHT;
					cursorBox.col = (px - boxShift) / PKM_WIDTH;

					// Update the current Pokémon
					selectViewPokemon();

					if (cursorType == CursorType::MultiSelect)
					{
						// Select the current Pokémon (check)
						selectMultiMovePokemon(true);

						if (vPkm.pkm)
						{
							checkToggle = vPkm.pkm->checked;
							isPkmChecking = true;
						}
					}
					else
					{
						// Move the current Pokémon (grab)
						selectMovePokemon();

						if (!vPkm.emptySlot)
						{
							isPkmDragged = true;
						}
					}
				}
				// If a Pokémon is currently selected and dragged
				else
				{
					u16 oldRow = cursorBox.row;
					u16 oldCol = cursorBox.col;

					// Move the cursor to the new slot
					cursorBox.row = (py - PKM_BOX_MARGIN_TOP) / PKM_HEIGHT;
					cursorBox.col = (px - boxShift) / PKM_WIDTH;

					// Update the current Pokémon
					selectViewPokemon();

					// And drop the Pokémon if one is held and it is the same current slot (mean double tap to move a held Pokémon)
					if (isPkmHeld && oldRow == cursorBox.row && oldCol == cursorBox.col)
					{
						selectMovePokemon();
					}
				}
			}
		}
		else if (kHeld & KEY_TOUCH)
		{
			if (cursorType == CursorType::MultiSelect)
			{
				s16 boxShift = cursorBox.inBank ? BK_BOX_SHIFT_USED : PC_BOX_SHIFT_USED;
				u16 px = touch->px;
				u16 py = touch->py;

				// If the TouchArea is within the Pokémon icons area of the box
				if (touchWithin(px, py, boxShift, PKM_BOX_MARGIN_TOP, BACKGROUND_WIDTH - PKM_BOX_MARGIN_RIGHT, BACKGROUND_HEIGHT - PKM_BOX_MARGIN_TOP))
				{
					s16 row = (py - PKM_BOX_MARGIN_TOP) / PKM_HEIGHT;
					s16 col = (px - boxShift) / PKM_WIDTH;

					// If the touch position is not the same slot as before.
					if (cursorBox.row != row || cursorBox.col != col)
					{
						// Move the cursor to the new slot
						cursorBox.row = row;
						cursorBox.col = col;

						// Update the current Pokémon
						selectViewPokemon();

						// If it has to be toggled.
						if (vPkm.pkm->checked != checkToggle)
						{
							// Select the current Pokémon (check)
							selectMultiMovePokemon(true);
						}
					}
				}
			}

			// Keep the last touched position
			this->touch = *touch;	
		}
		else if (kUp & KEY_TOUCH)
		{
			touch = &(this->touch);

			s16 boxShift = cursorBox.inBank ? BK_BOX_SHIFT_USED : PC_BOX_SHIFT_USED;
			u16 px = touch->px;
			u16 py = touch->py;

			// If a Pokémon is currently dragged
			if (sPkm && isPkmDragged)
			{
				// If the TouchArea is within the Pokémon icons area of the box
				if (touchWithin(px, py, boxShift, PKM_BOX_MARGIN_TOP, BACKGROUND_WIDTH - PKM_BOX_MARGIN_RIGHT, BACKGROUND_HEIGHT - PKM_BOX_MARGIN_TOP))
				{
					// Move the cursor to the new slot
					cursorBox.row = (py - PKM_BOX_MARGIN_TOP) / PKM_HEIGHT;
					cursorBox.col = (px - boxShift) / PKM_WIDTH;

					// Update the current Pokémon
					selectViewPokemon();

					// Move the dragged Pokémon (drop)
					selectMovePokemon();
				}
				else
				{
					// Cancel the Pokémon dragging
					cancelMovePokemon();

					// Return to the old dragged Pokémon slot?
					// injectBoxSlot(&sSlot, &cursorBox);
					// selectViewBox();

					// Update the current Pokémon
					selectViewPokemon();
				}

				isPkmDragged = false;
			}

			isPkmChecking = false;
		}
	}

	cursorPositionOffY += cursorPositionShiftY;
	if (cursorPositionOffY < 0 || cursorPositionOffY > cursorPositionMaxY)
		cursorPositionShiftY *= -1;

	return SUCCESS_STEP;
}
Пример #5
0
// --------------------------------------------------
Result BoxViewer::drawBotScreen()
// --------------------------------------------------
{
	if (hasRegularChild()) { if (this->child->drawBotScreen() == PARENT_STEP); else return CHILD_STEP; }

	{
		// Retrieve the current box, and the drawing offset.
		s16 boxShift = cursorBox.inBank ? BK_BOX_SHIFT_USED : PC_BOX_SHIFT_USED;
		s16 middleBoxShift = (cursorBox.inBank ? PC_BOX_SHIFT_UNUSED : PC_BOX_SHIFT_USED) + BACKGROUND_WIDTH;

		// Draw the current box: the background and the icons.
		drawBox((cursorBox.inBank ? vBKBox : vPCBox), boxShift, 0, true);

		// Draw the other box: the background and the icons.
		drawBox((cursorBox.inBank ? vPCBox : vBKBox), (cursorBox.inBank ? PC_BOX_SHIFT_UNUSED : BK_BOX_SHIFT_UNUSED), 0, false);

		// Draw bottom bar
		sf2d_draw_texture_part(PHBanku::texture->boxBackgrounds, (cursorBox.inBank ? PC_BOX_SHIFT_UNUSED : PC_BOX_SHIFT_USED), BACKGROUND_HEIGHT, 440, 968, 480, 30);
		sf2d_draw_texture_part(PHBanku::texture->boxBackgrounds, middleBoxShift, 0, 880, 758, 40, BACKGROUND_HEIGHT);

		// Draw SwapBox button
		sf2d_draw_texture_part(PHBanku::texture->boxTiles, middleBoxShift + 10, 215, 128, 32, 20, 20);

		// If a Pokémon is currently selected
		if (sPkm)
		{
			u16 pkm_x, pkm_y;

			// If the selected Pokémon is dragged
			if (isPkmDragged)
			{
				// Draw dragged Pokémon icon under the stylus
				pkm_x = touch.px - 20; // 40/2
				pkm_y = touch.py - 15; // 30/2
			}
			// If the selected Pokémon is held
			else // if (isPkmHeld)
			{
				if (cursorBox.inslot == SLOT_NO_SELECTION)
				{
					// Draw the Pokémon icon on the box title
					pkm_x = boxShift + (BACKGROUND_WIDTH - PKM_WIDTH) / 2;
					pkm_y = 10;
				}
				else
				{
					// Draw the Pokémon icon on the current slot a bit shifted
					pkm_x = boxShift + cursorBox.col * PKM_WIDTH;
					pkm_y = PKM_BOX_MARGIN_TOP - 12 + cursorBox.row * PKM_HEIGHT;
				}
			}

			drawPokemon(sPkm, pkm_x, pkm_y, true);

			if (!isPkmDragged)
			{
				sf2d_draw_texture_part(PHBanku::texture->boxTiles, pkm_x + 20, pkm_y - 11, (u8) cursorType * 32, 32, 32, 32);
			}
		}
		else
		{
			// Draw the cursor
			if (cursorBox.inslot == SLOT_NO_SELECTION)
			{
				// Draw the cursor icon on the box title
				sf2d_draw_texture_part(PHBanku::texture->boxTiles, boxShift + 105, 3 - cursorPositionOffY, (u8) cursorType * 32, 32, 32, 32);
			}
			else
			{
				// Draw the cursor icon on the current slot a bit shifted
				sf2d_draw_texture_part(PHBanku::texture->boxTiles, boxShift + 16 + (cursorBox.inslot % 6) * PKM_WIDTH + cursorPositionOffY / 2, PKM_BOX_MARGIN_TOP - 7 + (cursorBox.inslot / 6) * PKM_HEIGHT - cursorPositionOffY, (u8) cursorType * 32, 32, 32, 32);
			}
		}

		if (sPkmCount > 0)
		{
			// Draw the selected Pokémon
			for (u8 i = 0; i < 19 && i < sPkmCount; i++)
			{
				drawPokemon(sPkms[i], middleBoxShift, 10 * i, false);
			}
		}
	}

	if (hasOverlayChild()) { this->child->drawBotScreen(); }
	return SUCCESS_STEP;
}
Пример #6
0
// --------------------------------------------------
Result BoxViewer::drawTopScreen()
// --------------------------------------------------
{
	if (hasRegularChild()) { if (this->child->drawTopScreen() == PARENT_STEP); else return CHILD_STEP; }

	// Draw the resume background
	sf2d_draw_texture(PHBanku::texture->resumeBackground, 0, 0);

	sftd_draw_wtext_white(11, 40, data->text(BankText::GameTrainer));
	sftd_draw_wtextf_white(91, 40, L"%S (%lu-%lu-%lu)", save->savedata.OTName, save->savedata.TID, save->savedata.SID, save->savedata.TSV);

	// If there is a current Pokémon
	if (vPkm.pkm && !vPkm.emptySlot)
	{
		{
		uint32_t x, y;

		sf2d_draw_texture_part(PHBanku::texture->ballIcons, 5, 5, (vPkm.ball % BALL_ROW_COUNT) * BALL_SIZE, (vPkm.ball / BALL_ROW_COUNT) * BALL_SIZE, BALL_SIZE, BALL_SIZE);

		x = 32;
		y = 16 - 2;
		// Is the Pokémon an egg?
		if (vPkm.pkm->isEggy)
		{
			sftd_draw_wtext_white(x, y, data->species(0));
		}
		else
		{
			// Is the Pokémon nicknamed?
			if (Pokemon::isNicknamed(vPkm.pkm))
			{
				sftd_draw_wtext_white(x, y, vPkm.NKName);
			}
			else
			{
				sftd_draw_wtext_white(x, y, vPkm.species);
			}
		}

		sftd_draw_wtextf_white(x + 168, y, L"%S%u", data->text(BankText::Level), vPkm.level);

		x = 11;
		y = 42 - 2;
		sftd_draw_wtext_white(x, (y += 15), data->text(BankText::DexNo));
		sftd_draw_text_white(x+50, y, "%03u", vPkm.pkm->speciesID);
		sftd_draw_wtext_white(x+80, y, vPkm.species);
		sftd_draw_wtext_white(x, (y += 15), data->text(BankText::OriginalTrainer));
		sftd_draw_wtext_white(x+50, y, vPkm.OTName);
		y += 15; // sftd_draw_text_white(x, (y += 15), "Stat");
		sftd_draw_wtext_white(x+90, y, data->text(BankText::Value));
		sftd_draw_wtext_white(x+128, y, data->text(BankText::IV));
		sftd_draw_wtext_white(x+158, y, data->text(BankText::EV));
		sftd_draw_wtext_white(x, (y+=15), data->text(BankText::HitPoint));
		sftd_draw_text_white(x+98, y, "% 3u", vPkm.stats[Stat::HP]);
		sftd_draw_text_white(x+130, y, "% 2u", vPkm.ivs[Stat::HP]);
		sftd_draw_text_white(x+160, y, "% 3u", vPkm.evs[Stat::HP]);
		sftd_draw_wtext_white(x, (y+=15), data->text(BankText::Attack));
		sftd_draw_text_white(x+98, y, "% 3u", vPkm.stats[Stat::ATK]);
		sftd_draw_text_white(x+130, y, "% 2u", vPkm.ivs[Stat::ATK]);
		sftd_draw_text_white(x+160, y, "% 3u", vPkm.evs[Stat::ATK]);
		sftd_draw_wtext_white(x, (y+=15), data->text(BankText::Defense));
		sftd_draw_text_white(x+98, y, "% 3u", vPkm.stats[Stat::DEF]);
		sftd_draw_text_white(x+130, y, "% 2u", vPkm.ivs[Stat::DEF]);
		sftd_draw_text_white(x+160, y, "% 3u", vPkm.evs[Stat::DEF]);
		sftd_draw_wtext_white(x, (y+=15), data->text(BankText::SpAttack));
		sftd_draw_text_white(x+98, y, "% 3u", vPkm.stats[Stat::SPA]);
		sftd_draw_text_white(x+130, y, "% 2u", vPkm.ivs[Stat::SPA]);
		sftd_draw_text_white(x+160, y, "% 3u", vPkm.evs[Stat::SPA]);
		sftd_draw_wtext_white(x, (y+=15), data->text(BankText::SpDefense));
		sftd_draw_text_white(x+98, y, "% 3u", vPkm.stats[Stat::SPD]);
		sftd_draw_text_white(x+130, y, "% 2u", vPkm.ivs[Stat::SPD]);
		sftd_draw_text_white(x+160, y, "% 3u", vPkm.evs[Stat::SPD]);
		sftd_draw_wtext_white(x, (y+=15), data->text(BankText::Speed));
		sftd_draw_text_white(x+98, y, "% 3u", vPkm.stats[Stat::SPE]);
		sftd_draw_text_white(x+130, y, "% 2u", vPkm.ivs[Stat::SPE]);
		sftd_draw_text_white(x+160, y, "% 3u", vPkm.evs[Stat::SPE]);
		sftd_draw_wtext_white(x, (y += 15), data->text(BankText::Nature));
		sftd_draw_wtext_white(x+70, y, vPkm.nature);
		sftd_draw_wtext_white(x, (y += 15), data->text(BankText::Ability));
		sftd_draw_wtext_white(x+70, y, vPkm.ability);
		sftd_draw_wtext_white(x, (y += 15), data->text(BankText::Item));
		sftd_draw_wtext_white(x+70, y, vPkm.item);

		x = 246;
		y = 147 - 15 - 2;
		sftd_draw_wtextf_white(x, (y += 15), L"%S   %S", data->text(BankText::HiddenPower), vPkm.hpType);
		sftd_draw_wtext_white(x, (y += 15), data->text(BankText::Moves));
		sftd_draw_wtext_white(x+10, (y += 15), vPkm.moves[0]);
		sftd_draw_wtext_white(x+10, (y += 15), vPkm.moves[1]);
		sftd_draw_wtext_white(x+10, (y += 15), vPkm.moves[2]);
		sftd_draw_wtext_white(x+10, (y += 15), vPkm.moves[3]);

		drawPokemonScale(vPkm.pkm, 256, 36, 3.0f);

		if (vPkm.pkm->isShiny)
		{
			sf2d_draw_texture_part(PHBanku::texture->boxTiles, 240, 135, 54, 64, 9, 9);
		}

		if (vPkm.isCured)
		{
			sf2d_draw_texture_part(PHBanku::texture->boxTiles, 260, 135, 72, 64, 9, 9);
		}
		else if (vPkm.isInfected)
		{
			sf2d_draw_texture_part(PHBanku::texture->boxTiles, 260, 135, 81, 64, 27, 9);
		}

		if (vPkm.gen > 0)
		{
			if (vPkm.gen == 6) // Kalos Born (Gen VI)
				sf2d_draw_texture_part(PHBanku::texture->boxTiles, 250, 135, 63, 64, 9, 9);
			else if (vPkm.gen == 5) // Gen V
				sf2d_draw_texture_part(PHBanku::texture->boxTiles, 250, 135, 72, 73, 9, 9);
			else if (vPkm.gen == 4) // Gen IV
				sf2d_draw_texture_part(PHBanku::texture->boxTiles, 250, 135, 63, 73, 9, 9);
			else if (vPkm.gen == 3) // Gen III
				sf2d_draw_texture_part(PHBanku::texture->boxTiles, 250, 135, 54, 73, 9, 9);
		}

		sf2d_draw_texture_part(PHBanku::texture->boxTiles, 290 ,135, 9*0, 64 + 9*vPkm.circle, 9, 9);
		sf2d_draw_texture_part(PHBanku::texture->boxTiles, 300 ,135, 9*1, 64 + 9*vPkm.triangle, 9, 9);
		sf2d_draw_texture_part(PHBanku::texture->boxTiles, 310 ,135, 9*2, 64 + 9*vPkm.square, 9, 9);
		sf2d_draw_texture_part(PHBanku::texture->boxTiles, 320 ,135, 9*3, 64 + 9*vPkm.heart, 9, 9);
		sf2d_draw_texture_part(PHBanku::texture->boxTiles, 330 ,135, 9*4, 64 + 9*vPkm.star, 9, 9);
		sf2d_draw_texture_part(PHBanku::texture->boxTiles, 340 ,135, 9*5, 64 + 9*vPkm.diamond, 9, 9);
		}
	}

	if (hasOverlayChild()) { this->child->drawTopScreen(); }
	return SUCCESS_STEP;
}