Skip to content

Commit

Permalink
fixed visuals
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 20, 2023
1 parent 460af01 commit 0438242
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion extras/menus/xMenu/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace common{
extern void deleteData();
extern Image* getBG();
extern Image* getNoIcon();
extern void printText(float x, float y, const char *text);
extern void printText(float x, float y, const char *text, u32 color = WHITE_COLOR);
extern void flip();

}
Expand Down
4 changes: 2 additions & 2 deletions extras/menus/xMenu/src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Image* common::getNoIcon(){
return noicon;
}

void common::printText(float x, float y, const char *text){
printTextScreen(x, y, text, WHITE_COLOR);
void common::printText(float x, float y, const char *text, u32 color){
printTextScreen(x, y, text, color);
}

void common::flip(){
Expand Down
16 changes: 7 additions & 9 deletions extras/menus/xMenu/src/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ ARKConfig* ark_config = &_ark_conf;
static SEConfig _se_conf;
SEConfig* se_config = &_se_conf;

static string ark_version;
string ark_version;

static std::string toggle = "LT - Menu";
static std::string toggle = "Triangle -> Options Menu";

Menu::Menu(){

this->readEbootList("ms0:/PSP/GAME/");
this->readEbootList("ms0:/PSP/APPS/");
this->readEbootList("ef0:/PSP/GAME/");
this->index = 0;
this->start = 0;
this->txt = NULL;
Expand Down Expand Up @@ -130,9 +131,9 @@ void Menu::draw(){

// draw all image stuff
for (int i=this->start; i<min(this->start+3, (int)eboots.size()); i++){
int offset = 8 + (90 * (i-this->start));
int offset = (82 * (i-this->start));
blitAlphaImageToScreen(0, 0, eboots[i]->getIcon()->imageWidth, \
eboots[i]->getIcon()->imageHeight, eboots[i]->getIcon(), 10, offset+8);
eboots[i]->getIcon()->imageHeight, eboots[i]->getIcon(), 10, offset);
if (i == this->index){
static u32 alpha = 0;
static u32 delta = 5;
Expand All @@ -149,18 +150,15 @@ void Menu::draw(){

// draw all text stuff
for (int i=this->start; i<min(this->start+3, (int)eboots.size()); i++){
int offset = 8 + (90 * (i-this->start));
int offset = (82 * (i-this->start));
if (i == this->index)
this->txt->draw(offset);
else
common::printText(200, offset+30, eboots[i]->getName().c_str());
}

// draw ARK version and info
common::printText(2, 2, ark_version.c_str());

// draw help text
common::printText(RIGHT-toggle.length()-10, BOTTOM, toggle.c_str());
common::printText(475-8*toggle.length(), 2, toggle.c_str());

}

Expand Down
7 changes: 6 additions & 1 deletion extras/menus/xMenu/src/submenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ static t_conf config;
extern SEConfig* se_config;
extern ARKConfig* ark_config;

extern string ark_version;

/*
static char* OPTIONS[] = {
(char*)"Disabled",
Expand Down Expand Up @@ -91,6 +93,9 @@ void SubMenu::updateScreen(){
// menu window
fillScreenRect(color, x, y, w, h);

// draw ARK version and info
common::printText(x + ((w-8*ark_version.size())/2), y+5, ark_version.c_str());

// menu items
int cur_x;
int cur_y = y + (h-(10*n))/2;
Expand Down Expand Up @@ -130,7 +135,7 @@ void SubMenu::run() {
switch (index){
case 0: changeMsCacheSetting(); getItems(); break;
case 1: rebootMenu(); break;
case 2: sceKernelExitGame(); break;
case 2: menu->fadeOut(); sceKernelExitGame(); break;
}
}
else if (control.up()){
Expand Down

0 comments on commit 0438242

Please sign in to comment.