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 { h1 {
color: #66ff33;
} }
h2 { h2 {

@ -367,9 +367,10 @@
</div> </div>
<div id="faction-augmentations-container"> <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> <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> </ul>
</div> </div>

@ -124,7 +124,12 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
} }
invitedFactions = []; //Array which will hold all Factions th eplayer should be invited to 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 //Illuminati
var illuminatiFac = Factions["Illuminati"]; var illuminatiFac = Factions["Illuminati"];
@ -454,6 +459,12 @@ displayFactionContent = function(factionName) {
purchaseAugmentations.parentNode.replaceChild(newPurchaseAugmentationsButton, purchaseAugmentations); purchaseAugmentations.parentNode.replaceChild(newPurchaseAugmentationsButton, purchaseAugmentations);
newPurchaseAugmentationsButton.addEventListener("click", function() { 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); displayFactionAugmentations(factionName);
return false; return false;
}); });
@ -600,22 +611,6 @@ displayFactionContent = function(factionName) {
} }
displayFactionAugmentations = 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 faction = Factions[factionName];
var augmentationsList = document.getElementById("faction-augmentations-list"); var augmentationsList = document.getElementById("faction-augmentations-list");

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