diff --git a/renderd7.cpp b/renderd7.cpp index 103aede..d5db055 100644 --- a/renderd7.cpp +++ b/renderd7.cpp @@ -1136,14 +1136,31 @@ void RenderD7::RSettings::Draw(void) const RenderD7::DrawRect(0, 0, 400, 21, RenderD7::Color::Hex("#111111")); RenderD7::DrawRect(0, 21, 400, 220, RenderD7::Color::Hex("#eeeeee")); RenderD7::DrawText(0, 0, 0.7f, DSEVENWHITE, "RenderD7->Settings"); + RenderD7::DrawTextLeft(400, 0, 0.7f, RenderD7::Color::Hex("#ffffff"), RENDERD7VSTRING); RenderD7::DrawText(0, 30, 0.7f, DSEVENBLACK, "RD7SR: " + rd7srstate); RenderD7::DrawText(0, 50, 0.7f, DSEVENBLACK, "Metrik to Csv: " + csvstate); RenderD7::DrawText(0, 70, 0.7f, DSEVENBLACK, "Metrik to Csv-Loop: " + csvlstate); + RenderD7::DrawText(0, 90, 0.7f, DSEVENBLACK, "Force FPS: " + fpsstate); + RenderD7::DrawText(0, 110, 0.7f, DSEVENBLACK, "Metrik BG RGB: " + mtcolstate); + RenderD7::DrawText(0, 130, 0.7f, DSEVENBLACK, "Metrik Text RGB: " + mttxtcolstate); + RenderD7::DrawText(0, 150, 0.7f, DSEVENBLACK, "Metrik Alpha: " + mtcola); + RenderD7::DrawText(0, 170, 0.7f, DSEVENBLACK, "Metrik Text Alpha: " + mttxtcola); RenderD7::OnScreen(Bottom); + std::string verc = "Config Version: "; + verc += CFGVER; RenderD7::DrawRect(0, 0, 320, 240, RenderD7::Color::Hex("#eeeeee")); + RenderD7::DrawText(0, 0, 0.7f, RenderD7::Color::Hex("#111111"), verc); RenderD7::DrawTObjects(buttons, RenderD7::Color::Hex("#111111"), RenderD7::Color::Hex("#eeeeee")); } - +std::string Kbd(int lenght, SwkbdType tp) +{ + RenderD7::FrameEnd(); + SwkbdState state; + char temp[lenght + 1] = { 0 }; + swkbdInit(&state, SwkbdType::SWKBD_TYPE_NUMPAD, 2, lenght); + SwkbdButton ret = swkbdInputText(&state, temp, sizeof(temp)); + return (ret == SWKBD_BUTTON_CONFIRM ? temp : "60"); +} void RenderD7::RSettings::Logic(u32 hDown, u32 hHeld, u32 hUp, touchPosition touch) { rd7srstate = rd7_superreselution ? "true" : "false"; @@ -1174,6 +1191,10 @@ void RenderD7::RSettings::Logic(u32 hDown, u32 hHeld, u32 hUp, touchPosition tou { mt_csvloop = mt_csvloop ? false : true; } + if (d7_hDown & KEY_TOUCH && RenderD7::touchTObj(d7_touch, buttons[3])) + { + cfgstruct["settings"]["forceFrameRate"] = Kbd(2, SWKBD_TYPE_NUMPAD); + } if (d7_hDown & KEY_B) { cfgfile->write(cfgstruct); diff --git a/renderd7.hpp b/renderd7.hpp index b19f7fc..e595149 100644 --- a/renderd7.hpp +++ b/renderd7.hpp @@ -164,16 +164,23 @@ namespace RenderD7 std::string rd7srstate = "false"; std::string csvstate = "false"; std::string csvlstate = "false"; + std::string fpsstate = "60"; + std::string mtcolstate = "#000000"; + std::string mttxtcolstate = "#ffffff"; + std::string mtcola = "255"; + std::string mttxtcola = "255"; + + std::vector buttons = { {20, 35, 120, 35, "RD7SR", -11, 10}, - {20, 85, 120, 35, "MT_CSV", 0, 9}, - {20, 135, 120, 35, "MT_CSV-L", -8, 10}, - {20, 185, 120, 35, "FPS", 8, 10}, - {180, 35, 120, 35, "MTCOL", -15, 10}, - {180, 85, 120, 35, "MTTEXT", -15, 10}, - {180, 135, 120, 35, "MTA", -15, 10}, - {180, 185, 120, 35, "MTTXTA", -15, 10} + {20, 85, 120, 35, "MT_CSV", -15, 9}, + {20, 135, 120, 35, "MT_CSV-L", -19, 10}, + {20, 185, 120, 35, "FPS", 6, 10}, + {180, 35, 120, 35, "MTCOL", -10, 10}, + {180, 85, 120, 35, "MTTEXT", -13, 10}, + {180, 135, 120, 35, "MTA", 2, 10}, + {180, 185, 120, 35, "MTTXTA", -13, 10} }; public: RSettings();