Mantis 0001075:

o Fixed bug that made items on the popupmenu be disabled for aliens in classic games

The bug was in AvHPlayer::UpdateTechNodes(), where the techs would not be set to researchable once flagged as unresearchable, causing them all to be unresearchable from the start of the game, and disallowing lifeforms after gestating to them.

I also added a check so that the menu states won't be updated every frame for the client unless the menu is active.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@262 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
tankefugl 2005-07-12 12:31:21 +00:00
parent c01812d4b0
commit 877b337309
2 changed files with 36 additions and 3 deletions

View file

@ -4611,7 +4611,15 @@ void AvHHud::UpdateCommonUI()
if(this->GetManager().GetVGUIComponentNamed(this->mPieMenuControl, thePieMenu))
{
this->UpdateUpgradeCosts();
// tankefugl: Added check to ensure that it is only updated when a menu is visible
if (thePieMenu->getChildCount() > 0)
{
vgui::Panel *rootMenu = thePieMenu->getChild(0);
if (rootMenu && rootMenu->isVisible())
{
this->UpdateUpgradeCosts();
}
}
PieNode* theCurrentNode = NULL;
if(thePieMenu && thePieMenu->GetSelectedNode(theCurrentNode))

View file

@ -9594,9 +9594,26 @@ void AvHPlayer::UpdateTechNodes()
theLifeform = ALIEN_LIFEFORM_FIVE;
break;
}
// tankefugl 0001075 : Reset techs to researchable before flagging them otherwise
theTechNodes.SetIsResearchable(ALIEN_LIFEFORM_ONE, true);
theTechNodes.SetIsResearchable(ALIEN_LIFEFORM_TWO, true);
theTechNodes.SetIsResearchable(ALIEN_LIFEFORM_THREE, true);
theTechNodes.SetIsResearchable(ALIEN_LIFEFORM_FOUR, true);
theTechNodes.SetIsResearchable(ALIEN_LIFEFORM_FIVE, true);
theTechNodes.SetIsResearchable(theLifeform, false);
// If not Gorge, set buildables to be unavailable
// tankefugl 0001075 : Reset techs to researchable before flagging them otherwise
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_ONE, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_TWO, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_THREE, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_SEVEN, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_EIGHT, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_NINE, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_TEN, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_ELEVEN, true);
theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_TWELVE, true);
// If not Gorge, set buildables to be unavailable
if(theLifeform != ALIEN_LIFEFORM_TWO)
{
theTechNodes.SetIsResearchable(ALIEN_BUILD_HIVE, false);
@ -9608,7 +9625,15 @@ void AvHPlayer::UpdateTechNodes()
}
else
{
// If we have the max hives, disable hives
// tankefugl 0001075 : Reset techs to researchable before flagging them otherwise
theTechNodes.SetIsResearchable(ALIEN_BUILD_HIVE, true);
theTechNodes.SetIsResearchable(ALIEN_BUILD_RESOURCES, true);
theTechNodes.SetIsResearchable(ALIEN_BUILD_OFFENSE_CHAMBER, true);
theTechNodes.SetIsResearchable(ALIEN_BUILD_DEFENSE_CHAMBER, true);
theTechNodes.SetIsResearchable(ALIEN_BUILD_MOVEMENT_CHAMBER, true);
theTechNodes.SetIsResearchable(ALIEN_BUILD_SENSORY_CHAMBER, true);
// If we have the max hives, disable hives
bool theHasFreeUpgradeCategory = false;
MessageIDListType theUnsupportedUpgrades;