Thrive icon indicating copy to clipboard operation
Thrive copied to clipboard

Reduced lag when opening art gallery as the image cards now load in o…

Open AaronMcGarry opened this issue 2 years ago • 2 comments

…ne every 0.1 seconds

Brief Description of What This PR Does

All the cards in the first tab have a timer that determines when they should start loading, which eliminates most of the lag.

Related Issues closes #3464

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • [x] PR author has checked that this PR works as intended and doesn't break existing features: https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist (this is important as to not waste the time of Thrive team members reviewing this PR)
  • [ ] Initial code review passed (this and further items should not be checked by the PR author)
  • [ ] Functionality is confirmed working by another person (see above checklist link)
  • [ ] Final code review is passed and code conforms to the styleguide.

Before merging all CI jobs should finish on this PR without errors, if there are automatically detected style issues they should be fixed by the PR author. Merging must follow our styleguide.

AaronMcGarry avatar Jul 21 '22 20:07 AaronMcGarry

Not sure why its failing this test, because I didn't have any style warnings when I committed. Also, the log says "Code cleanup performed changes, please stage / check them before committing", but I'm not sure where to find the changes.

AaronMcGarry avatar Jul 22 '22 02:07 AaronMcGarry

The jetbrains check shows the diff of what changes it wants you to perform:

--- a/src/gui_common/art_gallery/GalleryCard.cs
+++ b/src/gui_common/art_gallery/GalleryCard.cs
@@ -16,7 +16,7 @@ public class GalleryCard : Button
     private Label? titleLabel;
     private TextureRect? imagePreview;
     private Texture? thumbnail;
-    private bool isLoaded = false;
+    private bool isLoaded;
     private float time;
 
     [Signal]

hhyyrylainen avatar Jul 22 '22 05:07 hhyyrylainen