Skip to content

Commit

Permalink
make text more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 20, 2023
1 parent d05d30e commit b8f41f6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
16 changes: 8 additions & 8 deletions extras/menus/xMenu/include/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

// Colors
enum colors {
RED = 0xFF0000FF,
GREEN = 0xFF00FF00,
BLUE = 0xFFFF0000,
WHITE = 0xFFFFFFFF,
LITEGRAY = 0xFFBFBFBF,
GRAY = 0xFF7F7F7F,
DARKGRAY = 0xFF3F3F3F,
BLACK = 0xFF000000,
RED = 0x000000FF,
GREEN = 0x0000FF00,
BLUE = 0x00FF0000,
WHITE = 0x00FFFFFF,
LITEGRAY = 0x00BFBFBF,
GRAY = 0x007F7F7F,
DARKGRAY = 0x003F3F3F,
BLACK = 0x00000000,
};

using namespace std;
Expand Down
19 changes: 15 additions & 4 deletions extras/menus/xMenu/src/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void Menu::readEbootList(string path){
string fullpath = fullPath(path, dit->d_name);
if (strcmp(dit->d_name, ".") == 0) continue;
if (strcmp(dit->d_name, "..") == 0) continue;
if (strcmp(dit->d_name, "SCPS10084") == 0) continue;
//if (strcmp(dit->d_name, "SCPS10084") == 0) continue;
if (common::fileExists(path+dit->d_name)) continue;
if (!isPOPS(fullpath)) continue;

Expand Down Expand Up @@ -131,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 = (82 * (i-this->start));
int offset = 1 + (80 * (i-this->start));
blitAlphaImageToScreen(0, 0, eboots[i]->getIcon()->imageWidth, \
eboots[i]->getIcon()->imageHeight, eboots[i]->getIcon(), 10, offset);
eboots[i]->getIcon()->imageHeight, eboots[i]->getIcon(), 25, offset);
if (i == this->index){
static u32 alpha = 0;
static u32 delta = 5;
Expand All @@ -150,7 +150,7 @@ void Menu::draw(){

// draw all text stuff
for (int i=this->start; i<min(this->start+3, (int)eboots.size()); i++){
int offset = (82 * (i-this->start));
int offset = 1 + (80 * (i-this->start));
if (i == this->index)
this->txt->draw(offset);
else
Expand All @@ -160,6 +160,17 @@ void Menu::draw(){
// draw help text
common::printText(475-8*toggle.length(), 2, toggle.c_str());

// draw scrollbar
{
int height = 230/eboots.size();
int x = 5;
int y = 10;
fillScreenRect(DARKGRAY, x+2, y, 3, height*eboots.size());
fillScreenRect(DARKGRAY, x+1, y + index*height, 5, height);
fillScreenRect(LITEGRAY, x+3, y, 1, height*eboots.size());
fillScreenRect(LITEGRAY, x+2, y + index*height, 3, height);
}

}

void Menu::updateScreen(){
Expand Down
11 changes: 8 additions & 3 deletions extras/menus/xMenu/src/submenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,18 @@ void SubMenu::updateScreen(){
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());
{
int dx = ((w-8*ark_version.size())/2);
fillScreenRect(color&0x00FFFFFF, x+dx, y+5, 8*ark_version.size(), 8);
common::printText(x + dx, y+5, ark_version.c_str());
}

// menu items
int cur_x;
int cur_y = y + (h-(10*n))/2;
for (int i=0; i<n; i++){
cur_x = x + ((w-(8*options[i].size()))/2);
fillScreenRect(color&0x00FFFFFF, cur_x, cur_y+4, 8*options[i].size(), 8);
if(i==0)
common::printText(cur_x, cur_y+4, options[i].c_str());
else
Expand Down Expand Up @@ -137,7 +142,7 @@ void SubMenu::run() {
save_status = "";

Controller control;
control.flush();
control.update();
while(1) {

updateScreen();
Expand All @@ -160,7 +165,7 @@ void SubMenu::run() {
}

}
control.flush();
control.update();
}

SubMenu::~SubMenu() {}
Expand Down

0 comments on commit b8f41f6

Please sign in to comment.