Skip to content

Commit

Permalink
Library: Various restructuring and changes
Browse files Browse the repository at this point in the history
- Cached data is now stored and handled separately for more flexibility
- Solved various issues related to incorrectly cached data
- Added a Refresh option for official covers
- Various asset labels were shortened
  • Loading branch information
Aemony committed Oct 6, 2023
1 parent 571d698 commit f06e884
Show file tree
Hide file tree
Showing 2 changed files with 1,897 additions and 1,926 deletions.
58 changes: 58 additions & 0 deletions include/tabs/library.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,63 @@

#pragma once

#include <utility/games.h>
#include <stores/Steam/app_record.h>

void SKIF_UI_Tab_DrawLibrary (void);


// Cached struct used to hold calculated data across frames
struct SKIF_Lib_SummaryCache
{
struct {
std::string type;
std::string type_version;
struct {
std::string text;
ImColor color;
ImColor color_hover;
} status;
std::string hover_text;
} injection;

std::string config_repo;

struct {
std::wstring shorthandW;
std::string shorthand; // Converted to utf-8 from utf-16
std::wstring root_dirW;
std::string root_dir; // Converted to utf-8 from utf-16
std::wstring full_pathW;
std::string full_path; // Converted to utf-8 from utf-16
} config;

struct {
std::wstring shorthandW;
std::string shorthand; // Converted to utf-8 from utf-16
std::wstring versionW;
std::string version; // Converted to utf-8 from utf-16
std::wstring full_pathW;
std::string full_path; // Converted to utf-8 from utf-16
} dll;

AppId_t app_id = 0;
DWORD running = 0;
bool service = false;
bool autostop = false;

void Refresh (app_record_s* pApp);

// Functions
static SKIF_Lib_SummaryCache& GetInstance (void)
{
static SKIF_Lib_SummaryCache instance;
return instance;
}

SKIF_Lib_SummaryCache (SKIF_Lib_SummaryCache const&) = delete; // Delete copy constructor
SKIF_Lib_SummaryCache (SKIF_Lib_SummaryCache&&) = delete; // Delete move constructor

private:
SKIF_Lib_SummaryCache (void) { }; // Do nothing
};
Loading

0 comments on commit f06e884

Please sign in to comment.