Jeck - Changes to WGui, potential fix to issue 258 (please verify).
This commit is contained in:
@@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
virtual bool Changed() {return false;};
|
virtual bool Changed() {return false;};
|
||||||
virtual void confirmChange(bool confirmed) {};
|
virtual void confirmChange(bool confirmed) {};
|
||||||
virtual PIXEL_TYPE getColor(int type)=0;
|
virtual PIXEL_TYPE getColor(int type);
|
||||||
|
|
||||||
virtual void Entering(u32 key)=0;
|
virtual void Entering(u32 key)=0;
|
||||||
virtual bool Leaving(u32 key)=0;
|
virtual bool Leaving(u32 key)=0;
|
||||||
@@ -79,6 +79,9 @@ public:
|
|||||||
virtual void setId(int _id){};
|
virtual void setId(int _id){};
|
||||||
virtual void setHidden(bool bHidden) {};
|
virtual void setHidden(bool bHidden) {};
|
||||||
virtual void setVisible(bool bVisisble) {};
|
virtual void setVisible(bool bVisisble) {};
|
||||||
|
|
||||||
|
virtual void renderBack(WGuiBase * it);
|
||||||
|
virtual void subBack(WGuiBase * item) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
//This is our base class for concrete items.
|
//This is our base class for concrete items.
|
||||||
@@ -89,11 +92,11 @@ public:
|
|||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
|
|
||||||
WGuiItem(string _display);
|
WGuiItem(string _display, u8 _mF = 0);
|
||||||
virtual ~WGuiItem() {};
|
virtual ~WGuiItem() {};
|
||||||
|
|
||||||
|
string _(string input); //Override global with our flag checker.
|
||||||
virtual PIXEL_TYPE getColor(int type);
|
|
||||||
virtual void setData(){};
|
virtual void setData(){};
|
||||||
|
|
||||||
virtual bool hasFocus() {return mFocus;};
|
virtual bool hasFocus() {return mFocus;};
|
||||||
@@ -113,6 +116,12 @@ public:
|
|||||||
virtual void setWidth(float _w){width = _w;};
|
virtual void setWidth(float _w){width = _w;};
|
||||||
virtual void setHeight(float _h){height = _h;};
|
virtual void setHeight(float _h){height = _h;};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
NO_TRANSLATE = (1<<1),
|
||||||
|
};
|
||||||
|
|
||||||
|
u8 mFlags;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool mFocus;
|
bool mFocus;
|
||||||
float x, y;
|
float x, y;
|
||||||
@@ -139,7 +148,7 @@ public:
|
|||||||
virtual JQuad * getImage() {return NULL;};
|
virtual JQuad * getImage() {return NULL;};
|
||||||
virtual MTGCard * getCard() {return NULL;};
|
virtual MTGCard * getCard() {return NULL;};
|
||||||
virtual bool thisCard(int mtgid) {return false;};
|
virtual bool thisCard(int mtgid) {return false;};
|
||||||
|
virtual int getControlID() {return -1;}; //TODO FIXME: Need a "not a valid button" define.
|
||||||
virtual int getPos() {return -1;};
|
virtual int getPos() {return -1;};
|
||||||
virtual bool setPos(int pos) {return false;};
|
virtual bool setPos(int pos) {return false;};
|
||||||
virtual bool next() {return false;};
|
virtual bool next() {return false;};
|
||||||
@@ -177,6 +186,7 @@ protected:
|
|||||||
float mLastInput;
|
float mLastInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct WCardSort{
|
struct WCardSort{
|
||||||
public:
|
public:
|
||||||
virtual bool operator()(const MTGCard*l, const MTGCard*r) = 0;
|
virtual bool operator()(const MTGCard*l, const MTGCard*r) = 0;
|
||||||
@@ -242,6 +252,7 @@ public:
|
|||||||
virtual float getWidth() {return it->getWidth();};
|
virtual float getWidth() {return it->getWidth();};
|
||||||
virtual float getHeight() {return it->getHeight();};
|
virtual float getHeight() {return it->getHeight();};
|
||||||
virtual PIXEL_TYPE getColor(int type) {return it->getColor(type);};
|
virtual PIXEL_TYPE getColor(int type) {return it->getColor(type);};
|
||||||
|
WGuiBase * getDecorated() {return it;};
|
||||||
|
|
||||||
virtual void setFocus(bool bFocus) {it->setFocus(bFocus);};
|
virtual void setFocus(bool bFocus) {it->setFocus(bFocus);};
|
||||||
virtual void setDisplay(string s) {it->setDisplay(s);};
|
virtual void setDisplay(string s) {it->setDisplay(s);};
|
||||||
@@ -363,12 +374,28 @@ protected:
|
|||||||
|
|
||||||
class WGuiHeader:public WGuiItem{
|
class WGuiHeader:public WGuiItem{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
WGuiHeader(string _displayValue): WGuiItem(_displayValue) {};
|
WGuiHeader(string _displayValue): WGuiItem(_displayValue) {};
|
||||||
|
|
||||||
virtual bool Selectable() {return false;};
|
virtual bool Selectable() {return false;};
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class WDecoStyled: public WGuiDeco{
|
||||||
|
public:
|
||||||
|
WDecoStyled(WGuiItem * _it) : WGuiDeco(_it) {mStyle=DS_DEFAULT;};
|
||||||
|
PIXEL_TYPE getColor(int type);
|
||||||
|
void subBack(WGuiBase * item);
|
||||||
|
enum {
|
||||||
|
DS_DEFAULT = (1<<0),
|
||||||
|
DS_COLOR_BRIGHT = (1<<1),
|
||||||
|
DS_COLOR_DARK = (1<<2),
|
||||||
|
DS_STYLE_EDGED = (1<<4),
|
||||||
|
DS_STYLE_BACKLESS = (1<<5),
|
||||||
|
};
|
||||||
|
|
||||||
|
u8 mStyle;
|
||||||
|
};
|
||||||
|
|
||||||
class WGuiMenu: public WGuiItem{
|
class WGuiMenu: public WGuiItem{
|
||||||
public:
|
public:
|
||||||
@@ -384,8 +411,9 @@ public:
|
|||||||
virtual void confirmChange(bool confirmed);
|
virtual void confirmChange(bool confirmed);
|
||||||
virtual bool Leaving(u32 key);
|
virtual bool Leaving(u32 key);
|
||||||
virtual void Entering(u32 key);
|
virtual void Entering(u32 key);
|
||||||
virtual void renderBack(WGuiBase * it);
|
virtual void subBack(WGuiBase * item);
|
||||||
|
|
||||||
|
|
||||||
WGuiBase * Current();
|
WGuiBase * Current();
|
||||||
virtual void nextItem();
|
virtual void nextItem();
|
||||||
virtual void prevItem();
|
virtual void prevItem();
|
||||||
@@ -402,11 +430,6 @@ protected:
|
|||||||
float duration;
|
float duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WGuiFlow: public WGuiMenu{
|
|
||||||
public:
|
|
||||||
WGuiFlow();
|
|
||||||
};
|
|
||||||
|
|
||||||
class WGuiList: public WGuiMenu{
|
class WGuiList: public WGuiMenu{
|
||||||
public:
|
public:
|
||||||
WGuiList(string name, WDataSource * syncme = NULL);
|
WGuiList(string name, WDataSource * syncme = NULL);
|
||||||
|
|||||||
@@ -89,11 +89,11 @@ void GameStateAwards::Start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!si->author.size())
|
if(!si->author.size())
|
||||||
sprintf(buf,"%i cards.",si->totalCards());
|
sprintf(buf,_("%i cards.").c_str(),si->totalCards());
|
||||||
else if(si->year > 0)
|
else if(si->year > 0)
|
||||||
sprintf(buf,"%s (%i): %i cards",si->author.c_str(),si->year,si->totalCards());
|
sprintf(buf,_("%s (%i): %i cards").c_str(),si->author.c_str(),si->year,si->totalCards());
|
||||||
else
|
else
|
||||||
sprintf(buf,"%s: %i cards.",si->author.c_str(),si->totalCards());
|
sprintf(buf,_("%s: %i cards.").c_str(),si->author.c_str(),si->totalCards());
|
||||||
|
|
||||||
|
|
||||||
aw = NEW WGuiAward(Options::optionSet(i),si->getName(),buf,"Card Spoiler");
|
aw = NEW WGuiAward(Options::optionSet(i),si->getName(),buf,"Card Spoiler");
|
||||||
@@ -106,6 +106,7 @@ void GameStateAwards::Start()
|
|||||||
sprintf(buf,_("Unlocked all %i sets.").c_str(),setlist.size());
|
sprintf(buf,_("Unlocked all %i sets.").c_str(),setlist.size());
|
||||||
|
|
||||||
wgh->setDisplay(buf);
|
wgh->setDisplay(buf);
|
||||||
|
wgh->mFlags = WGuiItem::NO_TRANSLATE;
|
||||||
|
|
||||||
listview->Entering(0);
|
listview->Entering(0);
|
||||||
detailview = NULL;
|
detailview = NULL;
|
||||||
@@ -282,33 +283,33 @@ bool GameStateAwards::enterStats(int option){
|
|||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf,_("Total Value: %ic").c_str(),ddw->totalPrice());
|
sprintf(buf,_("Total Value: %ic").c_str(),ddw->totalPrice());
|
||||||
detailview->Add(NEW WGuiItem(buf));//ddw->colors
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));//ddw->colors
|
||||||
|
|
||||||
sprintf(buf,_("Total Cards (including duplicates): %i").c_str(),ddw->getCount());
|
sprintf(buf,_("Total Cards (including duplicates): %i").c_str(),ddw->getCount());
|
||||||
detailview->Add(NEW WGuiItem(buf));//ddw->colors
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));//ddw->colors
|
||||||
|
|
||||||
sprintf(buf,_("Unique Cards: %i").c_str(),unique);
|
sprintf(buf,_("Unique Cards: %i").c_str(),unique);
|
||||||
detailview->Add(NEW WGuiItem(buf));
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));
|
||||||
|
|
||||||
if(many){
|
if(many){
|
||||||
sprintf(buf,_("Most Duplicates: %i (%s)").c_str(),dupes,many->data->getName().c_str());
|
sprintf(buf,_("Most Duplicates: %i (%s)").c_str(),dupes,many->data->getName().c_str());
|
||||||
detailview->Add(NEW WGuiItem(buf));
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));
|
||||||
}
|
}
|
||||||
if(setid >= 0){
|
if(setid >= 0){
|
||||||
sprintf(buf,_("Favorite Set: %s").c_str(),setlist[setid].c_str());
|
sprintf(buf,_("Favorite Set: %s").c_str(),setlist[setid].c_str());
|
||||||
detailview->Add(NEW WGuiItem(buf));
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));
|
||||||
}
|
}
|
||||||
if(costly){
|
if(costly){
|
||||||
sprintf(buf,_("Highest Mana Cost: %i (%s)").c_str(),costly->data->getManaCost()->getConvertedCost(),costly->data->getName().c_str());
|
sprintf(buf,_("Highest Mana Cost: %i (%s)").c_str(),costly->data->getManaCost()->getConvertedCost(),costly->data->getName().c_str());
|
||||||
detailview->Add(NEW WGuiItem(buf));
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));
|
||||||
}
|
}
|
||||||
if(strong){
|
if(strong){
|
||||||
sprintf(buf,_("Most Powerful: %i (%s)").c_str(),strong->data->getPower(),strong->data->getName().c_str());
|
sprintf(buf,_("Most Powerful: %i (%s)").c_str(),strong->data->getPower(),strong->data->getName().c_str());
|
||||||
detailview->Add(NEW WGuiItem(buf));
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));
|
||||||
}
|
}
|
||||||
if(tough){
|
if(tough){
|
||||||
sprintf(buf,_("Toughest: %i (%s)").c_str(),tough->data->getToughness(),strong->data->getName().c_str());
|
sprintf(buf,_("Toughest: %i (%s)").c_str(),tough->data->getToughness(),strong->data->getName().c_str());
|
||||||
detailview->Add(NEW WGuiItem(buf));
|
detailview->Add(NEW WGuiItem(buf,WGuiItem::NO_TRANSLATE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,6 @@ void GameStateOptions::Start()
|
|||||||
|
|
||||||
optionsList = NEW WGuiList("Game");
|
optionsList = NEW WGuiList("Game");
|
||||||
optionsList->Add(NEW WGuiHeader("Interface Options"));
|
optionsList->Add(NEW WGuiHeader("Interface Options"));
|
||||||
WDecoConfirm * cLang = NEW WDecoConfirm(this,NEW OptionLanguage("Language"));
|
|
||||||
cLang->confirm = "Use this Language";
|
|
||||||
optionsList->Add(cLang);
|
|
||||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::CLOSEDHAND,"Closed hand",1,1,0)));
|
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::CLOSEDHAND,"Closed hand",1,1,0)));
|
||||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::HANDDIRECTION,"Hand direction",1,1,0)));
|
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::HANDDIRECTION,"Hand direction",1,1,0)));
|
||||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::MANADISPLAY,"Mana display",2,1,0)));
|
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::MANADISPLAY,"Mana display",2,1,0)));
|
||||||
@@ -72,7 +69,14 @@ void GameStateOptions::Start()
|
|||||||
|
|
||||||
optionsList = NEW WGuiList("Advanced");
|
optionsList = NEW WGuiList("Advanced");
|
||||||
optionsList->Add(NEW WGuiHeader("Advanced Options"));
|
optionsList->Add(NEW WGuiHeader("Advanced Options"));
|
||||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::MAX_GRADE,"Cards grade(restart)",Constants::GRADE_DANGEROUS,1,Constants::GRADE_BORDERLINE,"",Constants::GRADE_SUPPORTED)));
|
WDecoStyled * wAdv = NEW WDecoStyled(NEW WGuiHeader("The following options require a restart."));
|
||||||
|
wAdv->mStyle = WDecoStyled::DS_STYLE_BACKLESS;
|
||||||
|
optionsList->Add(wAdv);
|
||||||
|
WDecoConfirm * cLang = NEW WDecoConfirm(this,NEW OptionLanguage("Language"));
|
||||||
|
cLang->confirm = "Use this Language";
|
||||||
|
optionsList->Add(cLang);
|
||||||
|
WDecoEnum * oGra = NEW WDecoEnum(NEW OptionInteger(Options::MAX_GRADE,"Minimum Card Grade",Constants::GRADE_DANGEROUS,1,Constants::GRADE_BORDERLINE,"",Constants::GRADE_SUPPORTED));
|
||||||
|
optionsList->Add(oGra);
|
||||||
optionsTabs->Add(optionsList);
|
optionsTabs->Add(optionsList);
|
||||||
|
|
||||||
optionsList = NEW WGuiList("Credits");
|
optionsList = NEW WGuiList("Credits");
|
||||||
|
|||||||
@@ -8,17 +8,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
//WGuiItem
|
//WGuiBase
|
||||||
void WGuiItem::Entering(u32 key){
|
|
||||||
mFocus = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WGuiItem::Leaving(u32 key){
|
PIXEL_TYPE WGuiBase::getColor(int type){
|
||||||
mFocus = false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXEL_TYPE WGuiItem::getColor(int type){
|
|
||||||
switch(type){
|
switch(type){
|
||||||
case WGuiColor::TEXT_BODY:
|
case WGuiColor::TEXT_BODY:
|
||||||
case WGuiColor::SCROLLBUTTON:
|
case WGuiColor::SCROLLBUTTON:
|
||||||
@@ -40,14 +32,45 @@ PIXEL_TYPE WGuiItem::getColor(int type){
|
|||||||
return ARGB(150,50,50,50);
|
return ARGB(150,50,50,50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WGuiBase::renderBack(WGuiBase * it){
|
||||||
|
if(!it) return;
|
||||||
|
WDecoStyled * styled = dynamic_cast<WDecoStyled*>(it);
|
||||||
|
if(styled)
|
||||||
|
styled->renderBack(styled->getDecorated());
|
||||||
|
else
|
||||||
|
subBack(it);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//WGuiItem
|
||||||
|
void WGuiItem::Entering(u32 key){
|
||||||
|
mFocus = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WGuiItem::Leaving(u32 key){
|
||||||
|
mFocus = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void WGuiItem::Render(){
|
void WGuiItem::Render(){
|
||||||
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
|
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
|
||||||
mFont->SetColor(getColor(WGuiColor::TEXT));
|
mFont->SetColor(getColor(WGuiColor::TEXT));
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
JRenderer * renderer = JRenderer::GetInstance();
|
||||||
float fH = (height-mFont->GetHeight())/2;
|
float fH = (height-mFont->GetHeight())/2;
|
||||||
mFont->DrawString(_(displayValue).c_str(),x+(width/2),y+fH,JGETEXT_CENTER);
|
string trans = _(displayValue);
|
||||||
|
float fW = mFont->GetStringWidth(trans.c_str());
|
||||||
|
float boxW = getWidth();
|
||||||
|
float oldS = mFont->GetScale();
|
||||||
|
if(fW > boxW){
|
||||||
|
mFont->SetScale(boxW/fW);
|
||||||
|
}
|
||||||
|
mFont->DrawString(trans,x+(width/2),y+fH,JGETEXT_CENTER);
|
||||||
|
mFont->SetScale(oldS);
|
||||||
}
|
}
|
||||||
WGuiItem::WGuiItem(string _display){
|
|
||||||
|
WGuiItem::WGuiItem(string _display, u8 _mF){
|
||||||
|
mFlags=_mF;
|
||||||
displayValue = _display;
|
displayValue = _display;
|
||||||
mFocus = false;
|
mFocus = false;
|
||||||
width=SCREEN_WIDTH;
|
width=SCREEN_WIDTH;
|
||||||
@@ -56,12 +79,55 @@ WGuiItem::WGuiItem(string _display){
|
|||||||
y=0;
|
y=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string WGuiItem::_(string input){
|
||||||
|
if(mFlags & WGuiItem::NO_TRANSLATE)
|
||||||
|
return input;
|
||||||
|
return ::_(input);
|
||||||
|
}
|
||||||
|
|
||||||
void WGuiItem::Update(float dt){
|
void WGuiItem::Update(float dt){
|
||||||
JGE * mEngine = JGE::GetInstance();
|
JGE * mEngine = JGE::GetInstance();
|
||||||
if (mFocus){
|
if (mFocus){
|
||||||
if (mEngine->GetButtonClick(PSP_CTRL_CIRCLE)) updateValue();
|
if (mEngine->GetButtonClick(PSP_CTRL_CIRCLE)) updateValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//WDecoStyled
|
||||||
|
void WDecoStyled::subBack(WGuiBase * item){
|
||||||
|
if(!item)
|
||||||
|
return;
|
||||||
|
JRenderer * renderer = JRenderer::GetInstance();
|
||||||
|
if(mStyle & DS_STYLE_BACKLESS)
|
||||||
|
return;
|
||||||
|
//TODO: if(mStyle & DS_STYLE_EDGED) Draw the edged box ala SimpleMenu
|
||||||
|
else{ //Draw standard style
|
||||||
|
WGuiSplit * split = dynamic_cast<WGuiSplit*>(item);
|
||||||
|
if(split && split->left->Visible() && split->right->Visible()){
|
||||||
|
if(split->left)
|
||||||
|
renderer->FillRoundRect(split->left->getX()-2,split->getY()-2,split->left->getWidth()-6,split->getHeight(),2,split->left->getColor(WGuiColor::BACK));
|
||||||
|
if(split->right)
|
||||||
|
renderer->FillRoundRect(split->right->getX()-2,split->getY()-2,split->right->getWidth(),split->getHeight(),2,split->right->getColor(WGuiColor::BACK));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
renderer->FillRoundRect(item->getX()-2,item->getY()-2,item->getWidth(),item->getHeight(),2,item->getColor(WGuiColor::BACK));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
PIXEL_TYPE WDecoStyled::getColor(int type){
|
||||||
|
switch(type){
|
||||||
|
case WGuiColor::BACK:
|
||||||
|
case WGuiColor::BACK_HEADER:
|
||||||
|
if(mStyle & DS_COLOR_DARK)
|
||||||
|
return ARGB(150,35,35,35);
|
||||||
|
else if(mStyle & DS_COLOR_BRIGHT)
|
||||||
|
return ARGB(150,80,80,80);
|
||||||
|
else
|
||||||
|
return ARGB(150,50,50,50);
|
||||||
|
default:
|
||||||
|
return WGuiBase::getColor(type);
|
||||||
|
}
|
||||||
|
return ARGB(150,50,50,50);
|
||||||
|
}
|
||||||
|
|
||||||
//WGuiHeader
|
//WGuiHeader
|
||||||
void WGuiHeader::Render(){
|
void WGuiHeader::Render(){
|
||||||
@@ -445,25 +511,22 @@ void WGuiMenu::Entering(u32 key){
|
|||||||
items[currentItem]->Entering(key);
|
items[currentItem]->Entering(key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void WGuiMenu::renderBack(WGuiBase * it){
|
|
||||||
if(!it)
|
void WGuiMenu::subBack(WGuiBase * item){
|
||||||
|
if(!item)
|
||||||
return;
|
return;
|
||||||
WGuiHeader * header = dynamic_cast<WGuiHeader*>(it);
|
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
JRenderer * renderer = JRenderer::GetInstance();
|
||||||
if(header)
|
|
||||||
renderer->FillRoundRect(it->getX()-2,it->getY()-2,it->getWidth(),it->getHeight(),2,it->getColor(WGuiColor::BACK_HEADER));
|
WGuiSplit * split = dynamic_cast<WGuiSplit*>(item);
|
||||||
else{
|
if(split && split->left->Visible() && split->right->Visible()){
|
||||||
WGuiSplit * split = dynamic_cast<WGuiSplit*>(it);
|
if(split->left)
|
||||||
if(split && split->left->Visible() && split->right->Visible()){
|
renderer->FillRoundRect(split->left->getX()-2,split->getY()-2,split->left->getWidth()-6,split->getHeight(),2,split->left->getColor(WGuiColor::BACK));
|
||||||
if(split->left)
|
if(split->right)
|
||||||
renderer->FillRoundRect(split->left->getX()-2,split->getY()-2,split->left->getWidth()-6,split->getHeight(),2,split->left->getColor(WGuiColor::BACK));
|
renderer->FillRoundRect(split->right->getX()-2,split->getY()-2,split->right->getWidth(),split->getHeight(),2,split->right->getColor(WGuiColor::BACK));
|
||||||
if(split->right)
|
|
||||||
renderer->FillRoundRect(split->right->getX()-2,split->getY()-2,split->right->getWidth(),split->getHeight(),2,split->right->getColor(WGuiColor::BACK));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
renderer->FillRoundRect(it->getX()-2,it->getY()-2,it->getWidth(),it->getHeight(),2,it->getColor(WGuiColor::BACK));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
renderer->FillRoundRect(item->getX()-2,item->getY()-2,item->getWidth(),item->getHeight(),2,item->getColor(WGuiColor::BACK));
|
||||||
|
|
||||||
}
|
}
|
||||||
//WGuiList
|
//WGuiList
|
||||||
WGuiList::WGuiList(string name, WDataSource * syncme): WGuiMenu(PSP_CTRL_DOWN,PSP_CTRL_UP){
|
WGuiList::WGuiList(string name, WDataSource * syncme): WGuiMenu(PSP_CTRL_DOWN,PSP_CTRL_UP){
|
||||||
@@ -510,7 +573,7 @@ void WGuiList::Render(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Find out how large our list is.
|
//Find out how large our list is, with all items and margin.
|
||||||
for (int pos=0;pos < nbitems; pos++){
|
for (int pos=0;pos < nbitems; pos++){
|
||||||
listHeight+=items[pos]->getHeight()+1; //What does the +1 do exactly ?
|
listHeight+=items[pos]->getHeight()+1; //What does the +1 do exactly ?
|
||||||
if(items[pos]->Selectable()){
|
if(items[pos]->Selectable()){
|
||||||
@@ -570,7 +633,7 @@ void WGuiList::Render(){
|
|||||||
nowPos += items[pos]->getHeight() + 5;
|
nowPos += items[pos]->getHeight() + 5;
|
||||||
renderBack(items[pos]);
|
renderBack(items[pos]);
|
||||||
items[pos]->Render();
|
items[pos]->Render();
|
||||||
if(nowPos > SCREEN_HEIGHT)
|
if(nowPos > SCREEN_HEIGHT) //Stop displaying things once we reach the bottom of the screen.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1217,7 +1280,7 @@ void WGuiAward::Overlay(){
|
|||||||
mFont->SetScale(.8);
|
mFont->SetScale(.8);
|
||||||
mFont->SetColor(getColor(WGuiColor::TEXT));
|
mFont->SetColor(getColor(WGuiColor::TEXT));
|
||||||
|
|
||||||
string s = _(details);
|
string s = details;
|
||||||
if(s.size()){
|
if(s.size()){
|
||||||
float fW = mFont->GetStringWidth(s.c_str());
|
float fW = mFont->GetStringWidth(s.c_str());
|
||||||
float fH = mFont->GetHeight();
|
float fH = mFont->GetHeight();
|
||||||
@@ -1532,4 +1595,4 @@ bool WSrcMTGSet::thisCard(int mtgid){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user