Jeck - unsigned/signed fix, options fixes

* Abstracted out option calls to "f3" behind Constants::OPTION_FONT
 * Added option to disable card image loading.
This commit is contained in:
wagic.jeck
2009-09-24 23:26:32 +00:00
parent 6d9b488878
commit 2020dce4fd
7 changed files with 28 additions and 16 deletions

View File

@@ -33,6 +33,7 @@ public:
CLOSEDHAND,
HANDDIRECTION,
REVERSETRIGGERS,
DISABLECARDS,
INTERRUPT_SECONDS,
//My interrupts
INTERRUPTMYSPELLS,

View File

@@ -114,6 +114,7 @@ class Constants
MAIN_FONT = 0,
MENU_FONT = 1,
MAGIC_FONT = 2,
OPTION_FONT = 1,
};
static char MTGColorChars[];

View File

@@ -20,6 +20,8 @@ const char * Options::optionNames[] = {
"displayOSD",
"closed_hand",
"hand_direction",
"reverse_triggers",
"disable_cards",
"interruptSeconds",
"interruptMySpells",
"interruptMyAbilities",
@@ -457,13 +459,20 @@ GameOption& GameSettings::operator[](int optionID){
}
if(option_name.size() > 2){
if(option_name[0] == '_' && option_name[1] == 't')
return (*themeOptions)[optionID];
else if(option_name[0] == '_' && option_name[1] == 'g')
return (*globalOptions)[optionID];
if(option_name[0] == '_' && option_name[1] == 't'){
if(themeOptions)
return (*themeOptions)[optionID];
}
else if(option_name[0] == '_' && option_name[1] == 'g'){
if(globalOptions)
return (*globalOptions)[optionID];
}
}
return (*profileOptions)[optionID];
if(profileOptions)
return (*profileOptions)[optionID];
return invalid_option;
}

View File

@@ -46,6 +46,7 @@ void GameStateOptions::Start()
optionsList->Add(NEW OptionClosedHand(Options::CLOSEDHAND, "Closed hand"));
optionsList->Add(NEW OptionHandDirection(Options::HANDDIRECTION, "Hand direction"));
optionsList->Add(NEW OptionInteger(Options::REVERSETRIGGERS, "Reverse left and right triggers"));
optionsList->Add(NEW OptionInteger(Options::DISABLECARDS,"Disable card image loading"));
optionsTabs->Add(optionsList);
optionsList = NEW OptionsList("Profiles");

View File

@@ -481,7 +481,7 @@ int GuiCombat::receiveEventMinus(WEvent* e)
autoaffectDamage(*attacker, step);
for (inner_iterator it = attackers.begin(); it != attackers.end(); ++it)
(*it)->show = ((*it)->card->has(Constants::DOUBLESTRIKE) || ((*it)->card->has(Constants::FIRSTSTRIKE) ^ (DAMAGE == step))) &&
(((*it)->card->has(Constants::TRAMPLE) ? 0 : 1) < (*it)->blockers.size()
(((*it)->card->has(Constants::TRAMPLE) ? (unsigned int) 0 : (unsigned int) 1) < (*it)->blockers.size()
);
repos<AttackerDamaged>(attackers.begin(), attackers.end(), 0);
active = NULL;

View File

@@ -45,7 +45,7 @@ OptionItem::OptionItem( int _id, string _displayValue) {
//Option Integer
void OptionInteger::Render(){
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
if (hasFocus){
mFont->SetColor(options[Metrics::OPTION_ITEM_TCH].asColor(ARGB(255,255,255,0)));
}else{
@@ -109,7 +109,7 @@ void OptionSelect::initSelections(){
}
void OptionSelect::Render(){
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
if (hasFocus){
mFont->SetColor(options[Metrics::OPTION_ITEM_TCH].asColor(ARGB(255,255,255,0)));
}else{
@@ -152,7 +152,7 @@ ostream& OptionSelect::toString(ostream& out) const
//OptionHeader
void OptionHeader::Render(){
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
mFont->SetColor(options[Metrics::OPTION_HEADER_TC].asColor());
JRenderer * renderer = JRenderer::GetInstance();
@@ -161,7 +161,7 @@ void OptionHeader::Render(){
}
void OptionText::Render(){
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
mFont->SetScale(.8);
mFont->SetColor(options[Metrics::OPTION_TEXT_TC].asColor());
@@ -248,7 +248,7 @@ void OptionProfile::populate(){
void OptionProfile::Render(){
JRenderer * renderer = JRenderer::GetInstance();
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
mFont->SetScale(1);
int spacing = 2+(int)mFont->GetHeight();
@@ -435,7 +435,7 @@ void OptionsList::Render(){
//List is empty.
if (!nbitems && failMsg != ""){
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
mFont->SetColor(options[Metrics::MSG_FAIL_TC].asColor(ARGB(255,155,155,155)));
mFont->DrawString(failMsg.c_str(),SCREEN_WIDTH/2, 40, JGETEXT_RIGHT);
return;
@@ -636,7 +636,7 @@ void OptionsMenu::Update(float dt){
OptionsMenu::OptionsMenu(){
nbitems=0;
current=0;
mFont = resources.GetJLBFont("f3");
mFont = resources.GetJLBFont(Constants::OPTION_FONT);
for(int x=0;x<MAX_OPTION_TABS;x++)
tabs[x] = NULL;
}
@@ -720,7 +720,7 @@ void OptionsList::cancelSubmode()
void OptionString::Render(){
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
if (hasFocus){
mFont->SetColor(options[Metrics::OPTION_ITEM_TCH].asColor(ARGB(255,255,255,0)));
}else{
@@ -834,7 +834,7 @@ void OptionEnum::Render()
{
EnumDefinition * def = ourDefined();
JLBFont * mFont = resources.GetJLBFont("f3");
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
if (hasFocus)
mFont->SetColor(options[Metrics::OPTION_ITEM_TCH].asColor(ARGB(255,255,255,0)));
else

View File

@@ -194,7 +194,7 @@ WResourceManager::~WResourceManager(){
JQuad * WResourceManager::RetrieveCard(MTGCard * card, int style, int submode){
//Cards are never, ever resource managed, so just check cache.
if(!card)
if(!card || options[Options::DISABLECARDS].number)
return NULL;
submode = submode | TEXTURE_SUB_CARD;