From 07a64ffd954b4273bd6afc7fa03b284c3dced640 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 5 Nov 2024 00:17:03 +0100 Subject: Add replay ram usage estimation --- include/gui/Entry.hpp | 2 ++ include/gui/Label.hpp | 2 ++ include/gui/SettingsPage.hpp | 4 ++++ src/gui/Entry.cpp | 2 ++ src/gui/Label.cpp | 4 ++++ src/gui/SettingsPage.cpp | 40 +++++++++++++++++++++++++++++++++++----- 6 files changed, 49 insertions(+), 5 deletions(-) diff --git a/include/gui/Entry.hpp b/include/gui/Entry.hpp index b8ff37a..449a87c 100644 --- a/include/gui/Entry.hpp +++ b/include/gui/Entry.hpp @@ -26,6 +26,8 @@ namespace gsr { // Return false to specify that the string should not be accepted. This reverts the string back to its previous value. // The input can be changed by changing the input parameter and returning true. EntryValidateHandler validate_handler; + + std::function on_changed; private: mgl::Text text; float max_width; diff --git a/include/gui/Label.hpp b/include/gui/Label.hpp index 3cb91de..a702497 100644 --- a/include/gui/Label.hpp +++ b/include/gui/Label.hpp @@ -17,6 +17,8 @@ namespace gsr { void draw(mgl::Window &window, mgl::vec2f offset) override; mgl::vec2f get_size() override; + + void set_text(std::string str); private: mgl::Text text; }; diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp index a0bc518..467463f 100644 --- a/include/gui/SettingsPage.hpp +++ b/include/gui/SettingsPage.hpp @@ -14,6 +14,7 @@ namespace gsr { class GsrPage; class PageStack; class ScrollablePage; + class Label; class SettingsPage : public StaticPage { public: @@ -83,6 +84,8 @@ namespace gsr { std::unique_ptr create_replay_time(); std::unique_ptr create_start_replay_on_startup(); std::unique_ptr create_save_replay_in_game_folder(); + std::unique_ptr