mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
See desc for more.
- Added option, to have a 400x214px custom Image as the Background on a UniStore. - Added a header bar on almost all menus. - Added GUI Settings.
This commit is contained in:
+35
-1
@@ -40,7 +40,10 @@ static bool firstStart = true;
|
||||
|
||||
const std::string &file: The UniStore file.
|
||||
*/
|
||||
Store::Store(const std::string &file) { this->update(file); };
|
||||
Store::Store(const std::string &file) {
|
||||
this->update(file);
|
||||
this->SetC2DBGImage();
|
||||
};
|
||||
|
||||
/*
|
||||
Update an UniStore,, including SpriteSheet, if revision increased.
|
||||
@@ -409,6 +412,37 @@ C2D_Image Store::GetIconEntry(const int &index) const {
|
||||
return C2D_SpriteSheetGetImage(sprites, sprites_noIcon_idx);
|
||||
}
|
||||
|
||||
/*
|
||||
Set's the custom BG to the storeBG variable.
|
||||
*/
|
||||
void Store::SetC2DBGImage() {
|
||||
if (!this->valid) return;
|
||||
if (this->sheets.empty()) return;
|
||||
int index = -1, sheetIndex = -1;
|
||||
|
||||
if (this->storeJson["storeInfo"].contains("bg_index") && this->storeJson["storeInfo"]["bg_index"].is_number()) {
|
||||
index = this->storeJson["storeInfo"]["bg_index"];
|
||||
}
|
||||
|
||||
if (this->storeJson["storeInfo"].contains("bg_sheet") && this->storeJson["storeInfo"]["bg_sheet"].is_number()) {
|
||||
sheetIndex = this->storeJson["storeInfo"]["bg_sheet"];
|
||||
}
|
||||
|
||||
if (index == -1 || sheetIndex == -1) return;
|
||||
|
||||
if (sheetIndex > (int)this->sheets.size()) return;
|
||||
if (!this->sheets[sheetIndex]) return;
|
||||
|
||||
if (index > (int)C2D_SpriteSheetCount(this->sheets[sheetIndex])-1) return;
|
||||
|
||||
C2D_Image temp = C2D_SpriteSheetGetImage(this->sheets[sheetIndex], index);
|
||||
|
||||
if (temp.subtex->width == 400 && temp.subtex->height == 214) {
|
||||
this->hasCustomBG = true;
|
||||
this->storeBG = temp; // Must be 400x214.
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Return the download list of an entry.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user