fix etag cache not being returned upon the 2nd request, add jump page support for all menus.

- all menus feature page jumping, using L2/R2 (or DPAD_LEFT/DPAD_RIGHT in list menus)
- successive calls to fetch the etag would fail, this was seen in themezer and github menus.
- add limit the number of icons loaded per frame in homebrew menu.
- display default icon the image is not ready to be loaded / invalid.

fixes #53
This commit is contained in:
ITotalJustice
2024-12-31 03:57:08 +00:00
parent 588eb01379
commit e452615c77
13 changed files with 227 additions and 228 deletions

View File

@@ -21,6 +21,9 @@ struct MenuBase : Widget {
void SetTitleSubHeading(std::string sub_heading);
void SetSubHeading(std::string sub_heading);
static auto ScrollHelperDown(u64& index, u64& start, u64 step, s64 row, s64 page, u64 size) -> bool;
static auto ScrollHelperUp(u64& index, u64& start, s64 step, s64 row, s64 page, s64 size) -> bool;
private:
void UpdateVars();

View File

@@ -359,7 +359,7 @@ struct Controller {
m_kup = 0;
}
void UpdateButtonHeld(HidNpadButton buttons) {
void UpdateButtonHeld(u64 buttons) {
if (m_kdown & buttons) {
m_step = 50;
m_counter = 0;
@@ -367,7 +367,7 @@ struct Controller {
m_counter += m_step;
if (m_counter >= m_MAX) {
m_kdown |= buttons;
m_kdown |= m_kheld & buttons;
m_counter = 0;
m_step = std::min(m_step + 50, m_MAX_STEP);
}