@@ -20,7 +20,7 @@ using namespace Impacto::UI::Widgets::CC;
2020using namespace Impacto ::Profile::ScriptVars;
2121
2222void BacklogMenu::MenuButtonOnClick (Widgets::BacklogEntry* target) {
23- UI::BacklogMenu::MenuButtonOnClick (target);
23+ UI ::BacklogMenu<BacklogEntry> ::MenuButtonOnClick (target);
2424
2525 if (!target->AudioId .has_value ())
2626 Audio::PlayInGroup (Audio::ACG_SE , " sysse" , 4 , false , 0 .0f );
@@ -31,12 +31,12 @@ void BacklogMenu::Show() {
3131 CommonMenu::OnShow (FadeInDuration, FadeOutDuration, FadeAnimation);
3232 }
3333
34- UI::BacklogMenu::Show ();
34+ UI ::BacklogMenu<BacklogEntry> ::Show ();
3535}
3636
3737void BacklogMenu::Hide () {
3838 Audio::Channels[Audio::AC_REV ]->Stop (0 .0f );
39- UI::BacklogMenu::Hide ();
39+ UI ::BacklogMenu<BacklogEntry> ::Hide ();
4040}
4141
4242void BacklogMenu::UpdateVisibility () {
@@ -56,16 +56,18 @@ void BacklogMenu::UpdateVisibility() {
5656 IsFocused = false ;
5757 if (UI ::FocusedMenu) UI ::FocusedMenu->IsFocused = true ;
5858
59- MainItems->Hide ();
59+ for (auto & entry : Entries) {
60+ entry.Hide ();
61+ }
6062 }
6163}
6264
6365void BacklogMenu::Update (float dt) {
64- float prevScrollPos = *MainScrollbar-> Value ;
65- UI::BacklogMenu::Update (dt);
66- if (IsFocused && prevScrollPos != *MainScrollbar-> Value ) {
66+ float prevScrollPos = *MainScrollbar. Value ;
67+ UI ::BacklogMenu<BacklogEntry> ::Update (dt);
68+ if (IsFocused && prevScrollPos != *MainScrollbar. Value ) {
6769 if (auto * menu = dynamic_cast <UI ::CCLCC ::SystemMenu*>(UI ::SystemMenuPtr)) {
68- menu->BGPosition .y += (prevScrollPos - *MainScrollbar-> Value ) * 0 .5f ;
70+ menu->BGPosition .y += (prevScrollPos - *MainScrollbar. Value ) * 0 .5f ;
6971 }
7072 }
7173}
@@ -76,24 +78,27 @@ void BacklogMenu::Render() {
7678 const float opacity = glm::smoothstep (0 .0f , 1 .0f , FadeAnimation.Progress );
7779 const glm::vec4 transition (1 .0f , 1 .0f , 1 .0f , opacity);
7880
79- MainItems->Tint = transition;
80- MainScrollbar->Tint = transition;
81-
8281 const float backgroundY =
83- static_cast <float >(fmod (PageY - EntryYPadding - RenderingBounds.Y ,
84- BacklogBackground.Bounds .Height ));
82+ static_cast <float >(fmod (PageY, BacklogBackground.Bounds .Height ));
8583
8684 if (OpenedAsDirect) CommonMenu::DrawBgSprite<false >(State, FadeAnimation);
8785
88- for (float yPos = backgroundY; yPos <= Profile::DesignHeight;
89- yPos += BacklogBackground.Bounds .Height ) {
86+ for (float yPos = backgroundY - Profile::DesignHeight;
87+ yPos <= Profile::DesignHeight; yPos += BacklogBackground.Bounds .Height ) {
9088 Renderer->DrawSprite (BacklogBackground, {0 .0f , yPos}, transition);
9189 }
9290
9391 RenderHighlight ();
9492 Renderer->DrawSprite (BacklogHeaderSprite, BacklogHeaderPosition, transition);
95- MainItems->Render ();
96- MainScrollbar->Render ();
93+
94+ for (auto & entry : Entries) {
95+ if (!entry.Bounds .Intersects (RenderingBounds)) continue ;
96+ entry.Tint = transition;
97+ entry.Render ();
98+ }
99+
100+ MainScrollbar.Tint = transition;
101+ MainScrollbar.Render ();
97102
98103 if (ScrWork[SW_SYSSUBMENUNO ] == 1 ) {
99104 CommonMenu::DrawOverlay ();
0 commit comments