Fixed some bugs, Hide Faction Augmentations Content in the hideAllContent() function

This commit is contained in:
Daniel Xie 2017-02-28 11:10:35 -06:00
parent 7aa42321f2
commit 37b5152103
4 changed files with 36 additions and 36 deletions

@ -14,7 +14,7 @@ p {
}
h1 {
color: #66ff33;
}
h2 {

@ -367,9 +367,10 @@
</div>
<div id="faction-augmentations-container">
<h1 id> Faction Augmentations </h1>
<h1> Faction Augmentations </h1>
<p id="faction-augmentations-page-desc"> Lists all augmentations that are available from </p>
<ul class="factions-augmentations-list" id="factions-augmentations-list">
<a href="#" id="faction-augmentations-back-button" class="a-link-button"> Back </a>
<ul class="faction-augmentations-list" id="faction-augmentations-list">
</ul>
</div>

@ -124,7 +124,12 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
}
invitedFactions = []; //Array which will hold all Factions th eplayer should be invited to
var companyRep = Companies[this.companyName].playerReputation;
var company = Companies[this.companyName];
if (company == null) {
return invitedFactions;
}
var companyRep = company.playerReputation;
//Illuminati
var illuminatiFac = Factions["Illuminati"];
@ -454,6 +459,12 @@ displayFactionContent = function(factionName) {
purchaseAugmentations.parentNode.replaceChild(newPurchaseAugmentationsButton, purchaseAugmentations);
newPurchaseAugmentationsButton.addEventListener("click", function() {
Engine.hideAllContent();
Engine.Display.factionAugmentationsContent.style.visiblility = "visible";
document.getElementById("faction-augmentations-back-button").addEventListener("click", function() {
displayFactionContent(factionName);
return false;
});
displayFactionAugmentations(factionName);
return false;
});
@ -600,22 +611,6 @@ displayFactionContent = function(factionName) {
}
displayFactionAugmentations = function(factionName) {
//E.g:
//Add the faction to the Factions page content
var item = document.createElement("li");
var aElem = document.createElement("a");
aElem.setAttribute("href", "#");
aElem.setAttribute("class", "a-link-button");
aElem.innerHTML = faction.name;
aElem.addEventListener("click", function() {
displayFactionContent(faction.name);
return false;
});
item.appendChild(aElem);
var factionsList = document.getElementById("factions-list");
factionsList.appendChild(item);
var faction = Factions[factionName];
var augmentationsList = document.getElementById("faction-augmentations-list");

@ -28,24 +28,25 @@ var Engine = {
hacking_skill: null,
//Main menu content
terminalContent: null,
characterContent: null,
scriptEditorContent: null,
activeScriptsContent: null,
worldContent: null,
createProgramContent: null,
factionsContent: null,
factionContent: null,
augmentationsContent: null,
tutorialContent: null,
locationContent: null,
workInProgressContent: null,
terminalContent: null,
characterContent: null,
scriptEditorContent: null,
activeScriptsContent: null,
worldContent: null,
createProgramContent: null,
factionsContent: null,
factionContent: null,
factionAugmentationsContent: null,
augmentationsContent: null,
tutorialContent: null,
locationContent: null,
workInProgressContent: null,
//Character info
characterInfo: null,
characterInfo: null,
//Script editor text
scriptEditorText: null,
scriptEditorText: null,
},
//Current page status
@ -264,6 +265,7 @@ var Engine = {
Engine.Display.createProgramContent.style.visibility = "hidden";
Engine.Display.factionsContent.style.visibility = "hidden";
Engine.Display.factionContent.style.visibility = "hidden";
Engine.Display.factionAugmentationsContent.style.visibility = "hidden";
Engine.Display.augmentationsContent.style.visibility = "hidden";
Engine.Display.tutorialContent.style.visibility = "hidden";
Engine.Display.locationContent.style.visibility = "hidden";
@ -527,8 +529,7 @@ var Engine = {
updateSkillLevelsCounter: 10, //Only update skill levels every 2 seconds. Might improve performance
updateDisplays: 10, //Update displays such as Active Scripts display and character display
serverGrowth: 450, //Process server growth every minute and a half
//checkFactionInvitations: 1500, //Check whether you qualify for any faction invitations every 5 minutes
checkFactionInvitations: 30,
checkFactionInvitations: 1500, //Check whether you qualify for any faction invitations every 5 minutes
},
decrementAllCounters: function(numCycles = 1) {
@ -709,6 +710,9 @@ var Engine = {
Engine.Display.factionContent = document.getElementById("faction-container");
Engine.Display.factionContent.style.visibility = "hidden";
Engine.Display.factionAugmentationsContent = document.getElementById("faction-augmentations-container");
Engine.Display.factionAugmentationsContent.style.visibility = "hidden";
Engine.Display.augmentationsContent = document.getElementById("augmentations-container");
Engine.Display.augmentationsContent.style.visibility = "hidden";