mirror of
https://github.com/wiiu-env/launchiine.git
synced 2024-11-22 01:39:18 +01:00
Create a bunch of empty icons for later usage
This commit is contained in:
parent
477efedf24
commit
d7ed76e9f6
BIN
data/images/iconEmpty.png
Normal file
BIN
data/images/iconEmpty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -49,7 +49,8 @@ GuiIconGrid::GuiIconGrid(int32_t w, int32_t h, uint64_t GameIndex,bool sortByNam
|
|||||||
, arrowLeftImage(arrowLeftImageData)
|
, arrowLeftImage(arrowLeftImageData)
|
||||||
, arrowRightButton(arrowRightImage.getWidth(), arrowRightImage.getHeight())
|
, arrowRightButton(arrowRightImage.getWidth(), arrowRightImage.getHeight())
|
||||||
, arrowLeftButton(arrowLeftImage.getWidth(), arrowLeftImage.getHeight())
|
, arrowLeftButton(arrowLeftImage.getWidth(), arrowLeftImage.getHeight())
|
||||||
, noIcon(Resources::GetFile("noGameIcon.png"), Resources::GetFileSize("noGameIcon.png"), GX2_TEX_CLAMP_MODE_MIRROR) {
|
, noIcon(Resources::GetFile("noGameIcon.png"), Resources::GetFileSize("noGameIcon.png"), GX2_TEX_CLAMP_MODE_MIRROR)
|
||||||
|
, emptyIcon(Resources::GetFile("iconEmpty.png"), Resources::GetFileSize("iconEmpty.png"), GX2_TEX_CLAMP_MODE_MIRROR) {
|
||||||
|
|
||||||
particleBgImage.setParent(this);
|
particleBgImage.setParent(this);
|
||||||
selectedGame = GameIndex;
|
selectedGame = GameIndex;
|
||||||
@ -76,6 +77,11 @@ GuiIconGrid::GuiIconGrid(int32_t w, int32_t h, uint64_t GameIndex,bool sortByNam
|
|||||||
arrowRightButton.setTrigger(&buttonRTrigger);
|
arrowRightButton.setTrigger(&buttonRTrigger);
|
||||||
arrowRightButton.setSoundClick(buttonClickSound);
|
arrowRightButton.setSoundClick(buttonClickSound);
|
||||||
arrowRightButton.clicked.connect(this, &GuiIconGrid::OnRightArrowClick);
|
arrowRightButton.clicked.connect(this, &GuiIconGrid::OnRightArrowClick);
|
||||||
|
|
||||||
|
for(int i = 0; i< MAX_COLS * MAX_ROWS *2; i++) {
|
||||||
|
GameIcon * image = new GameIcon(&emptyIcon);
|
||||||
|
emptyIcons.push_back(image);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiIconGrid::~GuiIconGrid() {
|
GuiIconGrid::~GuiIconGrid() {
|
||||||
@ -86,6 +92,12 @@ GuiIconGrid::~GuiIconGrid() {
|
|||||||
}
|
}
|
||||||
gameInfoContainers.clear();
|
gameInfoContainers.clear();
|
||||||
containerMutex.unlock();
|
containerMutex.unlock();
|
||||||
|
|
||||||
|
for (auto const& x : emptyIcons) {
|
||||||
|
AsyncExecutor::pushForDelete(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
emptyIcons.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiIconGrid::setSelectedGame(uint64_t idx) {
|
void GuiIconGrid::setSelectedGame(uint64_t idx) {
|
||||||
@ -113,7 +125,6 @@ uint64_t GuiIconGrid::getSelectedGame(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GuiIconGrid::OnGameTitleListUpdated(GameList * gameList) {
|
void GuiIconGrid::OnGameTitleListUpdated(GameList * gameList) {
|
||||||
|
|
||||||
gameList->lock();
|
gameList->lock();
|
||||||
containerMutex.lock();
|
containerMutex.lock();
|
||||||
// At first delete the ones that were deleted;
|
// At first delete the ones that were deleted;
|
||||||
@ -214,7 +225,7 @@ void GuiIconGrid::OnGameButtonClick(GuiButton *button, const GuiController *cont
|
|||||||
void GuiIconGrid::OnGameTitleAdded(gameInfo * info) {
|
void GuiIconGrid::OnGameTitleAdded(gameInfo * info) {
|
||||||
DEBUG_FUNCTION_LINE("Adding %016llX\n", info->titleId);
|
DEBUG_FUNCTION_LINE("Adding %016llX\n", info->titleId);
|
||||||
GuiImageData * imageData = &noIcon;
|
GuiImageData * imageData = &noIcon;
|
||||||
if(info->imageData != NULL){
|
if(info->imageData != NULL) {
|
||||||
imageData = info->imageData;
|
imageData = info->imageData;
|
||||||
}
|
}
|
||||||
GameIcon * image = new GameIcon(imageData);
|
GameIcon * image = new GameIcon(imageData);
|
||||||
|
@ -72,6 +72,7 @@ private:
|
|||||||
GuiButton arrowLeftButton;
|
GuiButton arrowLeftButton;
|
||||||
|
|
||||||
GuiImageData noIcon;
|
GuiImageData noIcon;
|
||||||
|
GuiImageData emptyIcon;
|
||||||
|
|
||||||
void OnLeftArrowClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
void OnLeftArrowClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
||||||
void OnRightArrowClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
void OnRightArrowClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
||||||
@ -122,4 +123,8 @@ private:
|
|||||||
|
|
||||||
std::recursive_mutex containerMutex;
|
std::recursive_mutex containerMutex;
|
||||||
std::map<uint64_t, GameInfoContainer *> gameInfoContainers;
|
std::map<uint64_t, GameInfoContainer *> gameInfoContainers;
|
||||||
|
|
||||||
|
std::vector<GuiImage *> emptyIcons;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user