public override bool MouseUp(int x, int y)
{
bool result = false;
for (int i = 0; i < _techFieldButtons.Length; i++)
{
if (_techFieldButtons[i].MouseUp(x, y))
{
switch (i)
{
case 0: RefreshResearchedTechs(TechField.COMPUTER);
break;
case 1: RefreshResearchedTechs(TechField.CONSTRUCTION);
break;
case 2: RefreshResearchedTechs(TechField.FORCE_FIELD);
break;
case 3: RefreshResearchedTechs(TechField.PLANETOLOGY);
break;
case 4: RefreshResearchedTechs(TechField.PROPULSION);
break;
case 5: RefreshResearchedTechs(TechField.WEAPON);
break;
}
result = true;
}
}
for (int i = 0; i < _techLockButtons.Length; i++)
{
if (_techLockButtons[i].MouseUp(x, y))
{
switch (i)
{
case 0:
_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.ComputerLocked = !_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.ComputerLocked;
break;
case 1:
_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.ConstructionLocked = !_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.ConstructionLocked;
break;
case 2:
_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.ForceFieldLocked = !_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.ForceFieldLocked;
break;
case 3:
_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.PlanetologyLocked = !_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.PlanetologyLocked;
break;
case 4:
_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.PropulsionLocked = !_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.PropulsionLocked;
break;
case 5:
_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.WeaponLocked = !_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.WeaponLocked;
break;
}
RefreshLockedStatus();
}
}
for (int i = 0; i < _techSliders.Length; i++)
{
if (_techSliders[i].MouseUp(x, y))
{
TechField whichField = TechField.COMPUTER;
switch (i)
{
case 1: whichField = TechField.CONSTRUCTION;
break;
case 2: whichField = TechField.FORCE_FIELD;
break;
case 3: whichField = TechField.PLANETOLOGY;
break;
case 4: whichField = TechField.PROPULSION;
break;
case 5: whichField = TechField.WEAPON;
break;
}
_gameMain.EmpireManager.CurrentEmpire.TechnologyManager.SetPercentage(whichField, _techSliders[i].TopIndex);
RefreshSliders();
RefreshProgressLabels();
}
}
if (!base.MouseUp(x, y))
{
//Clicked outside window, close the window
if (CloseWindow != null)
{
CloseWindow();
return true;
}
}
return result;
}