diff --git a/doc/ChangeLog.html b/doc/ChangeLog.html index 37367e6d4..be5f91ec5 100644 --- a/doc/ChangeLog.html +++ b/doc/ChangeLog.html @@ -989,6 +989,8 @@ <LI>Fixed bug #581489: GUI - Network refresh (from Jimmy Salmon). <LI>Fixed bug #643281: Compile errors on Mac OS X 10.2.2 (from Jimmy Salmon). + <LI>Fixed bug #600046: No new construction options after upgrade (from + Russell Smith). <LI>+++ </UL> </UL> diff --git a/src/include/interface.h b/src/include/interface.h index ae3272e09..887fbb11a 100644 --- a/src/include/interface.h +++ b/src/include/interface.h @@ -395,10 +395,10 @@ extern int ButtonCheckTrue(const Unit*,const ButtonAction*); extern int ButtonCheckFalse(const Unit*,const ButtonAction*); /// Check if allowed upgrade is ready extern int ButtonCheckUpgrade(const Unit*,const ButtonAction*); - /// Check if allowed unit exists -extern int ButtonCheckUnit(const Unit*,const ButtonAction*); /// Check if allowed units exists -extern int ButtonCheckUnits(const Unit*,const ButtonAction*); +extern int ButtonCheckUnitsOr(const Unit*,const ButtonAction*); + /// Check if allowed units exists +extern int ButtonCheckUnitsAnd(const Unit*,const ButtonAction*); /// Check if have network play extern int ButtonCheckNetwork(const Unit*,const ButtonAction*); /// Check if unit isn't working (train,upgrade,research) diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index 5c6eb62eb..f27673f90 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -167,10 +167,10 @@ global void SaveButtons(FILE* file) fprintf(file,"'check-false"); } else if( UnitButtonTable[i]->Allowed == ButtonCheckUpgrade ) { fprintf(file,"'check-upgrade"); - } else if( UnitButtonTable[i]->Allowed == ButtonCheckUnit ) { - fprintf(file,"'check-unit"); - } else if( UnitButtonTable[i]->Allowed == ButtonCheckUnits ) { - fprintf(file,"'check-units"); + } else if( UnitButtonTable[i]->Allowed == ButtonCheckUnitsOr ) { + fprintf(file,"'check-units-or"); + } else if( UnitButtonTable[i]->Allowed == ButtonCheckUnitsAnd ) { + fprintf(file,"'check-units-and"); } else if( UnitButtonTable[i]->Allowed == ButtonCheckNetwork ) { fprintf(file,"'check-network"); } else if( UnitButtonTable[i]->Allowed == ButtonCheckNoWork ) { diff --git a/src/ui/button_checks.cpp b/src/ui/button_checks.cpp index a6cc7b180..d4fc8ec5d 100644 --- a/src/ui/button_checks.cpp +++ b/src/ui/button_checks.cpp @@ -95,15 +95,27 @@ global int ButtonCheckUpgrade(const Unit* unit,const ButtonAction* button) } /** -** Check for button enabled, if unit is available. +** Check for button enabled, if any unit is available. ** ** @param unit Pointer to unit for button. ** @param button Pointer to button to check/enable. ** @return True if enabled. */ -global int ButtonCheckUnit(const Unit* unit,const ButtonAction* button) +global int ButtonCheckUnitsOr(const Unit* unit,const ButtonAction* button) { - return HaveUnitTypeByIdent(unit->Player,button->AllowStr); + char* buf; + const char* s; + Player* player; + + player=unit->Player; + buf=alloca(strlen(button->AllowStr)+1); + strcpy(buf,button->AllowStr); + for( s=strtok(buf,","); s; s=strtok(NULL,",") ) { + if( HaveUnitTypeByIdent(player,s) ) { + return 1; + } + } + return 0; } /** @@ -113,7 +125,7 @@ global int ButtonCheckUnit(const Unit* unit,const ButtonAction* button) ** @param button Pointer to button to check/enable. ** @return True if enabled. */ -global int ButtonCheckUnits(const Unit* unit,const ButtonAction* button) +global int ButtonCheckUnitsAnd(const Unit* unit,const ButtonAction* button) { char* buf; const char* s; diff --git a/src/ui/script_ui.cpp b/src/ui/script_ui.cpp index d3199c24a..3b6eaaa9c 100644 --- a/src/ui/script_ui.cpp +++ b/src/ui/script_ui.cpp @@ -2994,10 +2994,10 @@ local SCM CclDefineButton(SCM list) ba.Allowed=ButtonCheckFalse; } else if( gh_eq_p(value,gh_symbol2scm("check-upgrade")) ) { ba.Allowed=ButtonCheckUpgrade; - } else if( gh_eq_p(value,gh_symbol2scm("check-unit")) ) { - ba.Allowed=ButtonCheckUnit; - } else if( gh_eq_p(value,gh_symbol2scm("check-units")) ) { - ba.Allowed=ButtonCheckUnits; + } else if( gh_eq_p(value,gh_symbol2scm("check-units-or")) ) { + ba.Allowed=ButtonCheckUnitsOr; + } else if( gh_eq_p(value,gh_symbol2scm("check-units-and")) ) { + ba.Allowed=ButtonCheckUnitsAnd; } else if( gh_eq_p(value,gh_symbol2scm("check-network")) ) { ba.Allowed=ButtonCheckNetwork; } else if( gh_eq_p(value,gh_symbol2scm("check-no-work")) ) {