Jeck - Minor language support fiddling, gui decorator for cheat-profile only options.

This commit is contained in:
wagic.jeck
2009-11-02 06:15:37 +00:00
parent 779921a53f
commit 6946544a2a
4 changed files with 27 additions and 7 deletions

View File

@@ -239,6 +239,15 @@ class WDecoEnum : public WGuiDeco {
EnumDefinition * edef;
};
class WDecoCheat: public WGuiDeco {
public:
WDecoCheat(WGuiBase * _it);
virtual bool Visible();
virtual void Reload();
protected:
bool bVisible;
};
class WGuiButton: public WGuiDeco{
public:
WGuiButton( WGuiBase* _it, int _controller, int _control, JGuiListener * jgl);

View File

@@ -152,9 +152,9 @@ void GameStateMenu::Start(){
//How many cards total ?
PlayerData * playerdata = NEW PlayerData(mParent->collection);
if(playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
sprintf(nbcardsStr, "%s: %i cards (%i)", options[Options::ACTIVE_PROFILE].str.c_str(), playerdata->collection->totalCards(), mParent->collection->totalCards());
sprintf(nbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(), playerdata->collection->totalCards(), mParent->collection->totalCards());
else
sprintf(nbcardsStr, "Database: %i cards", mParent->collection->totalCards());
sprintf(nbcardsStr, _("Database: %i cards").c_str(), mParent->collection->totalCards());
SAFE_DELETE(playerdata);
@@ -312,9 +312,9 @@ void GameStateMenu::Update(float dt)
//List active profile and database size.
PlayerData * playerdata = NEW PlayerData(mParent->collection);
if(playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
sprintf(nbcardsStr, "%s: %i cards (%i)", options[Options::ACTIVE_PROFILE].str.c_str(), playerdata->collection->totalCards(), mParent->collection->totalCards());
sprintf(nbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(), playerdata->collection->totalCards(), mParent->collection->totalCards());
else
sprintf(nbcardsStr, "Database: %i cards", mParent->collection->totalCards());
sprintf(nbcardsStr, _("Database: %i cards").c_str(), mParent->collection->totalCards());
SAFE_DELETE(playerdata);
resetDirectory();
//All major things have been loaded, resize the cache to use it as efficiently as possible

View File

@@ -36,8 +36,8 @@ void GameStateOptions::Start()
optionsList->Add(NEW OptionInteger(Options::OSD, "Display InGame extra information"));
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number)
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::DIFFICULTY,"Difficulty",3,1,0),OptionDifficulty::getInstance()));
if(options[Options::ACTIVE_PROFILE].str == SECRET_PROFILE)
optionsList->Add(NEW OptionInteger(Options::CHEATMODE, "Enable cheat mode"));
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable cheat mode")));
optionsList->Add(NEW OptionInteger(Options::INTERRUPT_SECONDS, "Seconds to pause for an Interrupt", 20, 1));
optionsList->Add(NEW OptionInteger(Options::INTERRUPTMYSPELLS, "Interrupt my spells"));
optionsList->Add(NEW OptionInteger(Options::INTERRUPTMYABILITIES, "Interrupt my abilities"));

View File

@@ -774,7 +774,18 @@ void WDecoEnum::Render()
}
WDecoEnum::WDecoEnum(WGuiBase * _it, EnumDefinition *_edef) : WGuiDeco(_it) {edef = _edef;}
//WDecoCheat
WDecoCheat::WDecoCheat(WGuiBase * _it): WGuiDeco(_it){
bVisible = (options[Options::ACTIVE_PROFILE].str == SECRET_PROFILE);
}
void WDecoCheat::Reload(){
bVisible = (options[Options::ACTIVE_PROFILE].str == SECRET_PROFILE);
}
bool WDecoCheat::Visible(){
if(bVisible && it && it->Visible())
return true;
return false;
}
//WDecoConfirm
WDecoConfirm::WDecoConfirm(JGuiListener * _listener, WGuiBase * _it): WGuiDeco(_it){