poll main_menu vars (ip, charge% time) every 1s, rather than every frame.

This commit is contained in:
ITotalJustice
2024-12-30 21:28:28 +00:00
parent 4855a01f1a
commit 588eb01379
3 changed files with 47 additions and 25 deletions

View File

@@ -21,11 +21,22 @@ struct MenuBase : Widget {
void SetTitleSubHeading(std::string sub_heading);
void SetSubHeading(std::string sub_heading);
private:
void UpdateVars();
private:
std::string m_title;
std::string m_title_sub_heading;
std::string m_sub_heading;
AppletType m_applet_type;
struct tm m_tm{};
TimeStamp m_poll_timestamp{};
u32 m_battery_percetange{};
PsmChargerType m_charger_type{};
NifmInternetConnectionType m_type{};
NifmInternetConnectionStatus m_status{};
u32 m_strength{};
u32 m_ip{};
};
} // namespace sphaira::ui::menu

View File

@@ -114,6 +114,10 @@ struct [[nodiscard]] Vec4 {
struct TimeStamp {
TimeStamp() {
Update();
}
void Update() {
start = armGetSystemTick();
}