I think the last missing work for v1.0.0? :)

This commit is contained in:
VoltZ
2019-11-03 03:09:43 +01:00
committed by GitHub
parent 1246809b53
commit 7b16ed5c77
9 changed files with 119 additions and 20 deletions
+24
View File
@@ -173,4 +173,28 @@ void Gui::DrawBottom(void) {
Gui::Draw_Rect(0, 0, 320, 30, Config::Color1);
Gui::Draw_Rect(0, 30, 320, 180, Config::Color3);
Gui::Draw_Rect(0, 210, 320, 30, Config::Color1);
}
// Display a Message, which needs to be confirmed with A/B.
bool Gui::promptMsg(std::string promptMsg)
{
Gui::clearTextBufs();
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
C2D_TargetClear(top, BLACK);
C2D_TargetClear(bottom, BLACK);
Gui::DrawTop();
Gui::DrawString((400-Gui::GetStringWidth(0.6f, promptMsg.c_str()))/2, 100, 0.6f, Config::TxtColor, promptMsg.c_str(), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.72f, Lang::get("CONFIRM_OR_CANCEL")))/2, 214, 0.72f, Config::TxtColor, Lang::get("CONFIRM_OR_CANCEL"), 400);
Gui::DrawBottom();
C3D_FrameEnd(0);
while(1)
{
gspWaitForVBlank();
hidScanInput();
if(hidKeysDown() & KEY_A) {
return true;
} else if(hidKeysDown() & KEY_B) {
return false;
}
}
}