Skip to content

Commit

Permalink
load game and savedata icon in file browser
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Sep 18, 2024
1 parent f88f048 commit 624554b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions extras/menus/arkMenu/include/browser_entries.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ class BrowserFolder : public BrowserFile{
BrowserFolder(string parent, string name, string shortname);

~BrowserFolder();

string getName();

char* getType();

char* getSubtype();

void loadIcon();
};

#endif
2 changes: 1 addition & 1 deletion extras/menus/arkMenu/include/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Entry{
Entry(string path);
virtual ~Entry()=0;

string getName();
virtual string getName();
void setName(string name);
string getPath();
void setPath(string path);
Expand Down
21 changes: 20 additions & 1 deletion extras/menus/arkMenu/src/browser_entries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ BrowserFolder::BrowserFolder(string path, string shortname){
BrowserFolder::BrowserFolder(string parent, string name, string shortname){
this->icon0 = NULL;
this->path = parent + name + '/';
this->name = name + '/';
this->name = name;
this->parent = parent;
this->selected = false;
this->fileSize = "Folder";
Expand All @@ -177,10 +177,29 @@ BrowserFolder::BrowserFolder(string parent, string name, string shortname){
BrowserFolder::~BrowserFolder(){
}

string BrowserFolder::getName(){
return this->name + '/';
}

char* BrowserFolder::getType(){
return "FOLDER";
}

char* BrowserFolder::getSubtype(){
return getType();
}

void BrowserFolder::loadIcon(){
string icon_path = this->path + "ICON0.PNG";
string eboot_path = "";
if (common::fileExists(icon_path)){
this->icon0 = new Image(icon_path);
}
else if ((eboot_path = Eboot::fullEbootPath(parent, name)).length() > 0){
Eboot* eboot = new Eboot(eboot_path);
eboot->loadIcon();
this->icon0 = eboot->getIcon();
eboot->setIcon(NULL);
delete eboot;
}
}
4 changes: 4 additions & 0 deletions extras/menus/arkMenu/src/umd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ UMD::~UMD(){
sceUmdDeactivate(1, "disc0:");
}

string UMD::getName(){
return name;
}

void UMD::loadIcon(){
Image* icon = NULL;

Expand Down

0 comments on commit 624554b

Please sign in to comment.