Ver Fonte

Fix recent scores time indicators not being visible

kiwec há 4 meses atrás
pai
commit
8ced983b87

+ 1 - 0
src/App/Osu/Changelog.cpp

@@ -32,6 +32,7 @@ Changelog::Changelog() : ScreenBackable() {
     latest.changes.push_back("- Disabled FPoSu noclip by default");
     latest.changes.push_back("- Fixed auto mod staying on after Ctrl+clicking a map");
     latest.changes.push_back("- Fixed downloads sometimes failing on Windows");
+    latest.changes.push_back("- Fixed recent score times not being visible in leaderboards");
     latest.changes.push_back("- Fixed restarting map while watching a replay");
     latest.changes.push_back("- Improved sound engine reliability");
     latest.changes.push_back("- Re-added win_snd_wasapi_exclusive convar");

+ 1 - 0
src/App/Osu/SongBrowser/SongBrowser.cpp

@@ -461,6 +461,7 @@ SongBrowser::SongBrowser() : ScreenBackable() {
     m_scoreBrowser->setHorizontalScrolling(false);
     m_scoreBrowser->setScrollbarSizeMultiplier(0.25f);
     m_scoreBrowser->setScrollResistance(15);
+    m_scoreBrowser->m_bHorizontalClipping = false;
     m_scoreBrowserScoresStillLoadingElement = new ScoresStillLoadingElement("Loading...");
     m_scoreBrowserNoRecordsYetElement = new NoRecordsSetElement("No records set!");
     m_scoreBrowser->getContainer()->addBaseUIElement(m_scoreBrowserNoRecordsYetElement);

+ 9 - 4
src/GUI/CBaseUIScrollView.cpp

@@ -34,7 +34,6 @@ CBaseUIScrollView::CBaseUIScrollView(float xPos, float yPos, float xSize, float
     m_bDrawFrame = true;
     m_bDrawBackground = true;
     m_bDrawScrollbars = true;
-    m_bClipping = true;
 
     m_backgroundColor = 0xff000000;
     m_frameColor = 0xffffffff;
@@ -110,8 +109,14 @@ void CBaseUIScrollView::draw(Graphics *g) {
     }
 
     // draw elements & scrollbars
-    if(m_bClipping) {
-        g->pushClipRect(McRect(m_vPos.x + 1, m_vPos.y + 2, m_vSize.x - 1, m_vSize.y - 1));
+    if(m_bHorizontalClipping || m_bVerticalClipping) {
+        auto clip_rect = McRect(
+            m_bHorizontalClipping ? m_vPos.x + 1 : 0,
+            m_bVerticalClipping ? m_vPos.y + 2 : 0,
+            m_bHorizontalClipping ? m_vSize.x - 1 : engine->getScreenWidth(),
+            m_bVerticalClipping ? m_vSize.y - 1 : engine->getScreenHeight()
+        );
+        g->pushClipRect(clip_rect);
     }
     {
         m_container->draw(g);
@@ -147,7 +152,7 @@ void CBaseUIScrollView::draw(Graphics *g) {
             }
         }
     }
-    if(m_bClipping) {
+    if(m_bHorizontalClipping || m_bVerticalClipping) {
         g->popClipRect();
     }
 }

+ 4 - 19
src/GUI/CBaseUIScrollView.h

@@ -1,15 +1,4 @@
-//================ Copyright (c) 2013, PG, All rights reserved. =================//
-//
-// Purpose:		smooth kinetic scrolling container
-//
-// $NoKeywords: $
-//===============================================================================//
-
-// TODO: refactor the spaghetti parts, this can be done way more elegantly
-
-#ifndef CBASEUISCROLLVIEW_H
-#define CBASEUISCROLLVIEW_H
-
+#pragma once
 #include "CBaseUIElement.h"
 
 class CBaseUIContainer;
@@ -55,10 +44,6 @@ class CBaseUIScrollView : public CBaseUIElement {
         m_bDrawScrollbars = drawScrollbars;
         return this;
     }
-    CBaseUIScrollView *setClipping(bool clipping) {
-        m_bClipping = clipping;
-        return this;
-    }
 
     CBaseUIScrollView *setBackgroundColor(Color backgroundColor) {
         m_backgroundColor = backgroundColor;
@@ -133,6 +118,9 @@ class CBaseUIScrollView : public CBaseUIElement {
     // Useful in places where you're waiting on new content, like chat logs.
     bool sticky = false;
 
+    bool m_bHorizontalClipping = true;
+    bool m_bVerticalClipping = true;
+
    protected:
     virtual void onMoved();
 
@@ -150,7 +138,6 @@ class CBaseUIScrollView : public CBaseUIElement {
     bool m_bDrawFrame;
     bool m_bDrawBackground;
     bool m_bDrawScrollbars;
-    bool m_bClipping;
 
     Color m_backgroundColor;
     Color m_frameColor;
@@ -188,5 +175,3 @@ class CBaseUIScrollView : public CBaseUIElement {
     bool m_bScrollResistanceCheck;
     int m_iScrollResistance;
 };
-
-#endif